Live data from Hacker News

Amber: Programming language compiled to Bash

amber-lang.com

141–150 of 330 posts

Re: Amber: Programming language compiled to Bash

#141

I was confused by Amber Smalltalk's pivot. Turns out it is just a newer language deciding to use the same name as an existing one. The domain is almost exactly the same as well. https://amber-lang.net/

Same for me. There's still plenty of unused gemstones as programming languages so perhaps the authors may still decide to change their name.

Hmmmmmm.

Bagsy Coprolite.

Re: Amber: Programming language compiled to Bash

#142
I think this is a cool concept, and all, but honestly, at this point, why just not use Python3 as your project's scripting language, and reap all the benefits of a simple, typesafe/autocomplete ready language with broad IDE support, and no intermediate 'compile step' which generates "don't touch" code?

Re: Amber: Programming language compiled to Bash

#144
I like the idea, but the example suggests that it invokes external programs for trivial stuff, like comparing a variable to an integer (invokes bc and sed). I would prefer if it compiled to pure bash, and only invoked external programs if explicitly called for. But I guess emulating some feature in pure bash is hellish, that's exactly I don't want to write that manually either though.

Re: Amber: Programming language compiled to Bash

#146

To my eye, this does not look good. I consider myself to be quite proficient in bash. I write a lot of bash professionally. I've written a compiler (transpiler?) for a strongly typed configuration language that outputs bash. There are three main problems I see here. (1) Pipelines, subshells, and external dependencies. The example on the website compiles a conditional `if age if [ $(echo ${__0_age} ' Pipelines and sub…

My reaction was that the bash version is a monstrosity indeed and I got shudders thinking about being an on-call operator getting a page and then having to read and understand what the hell is wrong with this script.

Re: Amber: Programming language compiled to Bash

#148
post #110

This is interesting, but I don't see why I would use this instead of Python or Go? With those I'd get portability, modern features, etc but with the added bonus of a powerful standard library and ecosystem. Don't get me wrong, I hate writing shell scripts, so this is definitely an improvement over that. It just doesn't seem like the most practical solution (unless I'm missing something).

Bash is ubiquitous and stable, making bash scripts incredibly portable. All of the other languages you bring up are great for authoring code, but have a non-zero amount of friction when running code in the wild. Python may be omnipresent, but you can rarely count on a specific version or the presence of specific libraries. Go requires compiling platform-specific binaries. Even JVM- or JS-based software requires insta…

I didn't realize we were going so far back. In that case, Perl may be more convenient than Python/Go, and almost certainly a better choice than bash.

Still,

> If you want to write some code (e.g., a launcher, installer, utility code, etc...) that is almost certainly going to run on any computing device created in the last several decades, bash is your language.

Can you give an example of a "several decades" old device for which you'd want/need to write a launcher or installer?

Re: Amber: Programming language compiled to Bash

#149

Why does the documentation need WebGL? I have WebGL disabled in my main browser for privacy reasons (super-easy to fingerprint), and I only get to see 'Application error: a client-side exception has occurred (see the browser console for more information).' with an error about ThreeJS initialization in the console. I assume it's for the fancy animation, and I find that ridiculous. Loading a whole 3D library just to sh…

> Even if you're convinced you need the fancy animation, why not gracefully fallback to not showing it and still make the docs usable? Yeah, it's not like adding a try/catch block around the webGL invocation was hard anyway… But I agree with the sibling comment about disabling WebGL likely being a fingerprinting liability more than a win.

If you disable WebGL you're putting yourself in the 2% of devices that don't support it.

That's not fantastic, but with WebGL enabled just the extension list can be used to narrow you down way further than that - according to https://amiunique.org/ 0.35% of users share my exact supported extensions list. My `gl.getParameter(gl.RENDERER)` seems to be unique to me, for some ungodly reason. The output from rendering a single triangle also narrows me down to 0.8% of all users.

Re: Amber: Programming language compiled to Bash

#150

I think a superset of bash with strong types makes more sense than a brand new language that compiles to it. This is what makes typescript so successful (aside from other things) is that you can just drop it into your project and incrementally adopt it.

Call it "typebash" - easily understood by everyone
Post reply on HN