Live data from Hacker News

Amber: Programming language compiled to Bash

amber-lang.com

41–50 of 330 posts

Re: Amber: Programming language compiled to Bash

#42
post #39

I guess I don't understand the point. Could someone summarize why I would use this rather than writing my utilities in something that doesn't compile to a quirky, limited programming language?

Because the runtime for those utilities is available on just about every Linuxy OS there is. Saves you having to install the runtime separately, eg in your CI pipeline.

It's not much of a "runtime", though. How is it better than a plain executable?

Re: Amber: Programming language compiled to Bash

#43
What I really want for scripting usecases is a language that has modern language concepts (easy to use arrays and maps, text formatting strings, etc) but that allows me to call commands as easily as I could call functions.

Maybe there are existing scripting langs that make this so? Ambers approach is not bad but I feel it could be even better.

Re: Amber: Programming language compiled to Bash

#44
It seems to generate very bad/odd shell so I won't use it.

I also question the mindset that conflates programming with using a program. It seems until some philosopher explains the difference programming can't move forward.

Aside from that shell is the way many (most?) people interact with their computer, so some may find it offensive.

Re: Amber: Programming language compiled to Bash

#45
post #44

It seems to generate very bad/odd shell so I won't use it. I also question the mindset that conflates programming with using a program. It seems until some philosopher explains the difference programming can't move forward. Aside from that shell is the way many (most?) people interact with their computer, so some may find it offensive.

[deleted]

Re: Amber: Programming language compiled to Bash

#46

To my eye, this does not look good. I consider myself to be quite proficient in bash. I write a lot of bash professionally. I've written a compiler (transpiler?) for a strongly typed configuration language that outputs bash. There are three main problems I see here. (1) Pipelines, subshells, and external dependencies. The example on the website compiles a conditional `if age if [ $(echo ${__0_age} ' Pipelines and sub…

Yeah, I stopped reading at that conversion. If it cannot handle a single "<" imagine more complicated logic, it would make debugging it a true nightmare.

Re: Amber: Programming language compiled to Bash

#47

What I really want for scripting usecases is a language that has modern language concepts (easy to use arrays and maps, text formatting strings, etc) but that allows me to call commands as easily as I could call functions. Maybe there are existing scripting langs that make this so? Ambers approach is not bad but I feel it could be even better.

try ruby. there are several ways to call commands but the simplest is simply the command string in backticks

Re: Amber: Programming language compiled to Bash

#49

What I really want for scripting usecases is a language that has modern language concepts (easy to use arrays and maps, text formatting strings, etc) but that allows me to call commands as easily as I could call functions. Maybe there are existing scripting langs that make this so? Ambers approach is not bad but I feel it could be even better.

Xonsh maybe?

The syntax is something like this:

  text=@(ls -lh).replace('a','b').split('b')

Re: Amber: Programming language compiled to Bash

#50
I was hoping for a solid way to handle subprocesses, and especially how to handle failures. They have something in the docs, but it seems a bit underwhelming, in terms of how status codes and failures are handled. It’s probably better than straight bash, but I feel like there’s more to be done here.

Also: I don’t see mentioned how pipes affect the exit code propagation (i.e. pipefail).

Post reply on HN