14 comments

[ 3.0 ms ] story [ 50.2 ms ] thread
Colour me impressed. I thought you needed fancy (relatively) modern stuff like Ruby for decent in-language DSLs, but clearly Bash can do the trick, too.

I wonder how decent a programming language you could turn bash into using tricks like these.

Ha ha! Brilliant. An incredibly suitable domain name for such and insane monster!
Doesn't look like you can do polymorphism with it, which would be the real utility of this. Objects are globally named, etc.

But looks fun!

Why can't you do polymorphism? It looks like he just needs to add vtables to make that work.
does anybody know if it works for zsh also ?
(comment deleted)
There's insanity, and then there's this...
This is bad a joke - not only the classes and methods but the individual instances have statically generated names. That means in the examples, for the statically generated "one", "two" and "three" there's no way to assign them to another variable, or pass them as arguments to a function.