|
newLISP is a language to replace sh/bash/perl. I don't know of any other s-expression language targeting that space? The thing is, if you look at what people on various programming language channels mock, bash et al should be the target of widespread derision. It does everything "wrong" and is an absolute mess. Yet all of these languages do a really good job of being super simple to use when you quickly need to automate something, even if the result is an unreadable, unmaintainable mess. It's ease of writing that is being optimized for, not reading/maintenance. But a big chunk of the code I actually write is in the category of write-once, use-once, never-read. (Reorganizing data on disk, doing a one-time data cleanup or reduction, renaming deeply nested files matching certain patterns, tabulating data, etc.) newLISP, as far as I can tell, is an attempt to apply s-expressions to the same niche, and it makes the same sort of ugly, aesthetically horrifying compromises that shell languages (+ perl) do. But the only questions of import, I think, is: does it work? Is it quick to use? Is it simple, and not mentally taxing to automate something in newLISP? If so, I'd much rather code in newLISP than write another hideous bash loop. |
I think of shells as being optimised for/excellent at:
- Invoking subprocesses (managing buffers, propagating signals, handling exit codes, etc.)
- Standard input/output redirection (pipes, file reading/writing, etc.)
- Command line interaction
- Being installed by default (on Unix-like systems, anyway)
They also have some nifty string handling, but as you say it's quite messy compared to other languages. Some other languages have reasonable commandlines and are usually available by default (e.g. Python), but the majority of languages are awful at the first two points (e.g. I wrote an example at https://news.ycombinator.com/item?id=17733865 ). This is why there are many libraries which try to improve the situation, like 'sh.py' and 'plumbum' for Python, 'Shelly' and 'Turtle' for Haskell, Scala's 'process' package, 'shell-pipeline' for Racket, etc.
> I don't know of any other s-expression language targeting that space?
Others have mentioned some. I really like scsh (Scheme shell), there was a nice paper about it posted to HN recently ( https://news.ycombinator.com/item?id=17886714 ). The shell-pipeline package mentioned above is really nice, and usable from Racket (a variant of Scheme, which uses s-expressions by default).