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

support no_std #287

Merged
merged 8 commits into from
Oct 7, 2023
Merged

support no_std #287

merged 8 commits into from
Oct 7, 2023

Conversation

dragazo
Copy link
Contributor

@dragazo dragazo commented Aug 26, 2023

I have a compiler/interpreter project I'm developing for embedded systems, and this crate looks perfect for saving a ton of heap space and gaining locality for my many symbol tables. The only issue is that it needs to be no_std and #29 was closed a long time ago. So I've gone ahead and redone that work here.

It's pretty much all just a switch from std to core or alloc versions of things, plus a new (default) feature flag called std that enables a few small things like operations on OsString and the like.

The new version passes all test cases in standard mode, successfully builds in no-std mode, and miri has no issues with anything.

@ParkMyCar
Copy link
Owner

Thanks for the PR @dragazo! One of the reasons I closed #29 was I couldn't figure out how to test for no_std support in CI. I would want to make sure we have an automated way to detect regressions here. Do you think you could try adding this?

P.S. your compiler/interpreter project sounds very cool!

@dragazo
Copy link
Contributor Author

dragazo commented Aug 30, 2023

Oh sure, I have a trick I use to test that in my no-std libs, which is to cross-compile targeting thumbv6m-none-eabi, which does not (and likely will never) support the standard library. I just added a new github workflow for that.

The only issue it discovered was caused by a missing LifetimeFree impl for String, which is a no-std compatability issue in castaway. I've already fixed that in a fork, which is pending approval here. Once that's merged and eventually published, we'll just need to switch out to the new alloc feature I added for that dep, and it should pass the CI I just added to this repo.

@ParkMyCar
Copy link
Owner

Oh sure, I have a trick I use to test that in my no-std libs, which is to cross-compile targeting thumbv6m-none-eabi, which does not (and likely will never) support the standard library. I just added a new github workflow for that.

Neat! That's a good trick to know

The only issue it discovered was caused by a missing LifetimeFree impl for String, which is a no-std compatability issue in castaway. I've already fixed that in a fork, which is pending approval here. Once that's merged and eventually published, we'll just need to switch out to the new alloc feature I added for that dep, and it should pass the CI I just added to this repo.

Sounds great, thanks for putting up a PR against castaway!

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