Live data from Hacker News

Amber: Programming language compiled to Bash

amber-lang.com

21–30 of 330 posts

Re: Amber: Programming language compiled to Bash

#21
post #13

I don't love the $...$ syntax for executing commands. Using $ as a string delimiter is very strange to my bash-accustomed eyes. It's a shame that they provided such weird syntax for the most important thing you tend to do in a bash script, while providing fairly nice syntax for everything else.

and i dont like how it's inconsistent that echo is not using the $ syntax (which makes sense internally, as it's a built-in, rather than executing the $echo command). Overall, it is cute and neat, but i find that if you are looking to write bash scripts that require this level of programming, you'd be better off writing it in python, or perl. Only in very austere environments can this be utilized, but the requirement…

> the requirement of having `bc` installed means you must also have the ability to run package installation

I don't remember ever installing bc, but I use it frequently and it's always there. Are you sure it's not already part of most base systems?

Re: Amber: Programming language compiled to Bash

#22
post #13

Earlier quoted context omitted.

and i dont like how it's inconsistent that echo is not using the $ syntax (which makes sense internally, as it's a built-in, rather than executing the $echo command). Overall, it is cute and neat, but i find that if you are looking to write bash scripts that require this level of programming, you'd be better off writing it in python, or perl. Only in very austere environments can this be utilized, but the requirement…

> the requirement of having `bc` installed means you must also have the ability to run package installation I don't remember ever installing bc, but I use it frequently and it's always there. Are you sure it's not already part of most base systems?

No, it's often not, it's one of the common package you install manually to compile a linux kernel

Re: Amber: Programming language compiled to Bash

#24
post #13

I don't love the $...$ syntax for executing commands. Using $ as a string delimiter is very strange to my bash-accustomed eyes. It's a shame that they provided such weird syntax for the most important thing you tend to do in a bash script, while providing fairly nice syntax for everything else.

and i dont like how it's inconsistent that echo is not using the $ syntax (which makes sense internally, as it's a built-in, rather than executing the $echo command). Overall, it is cute and neat, but i find that if you are looking to write bash scripts that require this level of programming, you'd be better off writing it in python, or perl. Only in very austere environments can this be utilized, but the requirement…

Shelling out to awk would be a more portable choice than bc, though awk would bring you much closer to the featureset of Amber to begin with.

Re: Amber: Programming language compiled to Bash

#26
Assuming that these are typical outputs from Amber:

https://github.com/Ph0enixKM/Amber/blob/master/setup/install...

https://github.com/Ph0enixKM/Amber/blob/master/setup/uninsta...

The inconsistent indents and decorated variable names made them less readable than hand-written Bash scripts. I understand that most compiler outputs are not meant to be human readable, but generally we would get minification and/or obfuscation in exchange for losing readability, and Amber doesn't seem to offer those yet.

Re: Amber: Programming language compiled to Bash

#28

Quick note to the creators: the website looks almost exactly like every other "here try this cool command-line utility so we can hook you and start charging a service fee for it" startup website and I instantly distrusted it. The design communicates that you're selling a product , not providing an open-source utility. That said, very interesting syntax. I agree with others about the $...$ being kind of odd, but other…

I had the same exact reaction. Being an open source project doesn't mean the website has to be ugly or bare bones (though plenty are). But this is sending the wrong expectations about the project.

Re: Amber: Programming language compiled to Bash

#29

Impressive project. But I always feel that if you reach a certain complexity in your bash scripts, you should rather pivot to any other $lang. Bash scripts should be simple glue between programs (unix-principle).

I think the use case for this is where you need a bash script on a machine where you can't easily install and maintain a runtime.
Post reply on HN