A few weeks ago I released version 1.4.0 (and 1.4.1, with an additional bugfix) of the ABS programming language: in this post, I’d like to explain everything major that made it in this new minor release.
ABS ❤ unicode
We have implemented unicode in ABS: you can now use both unicode letters in variable names as well as any unicode character in strings.
For example, you can output any code point within a string:
1 2 |
|
as well as use unicode letters in variable names:
1 2 |
|
Note that only unicode letters (category L
) are allowed as variable
names, and using any other character will result in a parsing error:
1 2 3 4 |
|
eval(…)
Oh, good old-school eval
!
This function does exactly what you’d expect it to do, as it executes the ABS code passed as its argument:
1 2 3 |
|
Digits in variable names
We now support digits in variable names:
1
|
|
We might expand this feature later on to include unicode numbers, if the community feels like this would be a useful feature (haven’t heard of any use case so far).
Numeric separators
Following Python 3.6
and JS on Chrome 75,
we’ve decided to help with readability on large numbers and allow
_
as a numeric separator:
1 2 3 4 5 6 7 |
|
Panic without a terminal
We fixed a panic when you try to run the ABS REPL without
having a terminal attached (for example, during a Docker
build, or when piping a bare abs
command); ABS will now
explicitely let you know what the problem is:
1 2 3 4 5 6 7 8 9 |
|
Panic when converting empty strings to JSON
We fixed a pnic when trying to convert an empty string to JSON, which will now convert to an empty string:
1
|
|
Fixes to JSON conversion of hashes
You can easily convert an hash to JSON through the
builtin .str ()
function:
1 2 3 4 5 6 7 |
|
There was an issue when converting keys or values with
double quotes in them, but it has since been fixed.
Code such as '{"x": "\"y"}'.json().x
will now work
seamlessly.
Go modules
We’ve migrated the codebase to Go modules: even though this might not be a ground-breaking change, it should help those who develop the ABS core, allowing no conflicts when it comes to dependencies.
Now what?
Install ABS with a simple one-liner:
1
|
|
…and start scripting like it’s 2019!
PS: Again, many thanks to Ming, who’s been taking a larger role as the weeks went by. Without her, many of the stuff included in 1.4 wouldn’t be possible!
PPS: 1.5.0 is already well underway — expect it in the next few days. We’ll be introducing extremely interesting features such as file writers, so it’s going to be an exciting release!