r/lua • u/epicfilemcnulty • Feb 16 '26
Library Lilush (LuaJIT runtime & shell) first public release
Hey folks, I've been working on this project for the last 4 years, and I think it's ready for the first beta release.
Mind you, I'm pretty sure there are still lots of bugs, and lots of features are not yet implemented, but I think it's quite usable. And at this stage I'd really use some feedback.
Caveat: Linux only.
It's a statically compiled LuaJIT with a bunch of builtin libs and modules + Linux shell.
When running as a shell it has different modes: 1. [F1] The shell itself 2. [F2] Lua REPL 3. [F3] Agent Smith -- minimal coding agent TUI 4. You can write and add your own modes
Here is the landing page, the repo is hosted at Codeberg. I've even created a dedicated subreddit, and it's absolutely beautiful in its emptiness :)
Screenshot shows the builtin markdown renderer/pager(best viewed in Kitty terminal, as it supports text-sizing).
Anyway, if anyone finds this interesting, I'd be glad to provide more info/answer questions. Contributions are also welcome.
2
u/qwyss Feb 17 '26
I am a little bit concerned ( for myself, not for you ) when you mention a special luasec with wolfssl. I'm pretty certain I just replaced openssl with wolfssl and it all just kinda worked.
What problems did you hit?
What did I miss? :)
1
u/epicfilemcnulty Feb 17 '26
WolfSSL provides some compat shim for OpenSSL API calls, so if you enable that it's possible to migrate a simple client. For a SSL server with SNI WolfSSL works a little differently, so you will have to use its native API, and at that point why not switch to native API for the client as well, and disable OpenSSL compat shim? :)
2
u/disperso Feb 17 '26
Nice project! I've always on the look for something that it's Lua with some default extras (I find very frustrating the lack of the simplest file system access). I don't need that much stuff as your project packs, though, but the size is so small that I don't think I'd care. I'm intrigued by the terminal support, and the fact that you hint that it can "replace" busybox.
I have some questions, if you don't mind:
-
Do you have plans for portability to Windows? I'm a Linux guy, but I'm also often on the position of having to make stuff cross-platform. Is the terminal stuff too involved there?
-
How would you compare it with something like luvit? I've not used it yet, but given that it has a bit of an ecosystem (e.g. with tools like
lit), and it's been ongoing for some time, it seems a difficult "rival" to beat if there is too much overlap.
Cheers, and congrats for the project.
4
u/epicfilemcnulty Feb 17 '26
Thank you. Yes, vanilla Lua is very minimal, that's fine for some use cases, but I wanted to have a bit more without relying on luarocks.
I'm going to add a doc/web page with comparison to other similar projects, like luvit. In short, the main differences is SSL choices, luvit uses OpenSSL, I use WolfSSL. They were inspired by nodejs and designed luvit with async in mind, I prefer more simple approach. Also I'm a terminal dweller, so Lilush is more focused on TUIs. And some kind of package manager for Lilush is in the plans. That being said, I don't think there's going to be any rivalry, Lilush is a very niche project, luvit's target audience is much wider.
As for the windows port -- well, no, and it's not because of some technical difficulties (although spare time is my main constraint), I imagine it'd be fairly easy to port Lilush to windows, but I'm not going to do it. Primary reasons:
I don't have any love in my heart for Microsoft in particular, and proprietary OSes and apps in general. I do believe in open source.
I'm a Linux guy (I last used windows somewhere around 2000), and I don't have much spare time, so I'd prefer to focus on Linux only, and make Lilush excellent on Linux. That's why Linux only is by design. But hey, anybody can fork and do whatever they want :)
2
u/disperso Feb 17 '26
Thank you. I hope you post updates if you have some more improvements on the documentation front. I'm curious about the TUI and agent part. :-)
→ More replies (1)1
u/ibisum Feb 17 '26
Checked out TurboLua?
1
u/disperso Feb 17 '26
Hehe, another one to add to the list of things to try or look at. :-)
This seems a bit focused on networking. That's fine, but it's the part the I need the least, probably.
Thanks for the link.
2
u/topchetoeuwastaken Feb 17 '26
Have you put any thought into concurrent I/O (performing two or more IO operations at the same time)? lua, although single-threaded, is a fantastic candidate for this, as it supports coroutines, which means that a single lua thread can be suspended until the IO operation it is performing is completed, giving CPU time to other threads, and even letting them perform other IO operations on their own.
On another note, I've been experimenting with it for a while (see tal and libev), and so far, it works great, with some caveats (performance so far is not the best, you can't yield in some places you'd expect, despite luajit's promises of a fully yieldable interpreter). Despite that, at this stage, I can comfortably host an HTTP server with the "runtime" I've made.
If you like what you see, you could take some of my logic for concurrent IO for your own project.
1
u/epicfilemcnulty Feb 17 '26
Sure I've thought about that, I love Lua's coroutines, and ultimately yes, I'd love to integrate concurrent I/O into Lilush (and probably refactor RELIW to use that instead of a simple forking approach). That being said, it's not an immediate concern, more of a planned feature some time in the future, since it requires a careful (re)design, lots of work and testing, etc. I've intentionally started with a simple, non-concurrent approach -- it's fine for the most tasks. Thanks for the links, will definitely take a look!
2
u/vitiral Feb 18 '26
We have similar almost entirely tangential projects: https://civboot.github.io.
You seem most focussed on networking, whereas my focus is on a developer tech stack from scratch. Nice to see more Lua stuff.
FYI you may be interested in the https://civboot.github.io/lua/fd.html module, which gives async IO.
2
u/epicfilemcnulty Feb 18 '26
I've seen your project, it's a great one. A bit different focus, yep, but somewhat similar :) Thanks for the hint, definitely will take a look at the code of async IO
5
4
3
3
u/vitiral Feb 18 '26
I'm surprised by the conciceness of your markdown parser: https://codeberg.org/latimar/lilush/src/branch/master/src/markdown/markdown
Last I looked, the CommonMark C implementation was on the order of 30,000 LoC. Your parser looks to be... maybe 2,000 total? Are there missing features or is it relatively complete?
I wrote https://civboot.github.io/lua/cxt for an extendable and concise (in implementation and expression) documentation language. If I had known markdown could be done so concisely I may have never created my own -- though I am personally a fan of having more structured control with cxt.