Live data from Hacker News

Amber the programming language compiled to Bash/Ksh/Zsh

amber-lang.com

31–40 of 72 posts

Re: Amber the programming language compiled to Bash/Ksh/Zsh

#32
post #4

Thank you, but... why not just write in Bash, or the shell you prefer? Why learn a yet another opinionated wrapper? Yes, Bash or any shell is a very complex and utterly environment dependent language to approach with all due care for security and compatibility, yet hence the lack of wrapper that may not even be aware of these crucial cases at all.

bash is really painful to use for anything beyond the most rudimentary logic. Bourne and Mashey were terrible language designers. (By contrast, Thompson's V6 shell is very elegant, if limited.) That said, this should just be a shell itself and not something that generates into other shell dialects. Otherwise, why not use Ruby or something like it that has actual expressive power?

Hot take, but Powershell is quite an elegant shell language. It's actually a lot easier to write than Bash.

It took my quite a while to get used to all the verbose method names, but it actually makes it pretty readable by default.

Re: Amber the programming language compiled to Bash/Ksh/Zsh

#33
post #21

Earlier quoted context omitted.

Can you change the current working directory? If not, it's not a shell script.

Presumably you can call chdir(2) from the C code? Or did you mean change the directory of the calling shell (in which case, executable shell scripts written in Bash and friends can’t do that either).

Well, you can "source" a script, so its effects persist in your current shell session. That's a feature of the script and your shell sharing the same language.

Re: Amber the programming language compiled to Bash/Ksh/Zsh

#35
I tried this or something similar a while ago and really wanted a better argument parsing experience

https://docs.amber-lang.com/0.6.0-alpha/basic_syntax/importi...

it seems like automatic `--help` + named args is still not a thing? if it were, I'd be all over this

Re: Amber the programming language compiled to Bash/Ksh/Zsh

#36

Earlier quoted context omitted.

Presumably you can call chdir(2) from the C code? Or did you mean change the directory of the calling shell (in which case, executable shell scripts written in Bash and friends can’t do that either).

Well, you can "source" a script, so its effects persist in your current shell session. That's a feature of the script and your shell sharing the same language.

Sure, but “shell scripts” as an (admittedly imprecise) term usually imply separate executable files, not shell libraries/functions that are sourced.

Re: Amber the programming language compiled to Bash/Ksh/Zsh

#37

unclear use case imo - this sacrifices the ergonomics of actual bash scripting, and hides it behind another language If your script is complex enough to need a higher level language you might as well just switch to python

bash scripting has ergonomics?

Regardless of where it’s deployed I can edit it and run it without any additional tools.

Re: Amber the programming language compiled to Bash/Ksh/Zsh

#38

In a world where AI can generate any code for any environment, is there a need for another language? On the other hand, we're at a point for a binary language (or standard / framework) that one AI/LLM creates and another one validates. What are we missing?

> is there a need for another language?

If you know of a language that is perfect for all our needs today and tomorrow, please guide us to it.

> What are we missing?

Major concerns would be i) trust in the tooling, ii) quality and accountability, iii) future investment in competent engineering.

Re: Amber the programming language compiled to Bash/Ksh/Zsh

#39

unclear use case imo - this sacrifices the ergonomics of actual bash scripting, and hides it behind another language If your script is complex enough to need a higher level language you might as well just switch to python

The only thing I can think of is if you have an existing system you are integrating with thats implemented in shell script already - for example a packaging or build pack system; but I can’t really see how this could be justified even there because this could easily be a toy that becomes abandoned.
Post reply on HN