Version 0.2.3 released
As the clock strikes 12, it’s update time. Firstly, another big shout out to CrazedProgrammer and Lignum for PRs they’ve sent. Thanks to them Urn is better tested and has even more features.
Now onto the changes. This update, much like the Musketeers, comes in three parts:
REPL
The REPL is great for testing and experimenting with Urn. In this update, we’ve added some new features to make it even easier to use:
- Add
:search
command to find symbols and documentation matching a given pattern. - Add a magic value
out
, assigned to the value of the last expression.
Libraries
The standard library is growing day by day with new functionality to make life easier. In this update:
- Add
drop
andtake
for making slices of lists - Add
keys
andvalues
for accessing structs. - Export
string
andmath
libraries by default. - Add many more tests for the stdlib
Code generation and optimisation
One of the big problems with Urn currently is that the generated code is rather ugly. Most of it isn’t any less
efficient than normal Lua, just significantly more verbose than desired. Thankfully, we’re beginning to take steps to
improve code generation. The backend can now recognise branches which could be compiled to and
, or
or not
and emit
the appropriate Lua.
We’ve also added function inlining, meaning that simple helper functions will be removed, removing the overhead of function calls. You can see the effect of that here.
- Add a inlining optimisation pass (disabled by default, enable with
-O+inline
). - Add a new codegen system, with support for
not
,and
andor
. - Simplify trivial lamda expressions
- Correctly pack arguments in directly called lambdas
- Don’t constant fold functions which returned multiple values.
- Fix code generation issues when calling quoted lists, or expressions involving quoted lists.
- General performance improvements to the optimiser.