3 ms·
> Are there (m)any advantages to doing this? [trigger warning: cynicism distilled from 15+ years of bitter tears] More fun and better job security for the cur
by jlg23 10y ago
> Are there (m)any advantages to doing this?
[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.
- SwellJoe 10y agoRemind me never to hire you for anything ever. You've truly internalized the Tao of the BOFH.
- jlg23 10y agoThanks for the compliment. I'm usually hired for that attitude (and my ability to hide it except for the few meetings where it really counts) ;)
- qwertyuiop924 10y agoThat actually doesn't sound much like SCSH to me. SCSH was really just a library for posix integration, as well as some common shell idioms that came with it. And a damned good one, too. It was originally designed for situations in which you might write (notoriously unmaintainable) shell scripts, but it's so good that some of its APIs have become almost de-facto standard. In particular, SRE and the AWK macro really caught on.