News for hackers. Stuff that matters.
Re:A Look at the Design of Lua by patrec on Tuesday October 30, 2018 @04:22AM (#18334703)
I don't think that's a completely fair assessment. It's true that the language has some gratuitous feeling warts (not being zero based is a very severe flaw where embedding into C/C++ apps is a primary use case; it also messes up luajit and terra's UX no end, global by default is another problem, albeit one that can be mitigated with tooling). But what other language packs so much punch for so little weight? Despite being quite simple, the syntax still is expressive enough for a lot of DSL uses. Lua has proper tail recursion and an elegant co-routine design and it's slightly idiosyncratic lpeg library is worlds better than the regexp offerings of most languages. It has serious meta-programming power based on a much simpler model than e.g. python or ruby.

Despite its warts lua still feels like a better (imperative, statement-based) scheme than scheme to me. What scheme offers a similar combination of speed and expressiveness for the same conceptual and file-size weight as lua(jit)?

Wrt to repl: the torch7 repl is quite serviceable, so it's worth giving it a try even if you're not into deep learning.

Re:A Look at the Design of Lua by antirez on Tuesday October 30, 2018 @05:15AM (#18334940)
I agree on the value/codebase-size ratio to be great, it's why I chosen it for Redis for instance. But yet most of the things I expressed in my comment were not competing factors, since the code base would be enlarged very slightly. In fact the bigger addition that is the integer type was added in 5.3.
Re:A Look at the Design of Lua by patrec on Tuesday October 30, 2018 @07:33AM (#18335517)
I'm not disagreeing with your assessment that lua has serious warts (that have basically no upside, unlike say no "true" integer type, which has pros and cons). I'm just saying your portrayal is a bit lopsided, there are various aspects in which lua is a more elegant design than other dynamically typed languages like python, ruby, perl, scheme etc. I.e. small footprint and good embedding story are not the only merits of the language.
Re:A Look at the Design of Lua by antirez on Tuesday October 30, 2018 @07:40AM (#18335566)
I've problems at recognizing any significant part of Lua that is better designed than Ruby, from the POV of the language itself, pretending implementations do not exist. But this is just a personal POV so we could argue forever. I also bet that a very good subset of Ruby could be implemented with a similar-sized code base than Lua (but not at the same speed probably).
Re:A Look at the Design of Lua by ModernMech on Tuesday October 30, 2018 @09:14AM (#18336129)
> a very good subset of Ruby could be implemented with a similar-sized code base than Lua

That would have to be quite the subset. The Ruby parser alone is almost 12kLOC. I've implemented entire languages in 1/10th that.

https://github.com/ruby/ruby/blob/trunk/parse.y

Re:A Look at the Design of Lua by roi on Tuesday October 30, 2018 @10:53AM (#18337014)
mruby (http://mruby.org/, https://github.com/mruby/mruby) is the official attempt to do just that. Depending on what you count it's around 30-60kLOC. It has a standalone bytecode compiler, so the parser (which is "only" 6kLOC) doesn't have to be a part of the runtime.
Re:A Look at the Design of Lua by justinmk on Tuesday October 30, 2018 @10:50AM (#18336987)
> Wrt to repl: the torch7 repl is quite serviceable, so it's worth giving it a try

Sounds great, but:

    $ luarocks install trepl
    Error: No results matching query were found.
Also the torch7 repo[1] mentions:

> Torch is not in active developement

Is there a maintained torch7 repl somewhere?

[1] https://github.com/torch/torch7

Re:A Look at the Design of Lua by naveen99 on Wednesday October 31, 2018 @08:30AM (#18345071)
What other language: autohotkey
Re:A Look at the Design of Lua by mega-tux on Friday November 02, 2018 @05:13PM (#18366825)
Autohotkey looks nice but Windows only.

Maybe Pawn or NekoVM.

https://nekovm.org/doc/lua/ https://github.com/compuphase/pawnv Also, everybody loves benchmarks: https://github.com/r-lyeh-archived/scriptorium