Live data from Hacker News

Hush, a modern shell scripting language

hush-shell.github.io

41–50 of 192 posts

Re: Hush, a modern shell scripting language

#41
This seems worth a try; some interesting design choices here!

Definitely put the shell scripting examples up front if you want to call it a shell scripting language. I had to click through ten pages before finding out how to execute a command.

I wonder how usable it would be as an interactive shell with some conveniences. For example, the prompt could pre-type a "{ }" for you and put the cursor between them, so you can immediately enter commands, or decide to backspace over the "{" if you want to write more complex expressions.

Re: Hush, a modern shell scripting language

#42

I've changed my mind about this sort of thing recently. I disagree with the widespread belief that one should part with shell scripts as soon as possible. Yeah, there are definitely eventually scripts where one should rewrite the work in another language, but we now just have too many people who have no idea what getopts is, too many people who think bash is available everywhere, too many people who think it's a good…

The reality is that blame shaming devs for not learning something isn't effective. No matter your personal beliefs, nobody is getting fired for not knowing the intricacies of sed or bash or awk. The only options are keeping archaic artifacts around and have the elders maintain it, or improve it for everyone. I have tremendous respect for our unix/posix legacy but at the same time they didn't get everything right. How could they?

That said, it's harder to build consensus today. Currently people are replacing shell scripts with all kinds of stuff, and that's not good either. We need something good enough and ubiquitous, imo.

Re: Hush, a modern shell scripting language

#43
post #15

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.

This isn't really true at all. We have an ungodly amount of operational process and knowledge tied up in bash scripts deployed across our fleet, but we could easily deploy a different shell, and use that. We don't use bash because it's the least common denominator on our systems --- in fact, I think in an era of AMIs and Dockerfiles, few people do. We use it because of path dependance.

This is easy to say when you don't have to comply to some industry standards.

Re: Hush, a modern shell scripting language

#45
This looks really cool! I think I found a few errors in the docs:

1. On https://hush-shell.github.io/intro/basic-constructs.html you say that `let x = array[5]` should panic, but the array has enough items. Perhaps you wrote that, then added more items to the array and forgot to change it?

2. On https://hush-shell.github.io/error-handling.html you sometimes have safe_div_mod and sometimes safe_division.

Re: Hush, a modern shell scripting language

#46

This looks really cool! I think I found a few errors in the docs: 1. On https://hush-shell.github.io/intro/basic-constructs.html you say that `let x = array[5]` should panic, but the array has enough items. Perhaps you wrote that, then added more items to the array and forgot to change it? 2. On https://hush-shell.github.io/error-handling.html you sometimes have safe_div_mod and sometimes safe_division.

I've already opened a pull request for the latter https://github.com/hush-shell/hush-shell.github.io/pull/1

Re: Hush, a modern shell scripting language

#47
post #27

Note to author: the part with actual shell examples is buried too deep, I didn't think it was capable of actual shell things (seemed more like a scripting language) until I came across the 'Shell Capabilities' chapter. Seems like an obvious title but I completely glossed over it while perusing until I did a keyword search for 'redirection', and I imagine many people will too. Consider putting everything on a single p…

I agree. As a language which intends to replace shell scripts, I would show first that the syntax is pretty much the same in Hush. I would put this page first https://hush-shell.github.io/cmd/index.html

Re: Hush, a modern shell scripting language

#48

This looks really cool! I think I found a few errors in the docs: 1. On https://hush-shell.github.io/intro/basic-constructs.html you say that `let x = array[5]` should panic, but the array has enough items. Perhaps you wrote that, then added more items to the array and forgot to change it? 2. On https://hush-shell.github.io/error-handling.html you sometimes have safe_div_mod and sometimes safe_division.

Wouldn't the value of the fifth index be executed there, which is false and would hence fail?

Not sure either though

> safe_div_mod and sometimes safe_division

Aren't those different things? Save division wouldn't use mod by default, right? The function for save division is missing though, but it might just be a built-in

Re: Hush, a modern shell scripting language

#49
post #15

Earlier quoted context omitted.

This isn't really true at all. We have an ungodly amount of operational process and knowledge tied up in bash scripts deployed across our fleet, but we could easily deploy a different shell, and use that. We don't use bash because it's the least common denominator on our systems --- in fact, I think in an era of AMIs and Dockerfiles, few people do. We use it because of path dependance.

This is easy to say when you don't have to comply to some industry standards.

I don't know what this is supposed to mean.

Re: Hush, a modern shell scripting language

#50
I'll make the mandatory hn comment since I have not seen it yet. A website introducing a new language should show said language on the first page. It's like introducing a car by saying

- safe - can ride on 4 wheels - 2 car seats included - highway compatible

And then keep pictures for page 6.

Post reply on HN