๐Ÿ“š node [[posix]]

Philosophy

Unix is my IDE โ€“ mkaz.blog

Unix shell programming: the next 50 years

src and discussion

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 corrects your last console command. Cool, but obscure unix tools ยท Kristof Kovacs โœˆ๏ธaas a whole list of them. Worth poking around to see what might be useful - in the future! werc - A sane web anti-framework Why I Use Suckless Tools - Xe GitHub - casey/just: ๐Ÿค– Just a command runner GitHub - sharkdp/hexyl: A command-line hex viewer

Alternatives

Oil shell is a new Unix shell alternative that can be compiled and deployed as a native executable. Nushell approaches the shell environment with structured data.

Configs

Be careful editing bash scripts: `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.

๐Ÿ“– stoas
โฅฑ context