I've recently started porting some bash scripts over to Racket, using https://docs.racket-lang.org/shell-pipeline and it's been pretty straightforward and painless so far!
Are there (m)any advantages to doing this? I've seen a number of shell-interop modules for various languages but they all appear to add an extra layer that reduces portability or ease of maintenance.
[trigger warning: cynicism distilled from 15+ years of bitter tears]
More fun and better job security for the current maintainer. The former because one hacks away in the preferred language, the latter because one cannot be replaced easily by some unix geek unless s/he happens to speak the same language fluently.
One can chose from various implementations in various languages (eg: psh and scsh) but hacking your own is easy:
* Just re-implement the basic unix tools and shell semantics and invent some nifty convenience syntax and features along the way.
* Either don't document at all or document everything with at least 2 pages aimed at people who have never used a computer before. Both ways will prevent the only ones who could replace you from even looking at your "shell in X".
* Never ever do this in a typed language, write a ton of unit-, functional- and integration tests to make up for that - of course all of them completely undocumented.
* On top of your creation, invent a fragile "shell syntax like" layer to make adoption easier.
* Under no circumstances create some new abstraction layer that goes beyond shell semantics that brings something substantial to the table and is well documented.
* Enjoy the time saved because you don't have to "man $tool" anymore, it's all your code anway.
* Under no circumstances ever write in pure posix sh again - the realization that with all the stuff you've learned along the way posix sh covers 99% of the use-cases in a more expressive way will be crushing.