rhaiscript / rhai

Rhai - An embedded scripting language for Rust.
https://crates.io/crates/rhai
Apache License 2.0
3.63k stars 174 forks source link

What's the minium Flash memory does Rhai need for microchips? #720

Open youngzhaozju opened 1 year ago

youngzhaozju commented 1 year ago

Hey, I want to utilize Rhai on STM32. I found some advices from the book that it is not advised to utilized it on microchips. I am wondering what's the minimum requirements? And, how to make it to be minimum? Thank you! Yang

schungx commented 1 year ago

Well, mainly code size. I think for a full-build Rhai engine, the code size is at least of the order of 700-800KB. That may be too large for embedded. If your device can contain that, then it should be fine for you.

Of course, you can prune down features and you should be able to get the size down, but I see 300-400KB as a practical lower limit.

Performance-wise, I've seen a few users use Rhai on the STM32 quite successfully. You may search for some of those projects.

schungx commented 1 year ago

@youngzhaozju did you end up finding out?