5 ms·
> Why is Lua an oft-recommended programming language for embedded development if one is not allowed to form opinions on the language? I have never heard anyone
by boomlinde 8y ago
> Why is Lua an oft-recommended programming language for embedded development if one is not allowed to form opinions on the language?
I have never heard anyone recommend Lua for embedded development. It's an embeddable language in the sense that you can easily embed the entire interpreter in a larger application and extend it. That it happens to be relatively small and easy on memory is a bonus, not a reason to believe that it's a great systems programming language.
I'm not at all surprised that it disappointed you as a language for low level networking code. Most Lua success stories are about its use as a high level glue/scripting/configuration language, letting the application handle the low level code via an API.
- scruple 8y agoWhat you're saying is true, but it's not a stretch, in an embedded system, where you are using Lua as a "high level glue/scripting/configuration language, letting the application handle the low level code via an API" to then consider using it for scripts and more on the device itself. The runtime is small and, all things considered, it's very fast. While I never got to a place where I was writing low-level networking code with it, when I was still in embedded I did use it for a number of tasks that it was perhaps not quite perfectly suited for because of it's characteristics. I'm no longer in embedded, but I can easily imagine having pushed that idea further with projects like LuaJIT showing up in more recent years.
- boomlinde 8y agoYes, I'm definitely not saying that it can't or shouldn't be used for embedded applications, memory and speed constraints permitting, just that I never heard anyone recommend it as being more useful for that purpose than languages that explicitly target that niche. I also think that GP rather confused "embedded language" with being a language particularly suited for embedded systems development than having heard it being touted as such. The GP obviously ran into some obstacles using Lua 5.1 for systems programming, though, and my point is that his experience probably doesn't reflect the overall utility of the language as much as it presents a case of "the wrong tool for the job".