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

Try to enhance no std support #98

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Sieluna
Copy link
Contributor

@Sieluna Sieluna commented Jan 19, 2025

Currently, only loading module through file uses std. We can consider excluding this part to make lib support no-std.

}
}

impl RuntimeBuilder {
/// create a named module runtime builder
Copy link
Contributor Author

@Sieluna Sieluna Jan 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new entrance for builder, make import module with variant names easier.

@Sieluna
Copy link
Contributor Author

Sieluna commented Jan 22, 2025

@lum1n0us Can you give me some suggestions? I think this proposal would be helpful.

@lum1n0us
Copy link
Collaborator

Love it. We might rebase this after PR #102 has been merged.


I thought the idea was about creating the smallest possible program without using the standard library, but it appears to be going in a different direction. Am I wrong?

@Sieluna
Copy link
Contributor Author

Sieluna commented Jan 22, 2025

I thought the idea was about creating the smallest possible program without using the standard library, but it appears to be going in a different direction. Am I wrong?

I think what I've done aligns with the principles advocated by Rust. However, it was inspired by this discussion:
https://stackoverflow.com/questions/57611219/when-adding-no-std-to-a-library-are-there-any-disadvantages-or-complicati

@lum1n0us
Copy link
Collaborator

lum1n0us commented Feb 3, 2025

Library users certainly don't need to worry. If a library enables no_std, its users are not required to enable no_std as well. The compiler will manage it appropriately.

Using no_std is definitely a challenge for library developers, since core is a subset of the std crate. Without access to alloc and advanced features (like Vec and String), developers face many limitations in programming. However, libraries also gain strong compatibility and cross-platform capabilities by using no_std.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants