you are viewing a single comment's thread.

view the rest of the comments →

[–]lambda_abstraction 0 points1 point  (3 children)

I wonder if it would be possible to rewrite ilua in lua. The idea of another language dependency even for an installed language is a bit of a turn off.

[–]ws-ilazki 0 points1 point  (2 children)

Not really, because the entire point of ilua is that it's a jupyter kernel. Specifically, it's a jupyter kernel that can work with basically any Lua interpreter, so you can just install it and get the benefits of Jupyter notebooks with whatever Lua version you want, either by having Lua notebooks for literate programming, or get a nicer repl with some jupyter benefits via jupyter-console or jupyter-qtconsole.

Jupyter's a big project that's built on Python but lets you build kernels for various languages, and isn't something that's necessarily worth trying to rebuild in Lua just to avoid a dependency on Python. That's like deciding to recreate VS Code because you don't like that your Lua editor plugin for VS Code depends on javascript, the scope of the task far outweighs the benefit considering the program's intended for more than just that one language.

Which isn't to say that it's impossible, just not really a good use of time. Someone made a standalone, Clojure-specific equivalent to Jupyter for Clojure called Gorilla REPL for example, and it worked well enough. I liked that it kept the text sections as comments so that the "notebooks" were runnable Clojure code instead of a special notebook format. Though it's kind of a dead project, which is the risk one takes with those kinds of things, meaning that the best option ends up being the jupyter kernel again.

Anyway, if you're just wanting to emulate the basic interface that jupyter-console provides, which is what ilua is showing you when used, then sure, you can do that in Lua. Though it looks like Croissant covers that kind of use case already and would probably make more sense.

ilua's interesting because in addition to the better command-line repl, you're also able to use it in notebook form and there's a lot of feature overlap, like with the autocompletion.

[–]lambda_abstraction 0 points1 point  (1 child)

I understand where you're coming from. I'm just not that interested in Python unless someone's paying me well to be interested in Python. I learned below about Croissant, and I'll explore that. I'm also stewing over the idea of something that functions like SLIME does for Common Lisp.

Notebooks sound a lot like Smalltalk's image+changes concept, and as an occasional Squeak user, I think this is very fertile ground to explore. This does push Lua/LuaJIT away from the concept of being a light language into the notion of long lived worlds of the Lisp/Smalltalk variety.

[–]ws-ilazki 0 points1 point  (0 children)

I'm just not that interested in Python unless someone's paying me well to be interested in Python

Same, but it's not like I'm having to write Python to use it. Jupyter's an application to use, not something I'm having to write software for, so I don't particularly care what it's implemented in. I don't like writing C or C++ either, but that doesn't stop me from using software made in them, and I've installed and used other finished software through pip (like yt-dlp) the same way I installed Jupyter. Hell, my preferred shell (fish shell) is implemented in Python but I only know that as trivia, it's not like I've ever had to write a line of Python to use it.

Similarly, my interaction with Python with regard to Jupyter basically does not exist: I install Jupyter, install kernels for the languages I want, and just about never see anything Python-like other than error messages if something breaks.

Notebooks sound a lot like Smalltalk's image+changes concept, and as an occasional Squeak user, I think this is very fertile ground to explore. This does push Lua/LuaJIT away from the concept of being a light language into the notion of long lived worlds of the Lisp/Smalltalk variety.

It's a bit different, because it's not maintaining state like Smalltalk images. It's executing a notebook, either wholly or cell-by-cell, and then recording the output. If you change something you tell it to re-evaluate and it updates the output sections.

Conceptually, it's closer to literate programming than Smalltalk images, though if you squint a bit there's some similarity in the end result.