While there are multiple components in this project, we're focusing on two: *OSH and Oil shell*.
- *OSH is the bridge between Bash and Oil.*
It aims to be the most Bash-compatible shell that you can run most Bash scripts just fine.
The point of this component is improving what's under the hood, imposing sensible defaults on them, and getting a wide reach since Bash is the most popular shell.
While it may not run every Bash script in existence, the other point is to require minimal rewrites to run it with OSH.
- *Oil shell is the modern replacement of Bash* from its syntax and behavior.
It aims to be the shell for people familiar to Python, Ruby, JavaScript, and the like.
This is the other side of the bridge that OSH aims to reach.
Most notably, Bash splits the string when trying to do something.
#+begin_src bash
d='echo 3'
e='echo "The quick brown fox jumps over the lazy dog."'
parallel -- $d $e
#+end_src
It should throw an error because =parallel= interprets it as if it has 4 arguments due to the splitting — i.e., ~parallel -- echo 3 echo "The quick brown fox jumps over the lazy dog."~.
The solution here is to quote the variables in evaluation (e.g., ~parallel -- "$d" "$e"~).
Compare that to Oil...
#+begin_src oil
var d = 'echo 3'
var e = 'echo "The quick brown fox jumps over the lazy dog."'
parallel -- $d $e
#+end_src
If you want splitting, you could use =split= Oil function — e.g., ~@split(array_var)~.
- There are different ways [[https://www.oilshell.org/release/latest/doc/syntactic-concepts.html][how Oil can create an expressive language with the shell]].
It can parse different sublanguages with different lexer modes.
But there are dominantly two modes to keep in mind: expression and command mode.
- Oil seems to evaluate in applicative order, evaluating only when the conditions passed — e.g., ~echo $['' + null if null else 'EEEEHHH']~ should print =EEEEHHH=.
+ Just like most modern mainstream languages... nice.
- Two operands of different types are considered unequal — e.g., ~'4' == 4~.
+ You can use Python-like type conversions like =Int=, =Bool=, and =Str= — e.g., ~Int('4') == 4~.