I think a shell is where running programs is the default, and writing code is secondary. In shok, the code is a DSL for filesystem and job management. I think that's quite a different type of thing than general-purpose scripting languages like Ruby.
My typing barrier for %x(ls) is too high.
but Ruby is perfectly suited to writing a DSL. There's a large and growing number of system administration tools that use Ruby to do exactly that.
You could totally make Ruby turn ": ls" into "%w(ls)", or whatever other symbol.
This just seems a lot more work for the same thing.
Sure, but go the extra step: Drop the mandatory :, make just "ls" run ls. Then you need a syntax to get at the programming language, not the other way around. That's all that's happening here.
shok could have put ruby or python or some other language behind its {} syntax. That would be less NIH-syndrome, but maybe there's merit to trying something more ambitious. Or maybe not.
How about support shebang style block?
{#!python
do dome python...
}I've never seen %x() but good to know. I prefer backticks though.
%x() works for me because it gives me an obvious context clue about what I'm doing. After a long day in front of the computer I tend to slip up spotting the difference between ' and `.
Also, I'll just leave this here: http://devopsanywhere.blogspot.com/2011/09/how-ruby-is-beati...
I find myself using %x() while in irb all the time.