Hacker News new | ask | show | jobs
by semi-extrinsic 3434 days ago
What's wrong with Lua? It has first class support thanks to NodeMCU, you can customise your firmware builds to be lean on resources using a dead simple online tool, and it even lets you run code on the ESP8266 in an interactive REPL environment.
1 comments

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.
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