GlassCalc 1.35


It has been far too long since I last updated GlassCalc. There’s a new version with some bug fixes. Check the GlassCalc page for download links.

This update fixes some bugs caused by GlassCalc applying exponential formatting to hexadecimal numbers containing “e”. It also fixes a formatting bug where a thousands separator would appear next to a negative sign (ex: -100 was displayed as - 100) and a syntax highlighting bug where a variable ending with the name of a constant would be highlighted partially as a variable and partially as a constant.

Also, here’s a status update on GlassCalc 2: I’ve decided that MTParser isn’t capable of all the things I would like to do with GlassCalc, and none of the free parser libraries I’ve encountered are either, so I am now writing my own parser (MTParser is excellent, but its existence as a COM component makes installing GlassCalc a pain and it doesn’t support lists or higher precision math). The primary goals of the new parser are:

  • Support all of the GlassCalc’s current syntax without tons of regex magic.
  • Allow for basing syntax highlighting off of the parsed expression instead of using even more regex magic.
  • Add support for lists (what you math people might call n-dimensional vectors) and possibly lists of lists (which could be used to perform matrix math).
  • Possibly add support for high-precision math.

So far, I have a system that tokenizes an expression character-by-character as you type it—that is, it splits the expression up into numbers, operators, symbols, and so on. The cool thing about doing this character-by-character is that by the time you hit Enter to evaluate, part of the parsing work is already done. In fact, I can use this already-finished part to speed up syntax highlighting and to show you the result of simple calculations before you even hit enter without reparsing every time you add a character. Of course, if you start messing with the middle of your expression, I have to reparse everything.

I am also experimenting with different GUI designs. I may post some mock-ups here later to see what you think.

Also, once I have made a little more progress, I’m going to put GlassCalc 2 up on Github. That’s right, GlassCalc 2 is going to be open source. The only thing keeping me from open-sourcing GlassCalc was figuring out what MTParser’s license would and wouldn’t let me do with regards to distributing MTParser’s source/binaries. Now that I’m not using MTParser, there aren’t any problems with going open source.