▲ 86 ▼ Amber the programming language compiled to Bash, 0.5.1 release (docs.amber-lang.com) submitted 8 months ago by lens0021@programming.dev to c/linux@programming.dev 32 comments fedilink hide all child comments My primary use case for Amber is when I need to write a Bash script but don't remember the silly syntax. My most recent Bash mistake was misusing test -n and test -z. In Amber, I can just use something == "" or len(something) == 0
[–] unhrpetby@sh.itjust.works 5 points 8 months ago (2 children) I'm reminded of the horrid example showcased on the amber-lang website previously. permalink fedilink source hideshow 4 child comments replies: [–] Samueru_sama@programming.dev 1 point 8 months ago [ "$age" \< 18 ] && { echo "I'm not an adult yet" } || { echo "I'm an adult" } if you want to be using braces in if statements lol permalink fedilink source parent [–] BB_C@programming.dev 1 point 8 months ago (1 child) They know you can just do if ((age < 18)) in bash, right? Or rather if ((10#$age < 18)) because age=021 would not be adult 😉 Hopefully, they protect against that at least. (I had to double-check this stupid default is still a thing, since I moved to zsh many years ago.) permalink fedilink source parent hideshow 2 child comments replies: [–] jasory@programming.dev 1 point 8 months ago bc can handle extended-precision integers, unlike bash which maps them to floats. permalink fedilink source parent
[–] Samueru_sama@programming.dev 1 point 8 months ago [ "$age" \< 18 ] && { echo "I'm not an adult yet" } || { echo "I'm an adult" } if you want to be using braces in if statements lol permalink fedilink source parent
[–] BB_C@programming.dev 1 point 8 months ago (1 child) They know you can just do if ((age < 18)) in bash, right? Or rather if ((10#$age < 18)) because age=021 would not be adult 😉 Hopefully, they protect against that at least. (I had to double-check this stupid default is still a thing, since I moved to zsh many years ago.) permalink fedilink source parent hideshow 2 child comments replies: [–] jasory@programming.dev 1 point 8 months ago bc can handle extended-precision integers, unlike bash which maps them to floats. permalink fedilink source parent
[–] jasory@programming.dev 1 point 8 months ago bc can handle extended-precision integers, unlike bash which maps them to floats. permalink fedilink source parent