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

The crate is now no_std with no breaking changes with default-features. #132

Merged
merged 2 commits into from
Dec 22, 2023

Conversation

Grinkers
Copy link
Collaborator

@Grinkers Grinkers commented Dec 19, 2023

(Edited a second time, after running on real hardware)

This ended up being a lot easier than I expected. The one breaking change is anybody using --no-default-features (likely only me, introduced only recently with sets) probably wants to add --features std.

https://github.com/Grinkers/pico-edn/blob/main/pico-edn/src/lib.rs
It runs on real hardware!

dev-dependencies rely on std, so things get really weird with examples. We couldn't run them anyway, so I think examples should live in a separate repo. Running tests and test coverage is also likely going to be really hard/impractical. We still test everything, logically, with a std env though.

I'll probably write a tiny little lisp that controls some hardware via s-expressions over serial as a more complete example for the org.

I think this is ready. Any thoughts?

@Grinkers Grinkers force-pushed the no_std branch 6 times, most recently from 2dd4371 to fc1f68f Compare December 19, 2023 05:00
@Grinkers
Copy link
Collaborator Author

Grinkers commented Dec 19, 2023

Rebased and cleaned. Still waiting on 125. sets also work, but json doesn't work. even with the no_std version of regex, it can't target the hardware I regularly use. I'll leave it for now and see what I have for more powerful embedded boards available. A relatively small thing.

@Grinkers Grinkers self-assigned this Dec 19, 2023
@Grinkers
Copy link
Collaborator Author

Grinkers commented Dec 19, 2023

Update, it's running on real hardware! Fully working project here
https://github.com/Grinkers/pico-edn

It's running on an $0.80 processor with sets. Full deserialization and serialization.
https://www.digikey.com/en/products/detail/raspberry-pi/SC0914-7/14306009

I'm running it on custom hardware, but it should work on a https://www.raspberrypi.com/products/raspberry-pi-pico/

hello edn {:bar 9042.123, :count 1, :foo #{1, 2, 3, 42, }, }
hello edn {:bar 9042.123, :count 2, :foo #{1, 2, 3, 42, }, }
hello edn {:bar 9042.123, :count 3, :foo #{1, 2, 3, 42, }, }
hello edn {:bar 9042.123, :count 4, :foo #{1, 2, 3, 42, }, }
hello edn {:bar 9042.123, :count 5, :foo #{1, 2, 3, 42, }, }

output looks like this via serial

@Grinkers Grinkers marked this pull request as ready for review December 19, 2023 20:58
@Grinkers
Copy link
Collaborator Author

Marked as ready, although it has conflicts with #125. It would be nice to get that done first, then I can resolve conflicts that pop up.

@evaporei Additionally, a macro sanity check with edn-derive would probably be good too. derive has dependencies on std but all the underlying std types should be exposed when using the std feature. It should be easy easy to test after evaporei/edn-derive#32

I will benchmark and write details about memory usage after #123, which will include an optimization pass.

btw it should also be easy to compile to wasm now too, if anybody wants to play with that.

Cargo.toml Show resolved Hide resolved
Copy link
Owner

@naomijub naomijub left a comment

Choose a reason for hiding this comment

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

LGTM

@Grinkers
Copy link
Collaborator Author

Actually, edn-derive is in our tests already. Going ahead with the merge.

@Grinkers Grinkers merged commit d64f20c into main Dec 22, 2023
4 checks passed
@Grinkers Grinkers deleted the no_std branch December 22, 2023 08:53
@Grinkers Grinkers mentioned this pull request Dec 22, 2023
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