lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2014-05-29 20:21 GMT+02:00 Andrew Starks <andrew.starks@trms.com>:
> I made a simple addition to the REPL: The '-p' flag. It pauses on close
> until any key is pressed.
>
> The commit is here:
>
> https://github.com/trms/lua/commit/260d478fb31c83153ce5d1705254b2bc7e9ce5a0
>
> (lua.c is the relevant change)
>
> We use this for Visual Studio, which closes the the CMD window immediately
> after closing. There are other ways to do it, of course...

Well, this whole thread happened overnight in my timezone, and people have
already been all over where it might lead. So one more semi-relevant comment
can't do any harm :-)

The Lua REPL is "a sample host program called `lua`, which uses the Lua library
to offer a complete, standalone Lua interpreter, for interactive or batch use."
So modifying it in whatever way is 100% in line with the intentions of the Lua
authors.

Note "for interactive or batch". This dual-purpose objective creates some minor
anomalies: `lua` is greedy at line endings in batch mode but not in
interactive mode.

Now the obligatory off-topic part.

There have been many attempts to offer another REPL, but none so widely
accepted as for example to make it into Ubuntu. In the case of Python, though,
there is vanilla `python` and `ipython`.

The reason, IMHO, is that all the various Lua REPLs are nice but underwhelming.
Each offers a handful of nifty features which appeal to the author,
but not a vastly
different experience. (I'm keeping quiet about support. Support comes by itself
if the user base is large enough.)

`ipython`, on the other hand, has so many features that it takes 150 lines to
describe them briefly. It consists of 80000 lines of Python code. It has
interactive help down to idiot level, colorized output, context-sensitive
word completion, and much more. It is quite obviously not something
people feel they could have knocked together themselves on a rainy Sunday
afternoon.

If I've missed something, and one of those Lua REPLs I have not tried
in fact comes close, please shout.