18 July 2010

Obelisk

I've started a new programming language project: Obelisk.

Check out what I have so far at

Obelisk github repository

That is the place to go if you want to understand the syntax and semantics of Obelisk.

The rest of this post is to outline the reasons why it's going to work! Some may consider it a bit of a rant, but I assure you that I am not a crackpot!

Firstly, about my last programming language project, Delve. It petered out for a number of reasons:
I didn't have a proper lexer.
I wrote my own (buggy) parser.
I was trying to write a type-checker for a language where new methods can be added to an object, or an object can change its class, at any time.
I wrote the runtime in Haskell, which processed high-level bytecodes. It was very slow.
My approach was a rather chaotic, and I didn't produce very much documentation (thank you beer).

On the plus side, I did learn a lot about programming language design, and the process definitely improved my programming skills .

However, Obelisk is different!

Obelisk is a strongly typed, systems programming language. Obelisk is theoretically based on the lambda calculus, but has a class based object system to create its data types.

Well, it will be and have all these things; and it will work out this time! I know this because:

I have a solid lexer, based on Text.Parsec.Token

The parser is generated by happy, which also has the benefit of showing that the grammar is unambiguous. This is A Good Thing.

Obelisk's semantics are much simpler, so I already have a type-checker for non-polymorphic non-higher order (lower order?) functions.

I am writing the run-time in C, and initial tests indicate it should be quite fast. And because the semantics of Obelisk are again quite simple, I am able to adapt much material in The Dragon Book to suit its needs.

Also my approach is better:

I have divided development into iterations. An iteration is a phase of development where a large proportion of the code-base must be changed in order to support new features. For instance, I am not going to worry about classes and objects, until I have a full working system for compiling simple-functions. The latter will take place in iteration #1, the former in iteration #2.

I also have ~1500 words of documentation so far, in a html file. This doesn't sound like a lot, but since I'm only concerned with iteration #1 objectives (simple functions) there isn't so much needed. Still, it documents all scoping and type rules, and gives examples.

So aye, you might say that I'm rather a chufty at this juncture. That's about all for now. Look at the repository for more information!

No comments:

Post a Comment