Golo 2.0.0 is here with new language features, improvements and fixes. This is the result of a great community effort: we are glad that new contributors joined us, and the new language features are contributions developped outside of the Dynamid research group.
As Golo tries to stick to the semantics of semantic versioning, we bumped to a
new major version. Indeed, named augmentations are a new language feature, and they turn
into a keyword, which introduces a tiny backwards incompatibility.
Before we dive into the highlights of this new release:
- Download Golo 2.0.0
- Play with Golo on Google AppEngine
- Read the Golo programming language guide
- Star / fork the project on GitHub
- Get in touch on our mailing-list
- Chat with us
UTF-8 characters (and Emoji)
Yes, one can now have fun with UTF-8 symbols:
Even better (or worse), Emoji is possible:
which prints: 🍻 Golo
Augmentations can now be given names, as in:
Then, such augmentations can be applied to types as in:
See the documentation for more details about named augmentations
Banged function calls
Banged function calls allow caching the result of a first call:
In this contrieved example,
take_a_while would be called only once, and the value
would serve as a result for all subsequent calls to this call site.
Banged function calls shall only be used to cache the result of calls to pure functions.
The performance improvements done by caching with banged function calls are especially interesting when used on decorators. Indeed, Golo decorators are simply high-order functions, and they need to be evaluated for each decorated function call. This is not the case for banged decorators:
which expands to:
See the documentation for more details about banged function calls
Range objects improvements
Range objects now have a literal syntax:
Ranges now support
decrementedBy methods, which allows code such as:
Number type conversion functions
Sometimes one needs to make explicit type conversions in a dynamically-typed language.
do just that:
New standard library functions
A few additions have been made to the standard library, including:
newTypedArrayto build typed JVM arrays (i.e., not just
uuidto get a new UUID-generated string,
sleepas a shortcut to
The compiler has been tightened to reject referencing uninitialized references, such as in:
The golodoc generation has been improved.
Under the hood, the method / function runtime resolution has gone through several refactorings and fixes.
Until next time…
Many thanks again to our community members, and have fun with Golo!