Live data from Hacker News

Hush, a modern shell scripting language

hush-shell.github.io

1–10 of 192 posts

Re: Hush, a modern shell scripting language

#4
Is this really a shell scriping language? Hush isn't an interactive shell, nor does it compile to a common shell script. The only way to run these scripts is to install the hush interpreter and run the script through it.

Isn't that just a normal scripting language? What's the real benefit of using this over Node or Python? I suppose the syntax is more aesthetically similar to shell scripts... but I don't exactly see that as a plus.

Re: Hush, a modern shell scripting language

#5
post #3

Interesting language/script. Are there any other comparable alternatives? Would Node/TS-Node be a suitable replacement with a few shell helper functions?

A recent one is Zuo, a tiny Racket for scripting/makefiles: https://docs.racket-lang.org/zuo/index.html

Re: Hush, a modern shell scripting language

#6
This looks nice. I'm slightly surprised by the error handling though:

  if std.type() == "error" then
It seems (a) a bit verbose and (b) a bit hacky to compare the type against the string "error". I wonder if more ergonomic error handling is something the author is planning.

Re: Hush, a modern shell scripting language

#8
post #4

Is this really a shell scriping language? Hush isn't an interactive shell, nor does it compile to a common shell script. The only way to run these scripts is to install the hush interpreter and run the script through it. Isn't that just a normal scripting language? What's the real benefit of using this over Node or Python? I suppose the syntax is more aesthetically similar to shell scripts... but I don't exactly see…

The point is that you can do things like create external processes, pipe them together, redirect output to files, with the same ultra-lightweight syntax of bash etc. Compare that to all the nonsense you have to do in Node or Python to pipe two processes together!

Re: Hush, a modern shell scripting language

#9
Really cool concept. I like the idea of scripting in a "safe" language and then dropping into a command block to do all the system level stuff. It's the best of bash and python, in a way.

I'm not sure when I would use something like this. The verbosity definitely means I wouldn't use it as my actual shell, and I don't think that is the intention. Maybe something like a big service / orchestration script where I need to do all sorts of file manipulation, command processing, etc but there's enough logic and complexity to make it annoying to do in bash.

Re: Hush, a modern shell scripting language

#10
The unfortunate truth of all such projects: if it isn't pre-installed on all reasonably complete Linux distos, it can truly succeed, no matter how awesome and cool it is...

... which is why I try to write as much stuff as POSIX sh as possible, and sometimes I have to throw in a Bashism to get by.

And I say this as someone that wishes sh was better, semi-lovingly.

Post reply on HN