4 ms·
>These are quite unfair arguments against Lua, especially since that you seem to be using it for low level networking code and on embedded systems, which are no
by anilakar 8y ago
>These are quite unfair arguments against Lua, especially since that you seem to be using it for low level networking code and on embedded systems, which are not really Lua's strong points.
Why is Lua an oft-recommended programming language for embedded development if one is not allowed to form opinions on the language?
>so it would be weird to model it upon memory offsets
Why does the language provide table constructors {1, 2, 3} that do one-based indexing then? Why is there a table length operator (#) that works on one-based indexes? Why does ipairs work with one-based indexes? A sequential data type (array, list, for some quirky reason named "tables" in lua) is one of the most basic data structures of a programming language. If Lua is supposed to be a scripting language, why should a programmer care about the underlying implementation?
>Bitwise and UTF-8 string operations are lacking out of the box, but these are arguably too specialized to be expected in a general scripting language.
Is Lua a toy or a tool?
>Lua 5.3 do have some functions to deal with UTF-8 codepoints
I welcome you to the real world, where 5.1 is still the latest available release available on too many platforms.
>Perhaps you mistook the wiki as the main document?
Lua-users.org turns up as the first result when you google for documentation.
- 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".