Hacker News new | ask | show | jobs
by LectronPusher 755 days ago
I haven't seen a mention of the Oil Shell (https://oilshell.org) project's OSH/YSH yet and I'm quite surprised.

Oils goal is that OSH is just a new Bash implementation (although not bug-for-bug) but with an upgrade-path to the more modern YSH for real programming with type safety etc, but still as a shell language. One of their exciting ideas is using code as data in a somewhat lisp-like manner to allow function introspection in YSH etc.

Based on other comments it seems like Oil Shell is much more principled in working to actually understand Bash as it exists and presenting an alternative language. I would be interested in what differentiates Amber and whether they have a response to Oils?

3 comments

Oil shell requires osh to run. That means that you can't run Oil scripts on systems that only have Bash installed.
Osh is stricter than bash. Anything written to osh should run in bash with no issues whatsoever.

Ysh implements new, non-compatible syntax and semantics.

Osh and ysh are two different shell languages from the Oils for UNIX project. The release build generates a single binary, oils-for-unix, and installation creates two symlinks for the two different shell personalities, similar to how the bash binary will behave in its POSIX-compliant mode when it is invoked as sh.

There is no "Oil shell" now, at least not without ambiguity.

It's an entirely different problem; the problem being solved here is not "use a better shell than bash". It's targeting bash as a universal runtime because it's (kinda sorta) ubiquitous.
What’s the use case for that though? Nobody writes shell because they want a shell language. It’s written purely out of necessity because that’s the lowest common denominator installed on all systems. Something that Amber here provides a potential exit path out of.

Oil would have to reach a really critical mass before it can compete, which is sort of a catch 22 situation.

oil's idea is that you do want a shell language (e.g. if a lot of what your code is doing is job control and manipulating unix pipelines I can see shell being the best language to express that neatly in). you just want a better shell language than bash. but there is a ton of existing investment in bash itself and things like nushell their that away to start from scratch, and oil says what if we build a better bash instead.