But why does it use bc in the first place? Bash does integer arithmetic perfectly well on its own.
Amber claims to be type safe so it should have enough information to avoid the the use of bc in this case.
Ah, just looked at the documentation. Amber doesn't have integer types just a number type. That means that any numerical operation in Amber is pretty much guaranteed to be very inefficient.
It's a very strange choice to make because the underlying 'machine code' supports both integers and floating point.
This is the first thing I noticed. Using ‘bc’ and ‘sed’ for integer comparison seems quite odd.
But then they chose this for their front page example, the one that everyone will see, so I assumed this was to demonstrate something clever I just didn’t understand.
I wonder what the motivation was to not have an integer type?
Amber claims to be type safe so it should have enough information to avoid the the use of bc in this case.
Ah, just looked at the documentation. Amber doesn't have integer types just a number type. That means that any numerical operation in Amber is pretty much guaranteed to be very inefficient.
It's a very strange choice to make because the underlying 'machine code' supports both integers and floating point.