idf | 3 years ago | on: Idio by Example
idf's comments
idf | 3 years ago | on: Idio by Example
It's from the Greek 'idios' meaning own, private. From that the etymology suggests ignorance and from that low intelligence giving us the modern derivation of idiot (and any attendant socio-cultural associations).
Here I'm using it in the sense of doing my own thing where I'm not feeling particularly bound by how other shells work.
YMMV
idf | 3 years ago | on: Idio by Example
Yes, regular job control is available interactively.
Note that I'm interested in making scripting work better so I've made little to no attempt to ease interactive use (there are plenty of better alternatives for interactive shells).
I tend to use "rlwrap idio" to make editing easier.
idf | 3 years ago | on: Idio by Example
Note to self: don't hold yourself hostage to Betteridge's law!
I wouldn't disagree but it's quite a jump from where we are today to an execvj(path, json) and whatever form retrieving/reconstructing the structured data would take.
I'm starting from an easier position. Change things a little bit. :)
idf | 4 years ago | on: Show HN: Idio, a Programmable Shell
I got fed up of my SysAdmin "solutions", which always started life in the shell, running commands, being forced into Perl/Python because I needed to use an even slightly complex data structure or interface with some library or data format and then be stuck with some less elegant means of orchestrating commands.
So I've implemented Idio, a programming language (think: Scheme-ish) which adds a couple of tricks:
1. user-defined infix operators for the reader to re-arrange the incoming form: | is an obvious candidate for a shell, arithmetic operators for a programming language
2. unbound variables evaluate to themselves, symbols, and if you try to invoke a symbol then we break out of programming language mode and hunt down the PATH for such a named command
It works tolerably well. Not all shell syntax can be carried over and you can't be both a programming language and a shell all the time so, on a few occasions the programming language wins out.
I'm not interesting in interactive sessions (though Idio should work -- I use rlwrap for comfort), there are many far better interactive shells. Idio is for scripting.
I also don't like ignoring errors so Idio will (overly) enthusiastically quit if external commands fail -- there are mitigations. Interactive sessions are more lenient by default.
It's also new and will (overly) enthusiastically quit of its own accord if you type something I haven't anticipated. Please take that into consideration.
New also means it's missing lots of things that might be obvious but I haven't needed yet.
Let me know what you think.
There's a lot of Scheme-ish things available: setters, templates (aka macros but with changeable quoting: ` ' @), continuations.
I've added a few more tricks: computed variables (like SECONDS or RANDOM which dynamically get/set a value) and reader operators (which are the heart of infix "functions" and get to rewrite source code expressions, | being the obvious one for a shell).
All available to the user -- nobody wants to be writing stuff in C! :)