Friday, October 17, 2014
Rawr. One of those days
So today, I decided it was finally time to man up and embark on the quest to fix a very mysterious error in LTSL compilation. For quite some time, I've been experiencing a rather scary thing: about 1 in every 40 or 50 LTSL script compilations would fail. Programmers typically live in fear of these kinds of errors -- the kind where the same thing works
almost all of the time but will fail every once in a while. Generally, in my experience, these problems either come down to threading issues or memory initialization issues. These are the only two places (at least that I have experienced) where we regularly see indeterminism (the exact same code with the exact same inputs executes in a different way). Since LTSL compilation is not multithreaded, one would deduce that the problem lies in memory initialization.
The issue, however, brings up a bigger one: that the compiler needs better error reporting. During normal coding, it's fine to see "expression (blah blah blah) failed to compile" and the few other errors that the compiler generates, because I know that I've made a mistake and I'm familiar enough with the language to be able to fix it quickly. But when I see "expression (blah blah blah) failed to compile" and I
know that (blah blah blah) is actually a correct expression...that's when I really need more information. In general, the compiler needs to not only say
what failed, but also explain
why.
This led me back through augmentation of all the compiler code to add optional error outputting. This means that when something fails to compile, the compiler can flip a switch to turn on error reporting, and then re-run the compilation to generate a detailed picture of what went wrong. Doing so took...quite some time.
Here's the good news: the LTSL compiler is now a thorough error reporter

The other good news is that, thanks to this, I know exactly
where and
how the compilation is failing on these strange 1-in-50 problematic runs. The bad news? Well, I haven't actually had enough time yet to dive in and
fix what's failing (I only just got the detailed error reporting working).
I imagine, since I now have all the right information, I will be blowing out the candle on this error within the next few hours

Yes, a bit of an annoying distraction from our content push, but nonetheless something that absolutely must be fixed before release

I'm anxious to get back to the 'fun' devlogs as well
PS ~ If you're wondering whether I still think LTSL was 'worth the trouble,' given the dev time + debug time...my answer would still be an unequivocal, resounding "YES!!!"
PPS ~ A strange idea for 'unified math' using neural computation popped into my head today. Yet another reason why I'm anxious to wrap up LT -- it's getting hard to ignore all the other ideas that my work is spawning
