Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-std support for Rust #83

Open
stevefan1999-personal opened this issue Sep 16, 2023 · 5 comments
Open

no-std support for Rust #83

stevefan1999-personal opened this issue Sep 16, 2023 · 5 comments
Assignees
Labels
question Further information is requested
Milestone

Comments

@stevefan1999-personal
Copy link
Contributor

I want to use this in a compiler project but the core part of the compiler, namely the parsing part is split out as no_std code and only specific loading algorithms are std only. This makes it quite difficult for Rust Embedding community as well

@woutersl
Copy link
Member

Hi, no_std could be a reachable goal if alloc is still amenable to you. I think removing all allocation is impossible, LR and GLR algorithms were not designed for this use case.

@woutersl woutersl self-assigned this Sep 18, 2023
@woutersl woutersl added the question Further information is requested label Sep 18, 2023
@stevefan1999-personal
Copy link
Contributor Author

@woutersl Yes that would be wonderful, given that we just need to have a static buffer to declare as a heap memory blob, having alloc is fine.

@woutersl
Copy link
Member

@stevefan1999-personal , I just published a version 4.3.0 of hime_redist, with support for no_std. There is a "Support for no_std" paragraph in the package description showing how to setup the dependency for this purpose (which is just the classic having std feature that can be deactivated). alloc is still required as previously mentioned.

@stevefan1999-personal
Copy link
Contributor Author

@woutersl Much appreciated!

@stevefan1999-personal
Copy link
Contributor Author

stevefan1999-personal commented Sep 23, 2023

@woutersl I also want to see if the codegen part could support no_std as well, in particular it seems like use std::io::Read is emitted every time and need some manual intervention. I intent to use the SDK to directly generate the code every time you compile the parser, but std::io is not emigrated to core::io yet in the current time, so it is quite hard to decide.

https://github.com/cenotelie/hime/blob/e8df5b66f7ab075276f4f0ab49684d6d8ffb7d31/sdk-rust/src/output/lexer_rust.rs#L68C39-L68C39

@woutersl woutersl added this to the 5.0.0.release milestone Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants