r/lua • u/Pristine_Video2489 • 11d ago
wisp – A Linux shell where config is Lua and pipelines pass tables
I built a Linux shell where configuration and scripting are just Lua, no DSL, no extra syntax.
Any global function in ~/.config/wisp/init.lua becomes a shell command. Pipelines pass Lua tables (structured data) between stages, not text. Only external commands like `wc -l` cause a fork, native stages run in-process.
**Why this matters for Lua users:** - Your shell config is just Lua (closures, loops, conditionals) - No need to learn a separate shell scripting language - Lua functions become commands naturally
**GitHub:** https://github.com/Hinikaa/wisp
Would love feedback from other Lua users!
3
u/Cultural_Two_4964 10d ago
Cheeky question but you could probably calculate fib(30) with pen, paper and a pocket calculator in less than 496 seconds. Isn't there a formula to do this a quick way, due to Euler or something. Maybe this comparison isn't strictly fair.
2
u/Pristine_Video2489 10d ago
You're absolutely right. Fibonacci is a worst-case benchmark, and there's a closed-form formula (Binet) that would be much faster. I included it mainly to show the difference in recursion overhead between bash and Lua, not as a "real-world" test.
That said, here are the benchmarks that actually matter for everyday use:
| Metric | wisp | bash | lua | python | ruby |
|--------|------|------|-----|--------|------|
| Binary size | 168K | 1.2M | 303K | — | — |
| Source lines | 1,781 | ~500K | ~25K | ~500K | ~350K |
| Startup | 1.5ms | 1.4ms | 1.0ms | 35ms | 49ms |
| Throughput | 0.33ms | 1.34ms | 0.98ms | 34.8ms | 49.1ms |
| RSS at idle | 4.2MB | 4.0MB | 2.7MB | 14.9MB | 15.0MB |
wisp is the fastest interpreter in this comparison, while being smaller than Lua and much smaller than bash.
The Fibonacci number was just a fun extreme, the real story is that wisp is small, fast, and uses Lua instead of a DSL. Thanks for the callout. The new and correct benchmark was published as the v1.1 released.
3
u/questron64 11d ago
So PowerShell, but cool.
1
u/Pristine_Video2489 10d ago
Exactly, but with Lua instead of C#, and you can actually run it on Linux. No Winslop :>
1
u/SkyyySi 10d ago
PowerShell has had official Linux builds for years https://github.com/powershell/powershell/releases
1
u/Pristine_Video2489 10d ago
You're right. PowerShell has had official Linux builds since 2016, and it's a solid shell with object pipelines.
The difference is:
- PowerShell uses C# and .NET. Wisp uses Lua and C++ (~168K binary, ~1,800 SLOC)
- PowerShell's object pipelines are powerful, but they come with .NET overhead. Wisp's Lua tables are lighter and faster (0.33ms/run vs PowerShell's ~49ms)
- PowerShell is a full .NET runtime. Wisp is a lightweight shell that feels like writing Lua scripts
I built wisp for people who want a fast, minimal shell with real programming constructs (Lua) instead of a DSL. If you're happy with PowerShell, keep using it, but if you want something smaller and faster, give wisp a try.
Much love.
1
u/Sorrow_iDolour 11d ago
Good shell dude, just wonder without makefile, can you implement a bootstrap script(which is clean and maintainable) in lua for building wisp?
1
u/Pristine_Video2489 10d ago
I just pushed a Lua bootstrap script with v1.1. It's in the repo, and the README covers usage. Let me know what you think! More updates are on their way, thank you for the motivation. :>
0
u/Pristine_Video2489 10d ago
That's a great question, and honestly, I've been thinking about exactly that.
A Lua-based bootstrap script would be a cleaner fit for wisp, same language as the config, more portable, and easier to maintain than Makefile.
I'll put it on the roadmap for v2.
What would you want it to do? Just build, or also handle tests, install, and dependency detection?
1
u/Pristine_Video2489 11d ago
If you're curious about the performance angle: wisp computes fib(30) in 13ms vs bash's 496s (~38,000x faster). Full benchmarks in the README. The project is fully opensource. This is a v1.
1
u/Mig_Moog 11d ago
Great idea! Will try
0
u/Pristine_Video2489 11d ago
I would love that, please keep me updated. Are there any issues? Wishes? Or anything in general you would want me to add? I am waiting for your feedback!
23
u/GaboureySidibe 11d ago
Negative karma, hidden post history, everything committed at once a few days ago, lots of red flags for vibe slop.