Hey folks!
I was curious if anyone know the history of or technical reasoning to picking lua for an embedded scripting language interpreter.
I've noticed pandoc also embeds lua.
No language aesthetics from me. Just curious
Hey folks!
I was curious if anyone know the history of or technical reasoning to picking lua for an embedded scripting language interpreter.
I've noticed pandoc also embeds lua.
No language aesthetics from me. Just curious
I'm not an OpenWRT developer but I'm pretty sure that there wasn't any other alternative.
Any other scripting language are so much bigger that even can't fit into 4mb flash. Maybe only perl can fit into but it's a terrible language.
In the same time Lua was actively used by game developers and is small and well tested, and even has a JIT compiler. But most important that it's easy to embed and execute from a C program. Basically uhttpd web server has a built-in Lua interpreter and that's why it can execute Lua scripts so fast.
Scripts are needed for several reasons:
param == ""
' takes only few bytes while compiled from C this will use much more space.And even now there is no any other good alternatives. I know only this that are used for microcontrollers like STM32:
Anyway any of those micro version of languages doesn't make a lot of sense. Lua anyway can be learned in a day, so why bother? It may be a good to use Python to be able to use it's libraries but... then you'll need the whole Python batteries that can't fit into old devices.
But I think that new routers now have a lot of space and faster CPU. And from what I see almost all they have the CPython installed. In the same time Rust, Go and even Kotlin Native one day will be fully supported by OpenWRT and most developers will use them.
In the same time for a basic scripting it may be a good idea to just extend BusyBox ash to become a full language i.e. add arrays and maps and that really may be good option
Thank you for the helpful summary and explanations @stokito!
Ah, that makes total sense to me! I hadn't realized that core limitation.
Sounds like a good fit for an openwrt project.
This sounds fun!
I program in Rust and feel like its design values line up with some of the needs OpenWrt devices have. I have also heard the C FFI is quite ergonomic. But mainly I'm curious about writing or contributing something in Rust
FYI https://github.com/jow-/ucode
The ucode language is a tiny general purpose scripting language featuring a syntax closely resembling ECMAScript.