(no title)
willghatch | 7 years ago
[1] https://hal.archives-ouvertes.fr/hal-01890044 [2] http://www.cs.pomona.edu/~michael/
But my personal takeaway from this sort of research is that the posix shell is a truly insane language beyond even its readily apparent shortcomings. It's worthwhile to figure out the exact semantics of a language with so much existing code and have a precise interpreter for it, but frankly I think the more important task is to move away from such terrible languages. Bourne-derived shells have some great ideas, but these could be formalized into more sensible languages. In particular, I think the best direction is to embed shell languages inside good general-purpose languages. I'm biased to that end since I've written a shell embedded in Racket. But there is no shortage of better shell languages that benefit from better language design, such as Powershell and Elvish.
chubot|7 years ago
The way I think of it is that I can't tell my (former) coworkers or my sister to learn to program shell in 2018 "with a straight face". More than 50% of them had Ph.D.'s in some other field like statistics, math, biology, or physics -- i.e. the kind of person who has no problem with Python. But they would struggle with shell or make.
They're the kind of people Mike Bostock (author of d3) wrote this post about Make for [1]. He's absolutely right that they should use Make, because like shell it's a great tool to combine different programs that weren't designed to be combined.
But I feel like this is basically a losing battle -- I don't see that shell or make is an exciting thing for most people to learn, even though it would make them more productive and increase the quality of their work. I think that a language free of legacy would go a long way.
I guess I can see POSIX sh being used when confined to the lower level of an OS, by specialists. But I think it has a lot more potential than that. I'd say it's more important now than 10 years ago, because there's so much more software out there and systems are increasingly built of large heterogeneous parts.
----
FWIW I mentioned Morbig here [2], along with several other shell parsers, like ShellCheck in Haskell and shfmt in Go.
[1] https://bost.ocks.org/mike/make/
[2] https://github.com/oilshell/oil/wiki/ExternalResources
Sir_Cmpwn|7 years ago