A Tour of Hell – Shell scripting Haskell dialect
chrisdone.com
chrisdone.com
Internal DSLs for Shell - https://github.com/oils-for-unix/oils/wiki/Internal-DSLs-for...
and ones in many other languages like Scheme and Lisp
e.g.
https://github.com/jgoerzen/hsh/wiki
https://github.com/luke-clifton/shh/tree/master/shh
And also a page of alternative shells:
https://github.com/oils-for-unix/oils/wiki/Alternative-Shell...
It's quite verbose right now, and I don't see much networking API yet, but it's just starting. I could see it easily growing into something very nice.
They lean far too heavily on sub processes to do basic things.
I thought this was the whole point of a unix scripting language! Most of the scripts I'm writing are not interactive REPLs or string-parsers, they're glue code for batch-invoking commands on files. Stuff like converting a bunch of FLAC files into MP3 with lame or avi video files into mkv with ffmpeg.
What bash offers me is very terse command invocation and powerful filename globbing, including regexp substitution. Scripts like this are generally not intended to be used more than once or twice, and so a type system like Haskell provides is irrelevant here. If you're writing something that's going to be iterated on and maintained for years then you're writing an application, not a script.
https://github.com/kaldi-asr/kaldi/tree/master/egs
There are a bunch of shell, Perl and Python scripts there, with some awk in between. These scripts are often copied almost verbatim between models and this, believe me, can lead to all sorts of errors.
The running joke around working with these scripts was "all these .sh should be .hs," i.e., these scripts should be implemented in Haskell.
on that note: https://news.ycombinator.com/item?id=41489436
It's not a shell script without the Linux incantation stanza.. for reals. How are you going to get started without the proper boiler plate?
This seems to be a deep tour of the implementation as much as the language. So it's not supposed to be a first principles talk. That's fine. It's not all for everybody.
#!/usr/bin/env runhaskell
^ Works just fine. No need to reinvent what already exists and blog throwing shade on an inability to learn shell scripting.https://en.wikipedia.org/wiki/Scsh
And specifically https://en.wikipedia.org/wiki/Scsh#%22Acknowledgments%22