0.6.0 Stable Release

Published April 16, 2011

0.6.0 represents an almost total rewrite of Luminous. It's quickly grown from a clean new repository on github with a giant flashing "DON'T USE THIS!" warning, to having now reached the maturity of a stable release. We pretty much threw away all the highlighting related code of 0.5.7 and reimplemented the missing chunks from scratch. The result is that 0.6.0 uses lexical scanners to highlight source code, which is actually a much simpler and more flexible approach than trying to abstract everything into one big generic state machine algorithm.

Download from Github: [zip] [tar.gz]

The change of approach makes Luminous *a lot* more powerful: languages are more complete and the scanners 'understand' source code better and are therefore much more resilient to strange or not-so-strange language constructs. Previously we had situations that were categorised into "we can do that", "we can sort of do that", "we can't do that". We now have a lot more of the first and a lot fewer of the latter. We're better at symbol disambiguation (Perl, Ruby, any language with regex literals), language switching (PHP/Ruby => HTML, HTML => JS/CSS, etc), complex nesting string interpolation (Ruby, Groovy), and so on.

Testing has also improved. One of the more interesting tests is a pseudo fuzz test which takes real source code, mutates it randomly, then runs it through Luminous. It checks for two things: 1) that Luminous actually halts (in a given time period), and 2) that the highlighted output (when highlighting tags are removed) is identical to the original input. This, as well as a straight fuzz test (i.e. entirely random input -- which hasn't caught nearly as many problems) has been run for *days*, which means we know Luminous is safe.

If you are upgrading, please be aware the calling API has changed. We used the rewrite as a chance to streamline it and get away from the ugly global settings and global functions. It's a purely syntatic change: everything is still there, the workflow is identical, you just need to call/set it in a slightly different way. Check out the Quick usage and User API reference on the main site.

There's also a new theme which looks something like this:


Here are some examples that have been generated in the last few weeks of development:

Diff: embedded highlighting

Perl: Quote-like, and nested delimiters

Ruby: Complex arbitrary-depth nesting interpolation

PHP: Large-ish source

Scala: XML literals also supported in ECMAScript derivatives (ActionScript and JavaScript)