I just released the preview-3 version of ABS, a terse, pragmatic scripting alternative to Bash. This release is geared towards cleaning up bugs before 1.0, so I thought I’d spend some time going through the changes.
We got 1 of them!
but this created a few issues with ABS’ parser. For example, when executing code such as:
the parser would see
x = 10[y], and throw a truckload of
errors. A simple fix was to add a semicolon on the line
right before a destructuring statement:
Now, considering I had to fix this as well as the fact that I’m always aiming to keep the language as terse as possible, I took some inspiration from Ruby and refactored destructuring to resemble Ruby’s multiple assignments.
In order to destructure an array, you will now have to:
Easy peasy, with the added bonus of less typing!
Only 1 new feature in this release of ABS: bitwise operators.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Here’s where the bulk of changes happened:
nullis now an “assignable” value. Earlier on, you couldn’t
x = null, which resulted in funny behaviors such as #85
- numbers are not following scientific notation: for very large numbers, the formatter used to convert them to something like
1e+06. This has been now fixed.
- fixed a panic when using
.map(...)without return values (#62)
- fixed a panic when calling functions without enough arguments (#61)
- beautified a panic when trying to execute a script that does not exist (#77)
- beautified a panic when trying to execute
.sum()on an array with elements other than numbers (#75)
- fixed error handling in
- fixed script halting when there was an error in a while block (#82)
\fas a separator for
- strengthened the command parser (#78)
- fixed shell command escaping (#81)
- destructuring statements do not need a
;on the preceding line anymore (#83)
In other news…
Ever hoped a bash script could look like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Hope no more! Simply
and start hacking like it’s 2018!