Re:Amber – the programming language compiled to Bash
by 1oooqooq on Wednesday May 22, 2024 @04:00AM
(#40438455)
i think they do this since there's no source map or symbol mapping support on the debugger (which is just bash errors lol)
would be nice if it was the source and script at the same time. as in a comment at the bottom or top is the source or something.
Re:Amber – the programming language compiled to Bash
by 5e92cb50239222b on Wednesday May 22, 2024 @07:57AM
(#40439889)
Nothing can be done about variable names, but format inconsistencies can be autofixed with shfmt. I've been using it for years and it's been solid.
Re:Amber – the programming language compiled to Bash
by ape4 on Wednesday May 22, 2024 @10:10AM
(#40441248)
And why is it using [ instead of bash native [[
Re:Amber – the programming language compiled to Bash
by weaksauce on Wednesday May 22, 2024 @01:59PM
(#40443984)
I think it's targeting a really old bash for max compatibility... and also it's super early alpha software
Re:Amber – the programming language compiled to Bash
by pubg on Wednesday May 22, 2024 @04:14PM
(#40445834)
It's interesting Amber doesn't seem to be leveraging Bash-native Regexes via:
if [[ "${foo}" =~ ^someReg[e][x][p][r]$ ]]; then ...
What value exists in going to such great lengths to target super old and anqtiquated versions of Bash? It becomes very limiting for this poor new language :-sMaybe still just the earliest of early days? Javascript-style RegExs along the lines of:
if (s.match(/my[R]egex[H]ere/)) { ..
Would be pretty nice and handy.
https://github.com/Ph0enixKM/Amber/blob/master/setup/install...
https://github.com/Ph0enixKM/Amber/blob/master/setup/uninsta...
The inconsistent indents and decorated variable names made them less readable than hand-written Bash scripts. I understand that most compiler outputs are not meant to be human readable, but generally we would get minification and/or obfuscation in exchange for losing readability, and Amber doesn't seem to offer those yet.