[ysh] (1/3) Reviewing YSH

https://www.oilshell.org/blog/2023/06/ysh-review.html

YSH, or the shell formally known as oil, is touted as a possible upgrade path from Bash.

This is the first in a three-part series of posts re-introducing the language.

  1. Reviewing YSH (you are here)
  2. Sketches of YSH Features
  3. YSH, Narrow Waists, and Perlis-Thompson Problems (Not yet released)
5 points · 7 comments · view on lemmy.world

7 Comments

gamma@programming.dev · 1 pts · 3y (2 replies)

I need to disclaim that I am not affiliated with the project, and have actually been pretty critical of it in the past. But I tend to agree with the author's reasoning across most of the blog, so I believe there is real merit to the shell.

Who knows, maybe in a few years we'll all be writing YSH!

howarddo@programming.dev · 1 pts · 3y (1 reply)

At what is this better than zsh, bash or fish? What make u switch to ysh?

gamma@programming.dev · 2 pts · 3y

I haven't switched to ysh. I personally use Zsh for my interactive shell, but I write my scripts in a variety of shells.

You can start with Ysh in its Bash-compatible mode, individually enable new features with shopt. Those features include:

  • Not splitting or globbing $foo by default (this is shared by Zsh and Fish)
  • A Python-inpsired parsing mode, which should supersede arithmetic mode (induced by ( ) in tests, $[ ] for string splicing and @[ ] for array splicing)
  • Strucutred data
  • New functions which return structured data (Oil calls classic shell functions "procs", because they behave a lot like external programs with extra side effects)
  • cd to/somewhere { echo $PWD;}
sweet@beehaw.org · 1 pts · 3y

I'm interested in it. It claims to be quite a bit faster but I'm curious as to how practical it is.