From the SICP book, I took the cue to go write a processor.
Ok, I wrote a piece of code that has discreet modules for executing a machine-code of sorts. As I have written before, coders will need to think differently in the not too distant future, so I thought I'd write a little language that could support massive parallelization. The more I thought and experimented (with ANTLR mostly) I found that writing just the language with no real execution environment was hard, and really weird!
I was trying to create just the programmer's mental model with no real silicon support (I'm talking 100 processors, not just "quad core bibble inside" dung ding dung ding). So, the answer is a virtual machine! This way I have as much silicon support as I want (it's virtual silicon after all) and I have something to execute my code. One day, maybe there will be a real mega processor machine, but until that I can play with the ideas without the encumbrance of contemporary languages and libraries. I can also (to varying degrees I suspect) exploit the hard work that went into the libraries of that language I am writing my VM in.
I'm using Java for a number of reasons. I will just deal with performance first. I DON'T CARE! This is my playground. I'll deal with performance when it's an issue. I even reserve the right to re-write everything, because this incarnation is only to allow me to explore some ideas!
I'm using Java because I know it quite well. It's higher level than C, allowing me to think in bigger terms than malloc, pointers etc. It's supported on everything. It's not a crusty old lisp machine where everyone argues about continuation passing and nods sagely about first class functions but no-one ever acknowledges that the libs suck and the non-existent syntax (or sugar as some would call it) makes life just tedious. It's not C++ (thank god). It's not tied to a certain OS manufacturer. It doesn't have the syntax (half ton of aspratame I think) that Perl does. It's not experimental like Ruby, Python or [insert name-on-rails here]. It's not dead like Pascal (or Delphi - who was Borland trying to fool?), Smalltalk, Ada, Eiffel, ML (and random derivatives - Ocaml, anyone). The only thing not to like about Java is that it is the business solution of the day. That is to say, it solves many management issues (politics, time/cost, etc) but goes halfway to solving the technical ones (concise definition of 'what I mean').
Enough about Java - I'm writing the next erlang, so step 4 turned out to be "write a virtual machine". I think steps 1-3 were all "go round in circles until you're dizzy reading well regarded texts and coding totally insufficient things". (For those in the know, view manger was my first step). I think step 5 will be to revisit step 3 with the benefit of a VM (syntax and semantic definitions).
Thursday, October 04, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment