Carrots - oilshell/oil GitHub Wiki

Related: Why Use Oil?

Why should anyone use OSH over bash?

  • Removed many bash warts (e.g. with arrays and arithmetic) while still maintaining high compatibility
    • Added options like set -o strict-array for even better behavior (for situations where you don't need bash compatibility)
  • Better parse time and runtime error messages. The infrastructure is there, but it needs more polish.
    • errors have column information!
    • -e / errexit failure isn't silent (TODO: show this in a post)
  • More accurate interactive completion (TODO: link to blog post: The Interactive Shell Needs a Principled Parser)
  • Better UI for interactive completion. (It's better than bash, but less fancy than zsh or fish.)
    • conserves vertical space
    • allows showing descriptions of flags (still TODO)
  • Simpler configuration: a single ~/.config/oil/oshrc file.
    • No rat's nest of startup files. Easier to put in a dotfiles repo.
  • Easier to debug
    • Shell crash dumps. Implemented with OSH_CRASH_DUMP_DIR but not documented / deployed.
    • --debug-file flag
      • TODO: Add debug or debug-file builtin for completion scripts. Or log DEBUG ?
    • repr builtin
  • Future: Lower latency with coprocesses. Prototyped, but not yet in OSH.

Devtools Ideas

  • In addition to crash dumps, potentially better tracing (set -x and $PS4).
  • Allow docstrings for functions ?
    • show in the autocompletion UI
    • generate HTML listings?
  • Lightweight testing in the same file or a -test.sh file (e.g. Rust has this built in)
  • any shell script could be a "go" script, i.e. with a good error message for an invalid action

Not implemented:

  • Portable .rc files? To solve the admin problem on remote servers.
  • Migration path to a better language: Oil!
    • Could write inline function calls and expressions, e.g. echo $f(x, y)

Oil Carrots

It's too early for this since it isn't implemented :-/ There are some potential benefits listed on Why Create a New Unix Shell?