Xojo Can’t Math

Pop on over to Thom McGrath’s blog post about the ongoing saga of a 12 year old bug in the Xojo compiler. It’s an interesting, long, and complex issue that could affect your code if you use unsigned integers in your code. Admittedly, this bug may only affect a very small percentage of applications but it’s still a bug.

I think this saga exposes several things about Xojo. First, the way they use Feedback is fundamentally broken. For this particular bug they say it doesn’t affect many people because it has no points but because they’ve closed it the item won’t accumulate points. Voila! Nothing done about it in 12 years. Circular logic at its best.

Secondly, I truly believe that since they do not have a compiler engineer this bug won’t get fixed. Heck, most likely can’t get fixed because of lack of experienced personnel. Compilers are not simple things. I don’t buy for a second that Xojo has enough developers for the product they have.

The thread on the Xojo forums was long and contentious, and I don’t think Xojo did themselves any favors by arguing. While I appreciate Geoff talking to us in the forum it does kind of amplify the perception (reality?) that’s he’s not really listening.

I think I can say this with near 100% surety: We want Xojo to succeed. Many of us need Xojo to succeed for our careers and business.

Anyway, happy coding everyone!

XDC 2014: Compiler News

The Xojo Developer Conference keynote address is usually where a bunch of future items are put on display.  This year it was iOS and Xojo Cloud (the latter just being released).  But sometimes the sessions that the engineers lead are just as informative.  Sometimes it’s hints about future things and sometimes it’s an outright roadmap.

In Geoff’s keynote presentation we learned that the ARM compiler and LLVM backend compiler are real and if not perfect, mostly working.  Joe Strout stated that many things still had to be finalized but it’s a good sign that a significant amount of work has already been put into them and they are functional.

In Joe Ranieri’s ‘About the Xojo Compiler’ session we learned a lot about what a compiler does.  The frontend of the compiler includes the lexer, parser, semantic analyzer, and the intermediate representation (IR) generator.  The results then get passed into the backend of the compiler which has an optimizer and code generator.  That output then gets sent to the linker.  Very technical stuff but interesting.

He then went on to explain how the compiler described isn’t actually what’s in use today. The current compiler is designed to emit machine code quickly and merges a number of the compilation steps together.  Unfortunately this results in it not being reusable for other tasks like autocomplete and there being at least two to three other parsers in the product.  The current compiler also has poor error recovery and diagnostics, and, expects 32-bit integers.  Obviously the compiler needs to be updated.

The new compiler will be designed and implemented very much like what was described earlier, providing a base for future plans. With the first release, the new compiler will create 64-bit applications.  Some of this is waiting on framework work to make sure they are capable of using 64-bits.

The new compiler will be built using LLVM, which has has some great optimization passes but they’re pretty generic to work across a lot of languages.  It will also have additional optimization passes that are specific for Xojo (the language).  This means that some things will get huge speed gains such as direct calls into the framework, redundant reference counting, and direct access to arrays.

The new compiler will have better diagnostics.  Hopefully this will turn into better compiler error messages.  So hopefully this means we can get better information than a generic ‘syntax error.’

Finally, the new compiler will have native linkers.  Currently the compiler does not have native linkers for Linux and Windows which requires the loader stub to do some work that will sometimes trigger Anti-Virus warnings.

The new compiler is scheduled for the first quarter of 2015.  It will not be an immediate replacement and the end Xojo user will be able to switch between the two compilers as fringe cases are found.  All of this is not new to anyone that was around during REALbasic version 5.

All-in-all this is good news.  It’s a little disappointing that it’s going to be another 9 months to see the new compiler but as with all things I’d much rather it work well in version 1 than have it take 3 releases to be usable.

In my next post I’ll talk a little bit about what some of these changes *might* mean in the future.