Live data from Hacker News

Amber: Programming language compiled to Bash

amber-lang.com

161–170 of 330 posts

Re: Amber: Programming language compiled to Bash

#161
post #137

Earlier quoted context omitted.

adblock/ublock/umatrix could get you out of that too.

Sites can tell if you’re running Adblock too. You’re always leaking some kind of information that advertisers will pay for. The game is choosing what information you’re okay giving them

Doesn't really matter if you can block the ads anyway

Besides, advertisers are not who i worry about when it comes to "my data".

Re: Amber: Programming language compiled to Bash

#162

Earlier quoted context omitted.

Why doesn’t Amber have equivalent issues? Such as depending on a specific version of bash, or specific executables to be installed. Also does bash run on windows outside of WSL? Amber seems to argue that it doesn’t support Windows because Windows doesn’t support bash. That would cut against the idea that bash can target more devices than Python, which runs natively on all platforms.

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?

Re: Amber: Programming language compiled to Bash

#163

I haven't seen a mention of the Oil Shell ( https://oilshell.org ) project's OSH/YSH yet and I'm quite surprised. Oils goal is that OSH is just a new Bash implementation (although not bug-for-bug) but with an upgrade-path to the more modern YSH for real programming with type safety etc, but still as a shell language. One of their exciting ideas is using code as data in a somewhat lisp-like manner to allow function in…

Oil shell requires osh to run. That means that you can't run Oil scripts on systems that only have Bash installed.

Re: Amber: Programming language compiled to Bash

#164
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…

[dead]

Re: Amber: Programming language compiled to Bash

#165
post #38

Earlier quoted context omitted.

I was more put off more by the initial example. Amber being used to calculate an age being less than 18. With sed. Seems almost like an attempt at humor, except the bit where one would laugh.

This is the compiled to Bash part. Sed is used because `bc -l` can return a float when integer is expected. Not sure if can be done better in generic case but it isn't unheard. Certainly can be optimized for some cases. (Here e.g. can use Bash's built-in integer arithmetic.)

You could also do the extremely readable `| cut -f1 -d.` which will do nothing for an integer.

Re: Amber: Programming language compiled to Bash

#167

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.

Re: Amber: Programming language compiled to Bash

#168
post #38

Quick note to the creators: the website looks almost exactly like every other "here try this cool command-line utility so we can hook you and start charging a service fee for it" startup website and I instantly distrusted it. The design communicates that you're selling a product , not providing an open-source utility. That said, very interesting syntax. I agree with others about the $...$ being kind of odd, but other…

I was more put off more by the initial example. Amber being used to calculate an age being less than 18. With sed. Seems almost like an attempt at humor, except the bit where one would laugh.

Its ugly code - why would they show it off.

Re: Amber: Programming language compiled to Bash

#169
post #104
post #90

Earlier quoted context omitted.

Free as in Freedom, not free as in free beer...

In this case, as in both.

GPL 3 isn't great for either. From a commercial perspective, you can only use it if you lock your stuff up in a datacenter, but not if you ship it on a device that customers own. In practice, that means GPL 3 is not only supporting surveillance capitalism, but is also banning use in commercial systems that do not spy on their users. (The US CLOUD Act says that you have to provide the government with access to all machines you have access to, even if they are overseas. In practice, that means that any commercial GPL 3 stuff that has a footprint in the US is globally subject to US-style dragnet surveillance.)

Granted, bash is now GPL 3 (which is why Apple has to ship an obsolete version, and now defaults to zsh), so you can't use Amber on machines where GPL 3 won't fly (unless it can also compile to posix shell, zsh, etc).

Anyway, if you're interested in freedom for your users, I'd suggest AGPL 3, since it prevents people from locking it up inside the cloud or shipping with proprietary operating systems. At least that way, you're not stripping users' right to privacy like GPL 3 (inadvertently?) does.

These days, Apache and BSD-style licenses are looking better than ever to me, at least when I'm at work.

[edit: You can sell machines with Coreboot (and maybe a proprietary BIOS) + bash. However, you can't ship things that use a secure boot mechanism.

From reading the FSF documentation, it's not clear to me if it's OK to ship a GPL 3 userland on a machine with secure boot enabled, even if it can be disabled later. Apple apparently decided that it is not.]

Re: Amber: Programming language compiled to Bash

#170

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/

At first I felt the same way, because as a language designer I feel there are enough good names out there that new projects should be able to go find one that isn't taken.

However, having looked at this case I'm not against it for several reasons.

First, it looks like the project has been abandoned. There hasn't been an issue closed in 2 years, and the latest copyright date is 2019.

That might not be enough to sway me, but then you have to realize the project doesn't even really call itself a language. They are "Amber Smalltalk". This is an implementation of Smalltalk, not a language itself.

  Amber is an implementation of the Smalltalk language that runs on top of the JavaScript runtime.

  Pharo Smalltalk is considered as the reference implementation.
So you see this is an implementation of Pharo Smalltalk that runs on JS.

Finally, and the nail in the coffin, over the past couple years in the mailing list there has been little activity -- nominally a monthly message from a single user advertising the "UK Smalltalk User Group Meeting" which sounds interesting but not really about Amber Smalltalk as a project per se.

No one is using it, no one is working on it, and it wasn't a language in the first place. I would say that it's fine for an actual language project to pick up the name.

Post reply on HN