Hacker News new | ask | show | jobs
by StavrosK 3434 days ago
Lua is strictly worse than MicroPython, I find. Memory usage is worse, and managing programs on it is bad too, although I haven't used it as much as MicroPython.
1 comments

Have you seen the eLua LTR (Lua Tiny RAM) patch?

http://www.eluaproject.net/doc/v0.9/en_arch_ltr.html

As for Rust, why do we think that should use significantly less memory than MicroPython or Lua? I've seen some threads with people doing measurements on simple programs and finding Rust up to 10x heavier on RAM than C.

http://stackoverflow.com/questions/32762102/why-do-rust-prog...

If you looked at the link you included you'd see why the Rust version is larger, because they include the static library.

There's nothing about Rust that intrinsically makes it larger than C.

You would need a basic standard library built with the binary when building for xtensa (esp) aswell. So yes, the size of the core parts of the stdlib between c and rust definitely do play a role.
My problem with Lua and MicroPython is that your actual code takes up memory, ie even comments. Micropython can now compile to bytecode and load that, though, so it's better. I've had problems with Lua trying to load one or two hundred lines, though.
Lua is perfectly capable of compiling to bytecode and running that as well...
Oh is it? It's been a while since I last tried it, I'll have another look, thank you!
Can't say about NodeMCU or whatever, but Lua has had bytecode and all since Lua 1.1, back in 1994