Live data from Hacker News

Amber: Programming language compiled to Bash

amber-lang.com

171–180 of 330 posts

Re: Amber: Programming language compiled to Bash

#171

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…

'WebGL disabled' is a pretty strong fingerprint anyways

It makes you look the same as everyone else with webgl disabled. This happens to be a reasonably large number of people, because it's the default setting in a variety of privacy focused browsers.

Re: Amber: Programming language compiled to Bash

#173

Earlier quoted context omitted.

Also a note about it being Free as in Beer.

No as I really don't understand that - beer costs money.

"free beer" means something very different to "free speech". That's what the phrase refers to.

Re: Amber: Programming language compiled to Bash

#174
post #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?

Because the project might require a script that is delivered to many Linux servers with less dependencies and not having to install a new language.

Re: Amber: Programming language compiled to Bash

#175

Earlier quoted context omitted.

Amber doesn't have equivalent issues because bash and the utilities it uses like bc and sed are incredibly stable. I've found nontrivial shell scripts I wrote decades ago that still run entirely unchanged.

That only applies to platforms on which those utilities already run. We are talking about portability here, so that means Windows, and those utils don't run on Windows. So you're left with git bash, which isn't bash and isn't running the same utilities; and WSL, which requires installing an entire operating system. So I ask again, why does targeting bash offer a better portability story than say the JVM?

I suspect we may have different ideas of the use case here. To me Amber is not a language I would develop an application in. I would use it in the same places I currently write bash.

Given that, my production systems are likely a big target. None of my production systems have a JVM/JRE installed, and installing one just to run shell scripts would be (IMHO) a huge increase in attack surface for little to no gain. It would also bloat the hell out of my container images.

If I'm writing a GUI application or a web server or something, then I would agree JVM is more "portable." But if I just want a script that will run equally well on Ubuntu 18.04 and Fedora 40, and across all production machines regardless of what application stack is there (node.js, ruby, python, etc), and regardless of what version of node or python or ruby is installed, Amber feels highly portable to me.

Re: Amber: Programming language compiled to Bash

#176
post #77

Earlier quoted context omitted.

I don't think it's incredibly unusual. On sensitive machines in corporate settings you commonly disable pretty much everything on every page that isn't in the 'trusted zone' or whatever. Personally, by default I shut down all the browser crap that might needlessly allocate RAM or allow memory leaks or slurp cycles without giving me some kind of value. I think this allows me to hold at least a few hundred extra tabs o…

If you mean block all network traffic that isn't in the trusted zone then sure. But disabling features you personally don't like isn't a good security practice.

Maybe I wasn't clear. First I described a somewhat common practice in corporate settings, which is ostensibly motivated by security policies. Then I described my personal preference, which I motivated with resource consumption and performance factors.

I did not say that the corporate practice is a good one, I just brought it up as an example to refute the suggestion that limited web browsers are incredibly unusual.

Re: Amber: Programming language compiled to Bash

#179

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…

> ... learn bash. I've been writing bash code regularly for my entire 20 year career. I'm not convinced that I've "learned bash" yet. Bash has too many different ways of doing things, and it can be hard to determine which variant is the right way.

Agreed. For instance, the piped bc sed thing's error handling is apparently broken, and no one has pointed that out yet. pipefail and $() don't play nice with each other:

   #!/bin/bash
   set -euo pipefail
   echo $(false|true)
   echo a
   echo $(false)
   echo b
   false
   echo c
Prints 'ab'.

Re: Amber: Programming language compiled to Bash

#180

Why would a person go this route instead of a higher-level scripting language (Python, JS, Ruby, etc.) or a full-blown binary (Go, Rust, etc.)? I don't get it. Asking not to be rude but to be educated.

I would assume because bash is deployable to more locations with fewer assumptions. Scripting requires environments to be set up correctly to run, and binary makes architecture assumptions.
Post reply on HN