# Philosophy [Unix is my IDE – mkaz.blog](https://mkaz.blog/code/unix-is-my-ide/) # Unix shell programming: the next 50 years [src](https://sigops.org/s/conferences/hotos/2021/papers/hotos21-s06-greenberg.pdf) and [discussion](https://www.reddit.com/r/ProgrammingLanguages/comments/nfcij6/unix_shell_programming_the_next_50_years_hotos/) ## The good - Universal language for interoperability - Works with anything and is a medium between anything - Incredibly expressive (and often efficient) EDSL for stream processing - Interactive environment for interacting with the computer ## bad - insane specification that isn't implemented correctly in **any** shell, not even worth diving into - too arbitrary - it has infinite flexibility and that prevents it from doing anything - too dynamic - everything in a shell script is dependent on global state, which prevents any form of optimization or program change - performance cannot scale because it cannot be optimized ## Future Smoosh fully formalize and implement the posix shell, showing differences between specifications across semantics PaSH/POSH annotation languages as a high level specification interface for interactive programs, can be used as abstract models for command behaviors! This allows for better system specification that can actually be enforced (thinking of tools like Alloy here!) static reasoning previous bullets name annotation languages that give us information about the shell - why not dynamically rewrite and inspect every shell command? # Utilities [fuck](https://github.com/nvbn/thefuck) corrects your last console command. [Cool, but obscure unix tools · Kristof Kovacs ✈️](https://kkovacs.eu/cool-but-obscure-unix-tools/)aas a whole list of them. Worth poking around to see what might be useful - in the future! [werc - A sane web anti-framework](http://werc.cat-v.org/) [Why I Use Suckless Tools - Xe](https://xeiaso.net/blog/why-i-use-suckless-tools-2020-06-05) [GitHub - casey/just: 🤖 Just a command runner](https://github.com/casey/just) [GitHub - sharkdp/hexyl: A command-line hex viewer](https://github.com/sharkdp/hexyl) # Alternatives [Oil shell](https://github.com/oilshell/oil) is a new Unix shell alternative that can be compiled and deployed as a native executable. [Nushell](https://github.com/nushell/nushell) approaches the shell environment with structured data. # Configs [Be careful editing bash scripts](https://thomask.sdf.org/blog/2019/11/09/take-care-editing-bash-scripts.html): \`bash\` tracks the byte position in the file during execution and scans lines accordingly. This example shows a user editing a line that has dangerous consequences in the file - and even though some dangerous line is still commented out, the byte offset of everything in the file changes, so the dangerous piece of code is executed. Insane. It's okay to load your program into memory before running it - really.