Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The entire purpose of Javascript is that it's a "scripting" language, so having an interactive runtime is kind of the point.

If your use case is plugging a keyboard into your MCU or connecting a terminal prompt on the UART, then the MCU needs to be running a parser, yes. But there may be many real-world use cases where your "scripts" will be going through some kind of deployment and release process, and adding a step to compile them to bytecode is easy. But YMMV depending on what you need.

> not using malloc/free is actually a feature, not a bug

Microvium maintains its own managed heap which uses a compacting garabage collector, so that heap allocations there are fast O(1) and have no fragmentation. But it needs to occassionally get chunks of memory from the host/OS to expand its managed heap, which is where it uses malloc.

I agree that there are better and worse ways to use dynamic memory. I have more thoughts here: https://coder-mike.com/blog/2022/05/27/single-threading-is-m...



A UART REPL is always the use case that advocates of Python and JS on microcontrollers bring up as one of the main reasons to use it. I haven't tried it myself but it does sound compelling.

So I think excluding that use case is a bit odd.

Maybe you could have two configurations - one with a parser and one without. Most microcontrollers are not restricted to 16kB of RAM these days.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: