Version 0.6.0 released
Wow, it’s been a while since the last update. During that time, we’ve been doing a lot of work on the standard library. So let’s dig right in an see what’s changed.
Standard library restructuring
Urn’s standard library has always been a bit of a mess, with features scattered everywhere. Whilst some chaos is inevitable due to having to bootstrap the library, there was still lots of improvement. Sadly, deciding on a good approach proved more complicated than expected.
For Urn 0.6 we finally went about this restructuring, splitting Urn into several modules such as core
(for
bootstrapping the stdlib), data
(data manipulation libraries) and test
(used for writing tests). It’s worth noting
that some programs may need changing to work with the new layout, but rest assured we won’t be changing it again any
time soon.
Extended math library
Lisp has always had a history of numerical computing, and Urn does not disappoint. 0.6 adds support for rationals, complex numbers, vectors and matrices. It’s now that much simpler to do your maths homework in Urn!
In order for these features to work fluidly together, we’ve added a collection of generic arithmetic methods, such as
n+
and n*
which operate on arbitrary data structures. These methods, along with rational literals, bring a lot to
the table.
> (import math/vector ())
> (n* (vector 1 2 3) 2/3)
out = [2/3 4/3 2/1]
String formatting changes
hydraz has done a lot of work on developing more powerful ways to format strings. Whilst string/format
is useful, it
can still be tedious to use. Thankfully the data/format
library accepts format strings which neatly integrate with
pretty printing, as well as allowing keyword arguments and interpolation of symbols in the current scope. I’d really
recommend checking out the documentation for more information.
> (format nil "0x{foo%x}" :foo 123)
out = "0x7b"
Internal changes
Whilst the obvious changes have occurred within the libraries, the compiler’s internals have also changed. Aside from improved codegen, line mappings are now substantially more accurate. Consequently code coverage and error messages are more informative - always a perk when debugging!