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 availability #4

Open
chrysn opened this issue Jan 24, 2020 · 1 comment
Open

no_std availability #4

chrysn opened this issue Jan 24, 2020 · 1 comment

Comments

@chrysn
Copy link

chrysn commented Jan 24, 2020

From a brief look over the code (and judging from the explanations around slabs in the docs), fasteval should be easily usable on platforms without dynamic memory allocation. Some features around the "easy use" parts might be unavailable, but that wouldn't hurt too much.

A typical way this can be done in recent (2018) Rust versions is to convert what can be done to from std:: to core:: (eg. core::mem), and cfg-gate everything that does need real standard library features (implementing std::error, file I/O) behind a new and default std feature. Thus, regular users see no change, but embedded users will set default-features to false.

One use case where this would come in handy is embedded devices, which could then be configurable with custom expressions rather than only static parameters (think configuring the intensity of a floor light as ((t < 300) && 1) || max(0, (t - 305) / 5, (t - 310) / 20) instead of configuring a runtime of 5 minutes and a fade-out time of 10 seconds with no hopes to customize the fading).

Please consider supporting no_std for this crate.

@likebike
Copy link
Owner

This is a great idea. Thanks! I'll do this when I get some time.

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

No branches or pull requests

2 participants