Elektrine lite

← Feed

@novafunc@discuss.tchncs.de

Has anyone tried Amber for writing bash scripts? Would you recommend it?

2026-07-26 12:32 UTC

In short, Amber is a programming language with Rust like syntax that compiles down to bash. More details here: amber-lang.com On the surface, it seems nice. Cleaner syntax, types, compile-time safety checks, etc. So you get to write in something nicer than bash but get the portability of bash. My wonder is if there are pitfalls that make it worse than instead writing it in something like Python or even bash itself. I’d guess the generated bash code probably isn’t the prettiest to look at or debug.

Replies (7)

  • @CameronDev@programming.dev 2026-07-26 13:05

    If your comfortable writing rust, why not just use rust and compile to rust binaries? Rust has toolchains for realistically everything…

    Open ##4112533

  • @mmmm@sopuli.xyz 2026-07-26 14:57

    I wonder why decided to make it transpile to bash instead of posix sh.

    Open ##4114500

  • @jokro@feddit.org 2026-07-26 18:00

    This is nice. Writing safe bash scripts includes avoiding implicit pitfalls. If the tool actively stops you from that it’s great. I wished this would have existed some years back.

    Open ##4117750

  • @IanTwenty@piefed.social 2026-07-26 19:29

    I like the idea as BASH is available everywhere but has terrible gotchas in its syntax plus at times is unreadable. When I did some moderately complicated amber scripts I hit bugs. Also still some important features are missing. So I’m keeping an eye on it but it’s definately not ready for anything serious yet. I am also watching https://oils.pub/ and hoping one or both of these projects succeed.

    Open ##4119298

  • @balsoft@lemmy.ml 2026-07-26 20:44

    At the risk of stating the obvious, I would like everyone to know that www.shellcheck.net exists. Unless you are a bash wizard: if your bash script doesn’t pass shellcheck, it is very likely to have bugs.

    Open ##4120594

  • @chgxvjh@hexbear.net 2026-07-27 06:05

    Calling commands and processing their outputs seems to be an afterthought. Nushell or oilshell or even perl have nicer syntax for scripting tasks ihmo.

    Open ##4130257

  • @Sandouq_Dyatha@lemmy.ml 2026-07-26 21:50

    @AMBER_BOT@hexbear.net

    Open ##4167908