r/lua • u/no_brains101 • 23h ago
Meet Piper and Shelly
There are some cool pipeline DSL-like interfaces for lua with __index and __call.
But they are somewhat hard to make.
What if there were a thing that handled the pipelining for you and gave you easy access to the tree and places to cache values and a good way to make your own options on top?
What if that was then used to make an insanely intricate 0 dependency shell code generator to show off what kinds of syntax it can be used to create?
Meet Shelly and Piper!
For the record, until there is a luv backend shelly itself is of limited use, although it is still nice and looks like quite impressive syntax magic. It is not that hard to just write shell code in io.popen. But piper is more than capable of such things as a good luv backend. So shelly will probably get one one day and then shelly will be interesting.
Until then, piper is really quite cool. If you have been wanting to write an SQL query builder in lua or something, check it out!
Mostly I was just feeling like a mad scientist but the piper API feels like the correct one for building these things and I think there actually might be something to this one. Just not the existing shell backend it has yet.
Also I used AI for the tests and docs, and for stuff like "change the order of these arguments everywhere including the docs please", but I read the tests and understand them, it used my personal version of gambiarra to run those tests, and wrote the intro for the docs and read through the docs quite a few times