3 ms·
"Lua is so nice, but ..." Questions for the Lua critics. How many Python modules, e.g., in C, have you written. Which language is easier to write modules for
by 1vuio0pswjnm7 5y ago
"Lua is so nice, but ..."
Questions for the Lua critics. How many Python modules, e.g., in C, have you written. Which language is easier to write modules for, Lua or Python. Ever compare the startup time of the Lua interpreter to the Python one. What s the tally of applications that have embedded Lua interpreters versus those that have embdedded Python ones.
Because it is (optionally) embedded in applications I use every day and/or rely on, whether it's a DNS load balancer, a TCP/HTTP proxy server or a fast OS kernel, I always use Lua for "practical purposes".
Python seems to have development team of millions, but would I rather have a smaller interpreter with faster startup that is easier to write modules for. To me, that is an important question. Will I ever write Python modules in C for own use, or will I have to choose someone else's library and become 100% reliant on it. Does that limit the true "DIY" potential of Python vis-a-vis Lua.
At least the parent did not use the "indices start at one" justification for concluding Lua is inferior. In the early days of Lua, that was a red flag to me that this language must be good, if that s the best criticism anyone could come up with.
- wruza 5y agoI was using Lua in the same ways for years, but after all that came to undeniable conclusion: you spend too much time writing static int l_foo(lua_State *L) { size_t len; const char *s = luaL_checkstring(L, 1, &len); luaL_newuserdata(…); return 1; } luaL_register(…); much more than appropriate. It feels like you are serving Lua, not the other way round. Reimplementing basic functions that Lua doesn’t have, writing too much glue in C to make it look like native interface. It is also very un-crossplatform when you use rocks (Lua’s PM). Lua is nice and fast and powerful with its metatables, environments and true coroutines, and I miss that in other scripting toy-languages like python and js. And if Lua took place in js ecosystem, we’d be much less fucked on the frontend side, exactly because of these mechanisms. But it is an engine without a cabin and wheels and nothing changes. As of nil, “:/.” and others like local…in, table=array, it just becomes an always-itching scratch after years. Lua doesn’t even respect full backwards compatibility (not that it was claimed) but its authors stick to the principles that many folks tried to un-convince them to no avail. language must be good, if that s the best criticism anyone could come up with That’s only the shallow surface, the real talk always goes in the mailing list before the release.
- krapp 5y agoThe experience of working with C through LuaJIT is a joy in comparison, IMO. It's much easier to extend C in Lua than it is to extend Lua in C. And of course you could always just write functions in Lua and call them from C.
- kzrdude 5y agoI have written Lua modules in C, and I learned from and was impressed by how they designed it to be embeddable. I know the stark difference to Python now. However, my bread and butter is currently mostly in Python. If you need C modules for Python, use Cython for the binding, don't write them "from scratch".