Amber - the programming language compiled to Bash (amber-lang.com)
from otter@lemmy.ca to programming@programming.dev on 21 May 2024 23:42
https://lemmy.ca/post/21672526

#programming

threaded - newest

key@lemmy.keychat.org on 22 May 2024 00:55 next collapse

I love the concept. I hate many of the language design choices.

Scolding7300@lemmy.world on 22 May 2024 05:06 collapse

Like what for example?

towerful@programming.dev on 22 May 2024 11:30 collapse

For me, after looking over the docs, it’s close enough to JavaScript that it might as well adopt more of the syntax (for example, conditionals and loops don’t use parenthesis). It also has some similarities to python, but again not enough to be python.

Feels like an in-between language that has enough similarities to seem easy, but some gotchas that will regularly catch you out.
And then some extra features like the if chaining, which doesn’t have the keyword if or switch in it. So you have to know that that structure implies an if or switch conditional.

Especially for something like bash scripting, which devs probably don’t spend as much time doing compared to python or js. So, it would probably take them longer (and break their brain more) than just scripting it in python/js directly or dealing with bash directly.

It’s an improvement over bash, and it’s nice that it transpiles to bash.
I might have to play around with it and see how it actually feels to use

DeprecatedCompatV2@programming.dev on 22 May 2024 22:41 collapse

I found the if-blocks more concerning than the lack of parentheses. Although I would’ve preferred parentheses for better parity with Kotlin for the if-else blocks (instead of then).

VubDapple@lemmy.world on 22 May 2024 03:18 next collapse

Why?

otter@lemmy.ca on 22 May 2024 03:53 collapse

I think it’s to make it easier to write bash scripts, for those who are new or when the script is doing a more critical task

Modern Syntax

You will find many of the language features familiar, allowing you to get up and running much faster than if you were learning Bash from scratch.

Runtime Safety

It’s one of the key components missing from regular shell scripts. It can help you catch many bugs at compile time.

Type Safety

Amber ensures that you handle everything that could fail. Each Bash command and function that could fail must be handled in some way.

VubDapple@lemmy.world on 22 May 2024 04:09 next collapse

Ok, I guess that makes sense. Bash is a pretty old school language for those raised in the functional programming era

thebardingreen@lemmy.starlightkel.xyz on 22 May 2024 05:12 collapse

So if you’re already pretty good at bash would you bother to switch and learn this?

vext01@lemmy.sdf.org on 22 May 2024 06:34 collapse

Never heard of this language, but you’d be surprised how hard it is to write a correct and portable shell script.

Personally, I’d break out python once the script gets larger than a few lines, or rust if I want something more proper.

einlander@lemmy.world on 22 May 2024 05:48 next collapse

Whoa Black Betty, Amber-Lang.

Unpigged@lemmy.dbzer0.com on 22 May 2024 06:14 next collapse

There’s babashka, why?

MachineFab812@discuss.tchncs.de on 22 May 2024 15:19 collapse

We need a way to watch for replies to comments without commenting ourselves… (not an answer to your question, sorry)

Unpigged@lemmy.dbzer0.com on 22 May 2024 19:43 collapse

I mean, my comment isn’t really meaningful either so, touche, Internet stranger.

MachineFab812@discuss.tchncs.de on 22 May 2024 20:55 collapse

No, I meant I was following your comment, as I am interested in the answer to your question.

deathmetal27@lemmy.world on 22 May 2024 10:43 next collapse

So basically the TypeScript of bash.

thingsiplay@beehaw.org on 22 May 2024 15:55 next collapse

Was posted a few hours before and has many comments: beehaw.org/post/13943043

wargreymon2023@sopuli.xyz on 23 May 2024 07:24 next collapse

Don’t like it one bit

If bash is hard to program, get away with it, not build atop of it.

laughterlaughter@lemmy.world on 23 May 2024 08:05 collapse

I like the concept…

wargreymon2023@sopuli.xyz on 23 May 2024 08:09 collapse

okay but the author has to write it, why not write something useful open source?

furikuri@programming.dev on 23 May 2024 09:11 collapse

For fun or to play around with transpilers?

aluminium@lemmy.world on 24 May 2024 05:06 next collapse

I mean if you want a shell language that behaves more like a regular programming language, PowerShell core is a thing.

smileyhead@discuss.tchncs.de on 29 May 2024 11:17 collapse

When JavaScript developer starts writing a Linux script.