Fresh new release of the ABS programming language, bringing more syntax you should be familiar with, inspired both by Bash and Python.
This release includes 8 new features and 2 bugfixes, let’s discover them together!
Better membership testing
The membership testing operator, in
, now
supports finding whether an object has a
particular key as well as it allows to
find substrings in strings:
1 2 3 4 5 |
|
With these changes to in
we are now
deprecating the set.includes(member)
function:
1 2 |
|
The function will keep working but, again, is deprecated. We will likely not remove it from future releases (even major ones) but… …you’re warned!
1 ~ 1.1
The similarity operator, ~
, now supports numbers:
1 2 |
|
Numbers will be similar if their integer conversion is the same. This is a shorthand for:
1 2 |
|
for .. in
We’ve made a few changes to for .. in
to make
it more useful, as you can now loop through hashes:
1 2 3 4 |
|
More destructuring
We introduced destructuring before ABS was stable, updated it right before 1.0 and we’ve now expanded it to be able to destructure hashes:
1 2 |
|
Backtick commands
My absolute favorite feature in this release is the ability to execute commands with the backtick shell syntax:
1 2 3 4 |
|
There are some limitations with the $()
syntax (namely, a command
needs to be on its own line) that are not there anymore with backticks.
Now you can do things such as:
1 2 3 4 5 6 |
|
The same interpoltion style available with $()
is
working with backticks:
1 2 |
|
sleep(ms)
Well…every language has one!
You can now pause execution of a script by sleeping for a certain amount of milliseconds:
1 2 3 |
|
Hash built-in functions
With this release we’ve added a bunch of new built-in functionalities to hashes:
1 2 3 4 5 6 |
|
NULL comparison
In ABS 1.0.0 we introduced a bug that would make NULL comparison fail:
1
|
|
In 1.2.0 we fixed it (and backported it to 1.0.2).
Index assignments
Assigning to the index of an hash / array now works:
1 2 3 4 5 6 |
|
What are you waiting for?
1
|
|
…and start scripting like it’s 2019!
PS: Again, many thanks to Erich, who’s been helping me along the way and has become a crucial member of the team over the past few weeks. Just want to make sure his name is mentioned as most of this stuff would not have been possible without him!
PPS: 1.2.0 is already well underway — expect it within the next 2 to 3 weeks. We’ll be introducing extremely interesting features such as background commands and REPL history, so it’s going to be an exciting release!