Loci v1.4 Released

The latest version of the Loci compiler is now available. See the release notes for detailed information about what’s included.

The main feature in this release is a brand new compiler diagnostics system with a rewritten lexer and parser. Here’s an example of errors from the old compiler:

And here’s how it looks with the new diagnostics system:

This release is therefore an enormous improvement in the usability of the compiler and the cause of errors/warnings should be very clear to the user.

atoi() vs std::stringstream

I was recently asked to compare the functionality of atoi() and std::stringstream.

Here’s the code:

And here’s the output:

So it looks like the functionality of both is actually very similar (though note std::stringstream has many ways to modify its behaviour); unfortunately it seems the stream doesn’t set the result to zero when given an empty string.