FLOSS Weekly Episode 790: Better Bash Scripting With Amber

This week Jonathan Bennett and Dan Lynch chat with Paweł Karaś about Amber, a modern scripting language that compiles into a Bash script. Want to write scripts with built-in error handling, or prefer strongly typed languages? Amber may be for you!

https://github.com/Ph0enixKM/Amber
https://amber-lang.com/
https://docs.amber-lang.com/

Did you know you can watch the live recording of the show Right on our YouTube Channel? Have someone you’d like use to interview? Let us know, or contact the guest and have them contact us! Take a look at the schedule here.

Direct Download in DRM-free MP3.

If you’d rather read along, here’s the transcript for this week’s episode.

4 thoughts on “FLOSS Weekly Episode 790: Better Bash Scripting With Amber

  1. Way wrong on Busybox.

    The biggie is that there are _two_ shell implementations in Busybox, neither of which are Bash. One is called “hush” and is rarely used. The default one used almost everywhere is ash, the predecessor to Debian’s dash, and currently used as the default `/bin/sh` on some (not all) BSD systems. This is the type of thing the Amber author meant when they said they did not yet support “sh”. The proper term for this is POSIX shell compatibility, and it means rolling back all features added to Bourne-family shells since 1988.

    Secondarily, Jonathan said something about not having sed and grep and all in this Busybox environment, but of course [that is not true](https://busybox.net/downloads/BusyBox.html). Indeed, shipping a pared-back copy of Busybox would be one way to get Amber’s dependencies on systems that lack it. It would solve Amber’s needs without them needing to take on the portability burden.

    (By the way, I support their use of external binaries to extend Bash’s capabilities. It’s how Bourne shells are meant to be extended; the “standard library” of a shell script is the contents of `PATH`. It is because of all this that Bash is so weak as a scripting language, inviting the creation of everything from awk to Perl to Amber.)

    An easy way to work out how badly incompatible Amber is with POSIX shell is to fire up an Alpine Linux container:

    “`
    $ podman run -it –rm alpine
    “`

    There’s little more there besides Busybox: Musl’s libc, a tiny package manager, and that’s about it.

    I find it suggestive that there is no “amber” package in APK.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.