6 ms·
I find Lua more interesting than Python. It has all the simplicity, all of the power, none of the indentation, and is quite a nice portable tool. That said, I
by fit2rule 13y ago
I find Lua more interesting than Python. It has all the simplicity, all of the power, none of the indentation, and is quite a nice portable tool.
That said, I do wonder at times what it is about Lua that makes so many people not-interested in it, when .. from my naive point of view .. its an almost perfect language for rapid development. I don't have that feeling about Python, quite so much ..
- theorique 13y ago+1 I'm a user of both, fan of both, but the lightness of Lua is a big plus. The main downside, IMO, is that the Lua user base is smaller so there's more need to roll your own solutions for things that Python already has several libraries for.
- CmonDev 13y ago"roll your own solutions" - that's part of fun!
- collyw 13y agoits also time consuming, and often buggier than pre-rolled tested solutions.
- dagw 13y agoI agree. However the people paying me would rather I spent my time solving their problems.
- theorique 13y agoFor a personal project, sure, but if it's a work project that has to get to the goal line along with ten other things, right NOW!, then it's nice to have some drop-in libraries that "just work".
- freehunter 13y agoI love, love, love Lua. I use it for everything. That being said, there's a lot I'd like to use it for that I can't. I'm not a great programmer by a longshot, I'm a hacker in the most traditional of senses (ie, not a hacker who builds billion-dollar wildly successful startups. I write one-off programs to solve a need or to automate a task). Lua doesn't have a lot of features. This is great because it's small and simple to learn, but it makes some jobs harder. As I'm not a great programmer, there are features that people could write themselves, but that's beyond my skill level. I'm constantly pushing tasks to the OS level, which makes my code one step above a Bash script. Other times I'll push something to C, which turns friendly code into a death trap. Lua needs some love and care from the community and it would be perfect. Python has that love and care, but it's still a mess (IMO) at the core language.
- CmonDev 13y ago"but it's still a mess (IMO) at the core language" - and the whole version 2 vs 3 adoption problem.
- frik 13y agoMe too. Lua the language and LuaJIT the third party vm are great. But there is no general purpose standard library. Like in C one has very limited libraries that are shipped with Lua - that's fine. Though I really miss a good website with a list of additional up-to-date libraries and a community around it. Lua needs a better project website, like PHP where you can post code examples as comments. At the momemt the Lua website is stuck in 1999. The wiki software is bad, the only way to stay in touch is the mailing list, etc. The LuaForge website is outdated. Finding various libraries is pain. Many libraries are hosted on servers that don't exist anymore or are for Lua 4 or 5.1 but not 5.2. A lot of users use Lua in closed source software as embedded language (video games, Adobe programs, etc.) Imagine if all those libraries that you find for Python would be available for Lua, it would be great.
- roel_v 13y ago"That said, I do wonder at times what it is about Lua that makes so many people not-interested in it, when .. from my naive point of view .. its an almost perfect language for rapid development." Probably because the core language is only a small part of what determines a language's usefulness. Python has heaps of tools and libraries, is used in many software packages as the scripting language, and is generally well-known by scientists. Who cares about syntax, really. It's the ecosystem that makes a language powerful.
- fit2rule 13y agoThats why I find it curious that more hackers don't adopt Lua, and the Lua VM, for a lot of projects - you can put the VM anywhere. ANY. Where. It takes less than a day to get the Lua VM inserted in a project, and from that point on you have a powerful engine for productive development..
- roel_v 13y ago... They don't adopt it because the ecosystem is so much smaller, as I said. Chicken and egg, and Python had the first mover advantage. I embedded Python from C++ in less than a day too, that is not the problem. It's the design of the API for the integration which takes the work.
- xfax 13y agoI have no exposure to Lua. How is the library support for scientific computing?
- frik 13y agoScientific Computing with Lua: http://www.scilua.org/ http://www.scilua.org/ Scientific libraries for Lua: http://stackoverflow.com/questions/388172/scientific-libraries-for-lua http://stackoverflow.com/questions/388172/scientific-librari... "A Primer of Scientific Computing in Lua" (book chapter in "Lua Gems" book), source code: http://code.google.com/p/luagems-numeric/downloads/list http://code.google.com/p/luagems-numeric/downloads/list LuaTex, an extended version of pdfTeX using Lua as an embedded scripting language: http://www.luatex.org/ http://www.luatex.org/
- gaius 13y agoFor me, Tcl does what Lua does, but much better. In fact given Tcl, it's hard to see why Lua was created.
- dkersten 13y agogiven Tcl, it's hard to see why Lua was created Because: From 1977 until 1992, Brazil had a policy of strong trade barriers (called a market reserve) for computer hardware and software. In that atmosphere, Tecgraf's clients could not afford, either politically or financially, to buy customized software from abroad. Those reasons led Tecgraf to implement the basic tools it needed from scratch. https://en.wikipedia.org/wiki/Lua_(programming_language)#History https://en.wikipedia.org/wiki/Lua_(programming_language)#His...
- gaius 13y agoVery interesting, I did not know that - esp. since Tcl was free!
- dded 13y agoI hope you're wrong about Lua, which I've never used. But allow me to say that I have to use Tcl, and I hate it. I want to like it, the syntax is clean and code has a nice look to it. But the everything-is-a-string [1] semantics is awkward to deal with. As with shell scripting, a lot of what you do amounts to solving problems with quoting. I find Tcl hard to debug, and I don't like the scoping (upvar!). I'd much rather use Emacs Lisp. In fact, Cadence uses a language of their own, called Skill, for some of their tools. It's so close to Emacs Lisp it may as well be identical, and it's far easier to deal with than Tcl. [1] That's no longer true under the hood. But Tcl behaves as if it's true.
- fit2rule 13y agoI think Lua improves on the Tcl "everything-is-a-string" semantics a great deal: everything is a table, or a string, or a number. The great thing about Lua is that tables - or, rather, metatable programming - is really, really powerful. I'm finding it difficult to think of an example of a common, powerful data structure that we all know and love, which can't be implemented with Lua tables/metatables. Lists, hashes, arrays, tries, trees, all of these basic things work so well in the context of the Lua table. However, you have to learn what a table is, in Lua. You have to learn how to use it effectively. A lot of times, folks don't take the effort to understand how metatables can be used to turn your average Lua table into .. objected-oriented constructs (classes), queues, stacks, etc. But if you do make at least this milestone in learning Lua: watch out! You won't want to use any other language, ever again! :)