Archive for March, 2009
March in summary
Wow, a lot happened last month. Since this term for school is coming to a close, the work involved is piling up. As such I haven’t really been able to get much done for my projects. In addition to that, I started an internship at the very end of the month. I’m working as a tester for weogeo. They run a “geographic data marketplace”, which allows people to buy and sell pretty much any information with locations attached to it. (like geological survey results and census data)
The game development project has pretty well stalled out. I’m realizing now that my decision to develop it in flash was partly motivated by a pie-in-the-sky dream of earning money from it. Now that I’m working, this isn’t really as pressing of a motivation and the problems of working with in flash are starting to outweigh the benefits.
My compiler project is coming along a bit better. I have a lexer, written in alex for JavaScript. It doesn’t support unicode in the identifiers, but that is more of the same from the compiler’s viewpoint. I’ve been playing around with an abstract syntax tree to use in the parsing phase. OOP implementations of this can take advantage of inheritance to encode things like “a bit operation is an and, or, or xor of two expressions” in an inheritance relationship and use that to ensure valid trees are created. Since Haskell doesn’t (easily) support this kind of inheritance, we instead have to flatten things out and do this with the functions that construct the AST instead of encoding it in the type of the AST. Well, that or write a giant pile of data type definitions to do the encoding manually, which produces a bunch of almost-redundant constructors and a lot of busywork.
I’m probably going to go the “flat AST and functions to ensure valid construction” route. Either way I’m planning to write the parser twice. One version will use happy (Haskell’s equivalent to yacc) and one using Parsec (a nifty parser combinator library). So, I’d like the AST to be easy to work with. We’ll see how that goes.
No comments