Writing compilers is such an interesting topic. For some reason I want to implement a version of BASIC that targets multiple architectures. Why? Why not!
Being a Java guy, some fishing around brought me to ANTLR a while ago and I was able to implement a simple expression interpreter that handles multiple data types. Rather neat, really.
I'd like to extend this into the realm of a full fledged compiler. Not only a compiler, but a multiheaded beast that targets the 6502 (read: Apple II+), 65c02 (read: enhanced Apple IIe), 65816 (read: Apple IIgs), Java bytecode (read: easy application testing), and possibly PIC 16/18 (read: microcontroller goodness). Not to mention that I want to design and build a 65c02 or 65816 based computer from scratch. Talk about crazy and I appear to be it!
At any rate, I started this concept a number of times in the past year. Each one stumbled and I got interested in something else.
This time, I am starting very, very simple and then adding the complicated pieces on. I intend to get a compiler that is just a portion of the language but one that is the full depth back to the code generation.
I've got a grammar for which I'm actually generating pseudo-code. The grammar consists of only two data types, expressions only for addition and subtraction, variables must be declared, and a print statement. This should allow me to deal with tracking variable types, throwing errors, generating output, structuring the AST, and how to write unit tests for it.
Now, I need to figure out better error handling and how to construct unit tests to do a better job of verifying any progress I make. I think I'm actually almost to the point of actually generating target code.
Hopefully I'll have good news to report in a few weeks!
Sunday, April 30, 2006
New bike!
Well, maybe the story is that I got a bike at all. My wife and I came home with new Bianche Volpe bikes for each of us. Per Murphy's Law, that means that it must be crappy weather all weekend, and it has been.
However, we did get out for 30 minutes at the local schoolyard. Since my wife and I have never had clips for our bike -- actually, we haven't "had" bikes for about 15 years -- we expected to fall a few times. Our intention in going to the schoolyard was to get our falls in somewhere close to home and (hopefully) in grass. I lucked out and didn't fall -- just a stumble more than anything. My wife, unfortunately fell onto not-so-soft concrete.
That was Saturday. All day today (Sunday) she has had a really screwed up shoulder. As in she gets stuck laying down or sitting and I have to run over and get her on her feet. Not to mention the constant pain she is in.
What fun!!
Lesson learned: Don't fall on concrete. :-/
However, we did get out for 30 minutes at the local schoolyard. Since my wife and I have never had clips for our bike -- actually, we haven't "had" bikes for about 15 years -- we expected to fall a few times. Our intention in going to the schoolyard was to get our falls in somewhere close to home and (hopefully) in grass. I lucked out and didn't fall -- just a stumble more than anything. My wife, unfortunately fell onto not-so-soft concrete.
That was Saturday. All day today (Sunday) she has had a really screwed up shoulder. As in she gets stuck laying down or sitting and I have to run over and get her on her feet. Not to mention the constant pain she is in.
What fun!!
Lesson learned: Don't fall on concrete. :-/
Monday, April 24, 2006
Zoomable picture from the Hubble...
This is really really cool. It's amazing whats "out there." Zoom in and then pan around a bit. There seem to be stars and galaxies everywhere.
Saturday, April 22, 2006
AppleCommander 1.3.4
Good news! I've gotten John to help with AppleCommander. He's made a number of patches to the code - both fixing my screwups as well as enhancements - which I have incorporated back into the project. Now he's a team member who can access the source code directly.
Plus, he works on the Macintosh, so he can make Mac OS X builds. I can continue to make Windows and Linux builds. That pretty much covers the entire world! (Yes, AppleCommander is written in Java, but we need to test on various platforms as well as package for those platforms. So it's write once, package a number of times.)
Ok, its more like a small village. But it's still pretty cool.
Plus, he works on the Macintosh, so he can make Mac OS X builds. I can continue to make Windows and Linux builds. That pretty much covers the entire world! (Yes, AppleCommander is written in Java, but we need to test on various platforms as well as package for those platforms. So it's write once, package a number of times.)
Ok, its more like a small village. But it's still pretty cool.
MediaMVP & MythTV
Well, I finally went ahead an purchased another MediaMVP. The intention is to have two MythTV stations hooked up - the existing on in the bedroom and now one in the greatroom.
Interesting thing is that Hauppauge updated to device. That's the good news.
The bad news is that the MediaMVP Media Center project has to extend their software to handle the booting. You see, my prior device booted via (what must be) mostly standard TFTP boot sequence. The new device doesn't. There's been some discussions about the revision just before mine, but nothing around mine. (I've got an H2 while the conversation was around the H1.)
Anyway, I chimed in and offered to act as a tester and general guinea pig. Not like I can do much else when it's network related! :-/
Interesting thing is that Hauppauge updated to device. That's the good news.
The bad news is that the MediaMVP Media Center project has to extend their software to handle the booting. You see, my prior device booted via (what must be) mostly standard TFTP boot sequence. The new device doesn't. There's been some discussions about the revision just before mine, but nothing around mine. (I've got an H2 while the conversation was around the H1.)
Anyway, I chimed in and offered to act as a tester and general guinea pig. Not like I can do much else when it's network related! :-/
Sunday, April 16, 2006
A little ray of sunshine
Just to let you know, all is not dreary. I just came back from a quick trip to the local school where my son practices his biking. As of yesterday, he is stopping and starting on his own (a little miracle in and of itself).
He's also discovered how to make black skid marks as well as the exclamation "Sweet!"
He's also discovered how to make black skid marks as well as the exclamation "Sweet!"
Followup
I had a good discussion with my mom yesterday on how to handle my co-worker. I have trouble calling this person a friend as friends (in my view) are not cruel and crass to each other. Not where it counts, anyway.
Another email arrived. One that started out with inaccurate statements and then went downhill from there.
To begin, I will concede that when asked about the gay rights sticker I have up at work, this discussion was launched which, in turn, lead to a discussion regarding crime. I now realize I was nieve expecting the discussion to remain on crime by my will alone.
What I intended to be a continued discussion regarding crime rates magically expanded into the presupposition that homosexuals are (by definition) sexual predators and hardened criminals. Not sure how that connects, but that's where it started.
I then was lectured on how bigotry has a closed mind.
It then progressed to the world has gone to hell because prayer in school has been banned. This was even backed up with charts (didn't give me the source and I'm sure I don't want to know). You know, the kind that go up and down and up and down. Somehow that up and down behavior is assumed to have been a downward trend. Until school prayer was banned, then the charts skyrocketed (meaning that bad things were going on).
In conclusion, I stand accused of being a non-Christian. Not sure where that comes from. I'm honestly not sure if that was simply an ad-hominem personal attack or if it was a wide-open attack on all Catholics. I suspect the latter.
My wife councils not responding. Unfortunately, that doesn't seem to work. My mother coucils being firm and telling my co-worker that I really don't appreciate hearing these views and having them forced upon me. That seems more logical. After all, I never asked for this.
What would Jesus do? I think He would forgive. I think, in time, I will too. At the moment, however, I really just want to cry.
Hate is such an ugly thing.
Another email arrived. One that started out with inaccurate statements and then went downhill from there.
To begin, I will concede that when asked about the gay rights sticker I have up at work, this discussion was launched which, in turn, lead to a discussion regarding crime. I now realize I was nieve expecting the discussion to remain on crime by my will alone.
What I intended to be a continued discussion regarding crime rates magically expanded into the presupposition that homosexuals are (by definition) sexual predators and hardened criminals. Not sure how that connects, but that's where it started.
I then was lectured on how bigotry has a closed mind.
It then progressed to the world has gone to hell because prayer in school has been banned. This was even backed up with charts (didn't give me the source and I'm sure I don't want to know). You know, the kind that go up and down and up and down. Somehow that up and down behavior is assumed to have been a downward trend. Until school prayer was banned, then the charts skyrocketed (meaning that bad things were going on).
In conclusion, I stand accused of being a non-Christian. Not sure where that comes from. I'm honestly not sure if that was simply an ad-hominem personal attack or if it was a wide-open attack on all Catholics. I suspect the latter.
My wife councils not responding. Unfortunately, that doesn't seem to work. My mother coucils being firm and telling my co-worker that I really don't appreciate hearing these views and having them forced upon me. That seems more logical. After all, I never asked for this.
What would Jesus do? I think He would forgive. I think, in time, I will too. At the moment, however, I really just want to cry.
Hate is such an ugly thing.
Thursday, April 13, 2006
Defend Science!
Most excellent!! Looks like people are finally starting to get enough of the religious right trying to take over our lives. As it should be, the scientists are leading the way. Read the statement and sign on!
http://www.defendscience.org/index.html
I've been fed up with this for a very long while and I'm sure my wife will be quite happy that I can vent a tiny bit without having to chew her ear off. :-)
[Oh great, I think I just got myself warmed up.]
I've got a friend at work who I think has recently converted into a religion. That's wonderful. Really! The clues are:
It's against this persons' philosophy that humans could have evolved. (We're too special. Isn't that a sin or something??)
I get little presents consisting of DVDs on how evolution is wrong and creationism is right. (Returned immediately - really pissed me off.)
Then I start getting various emails. The latest one talked about how the USA is a Christian nation and all our laws are derived from the Ten Commandments. (Uh-huh, why isn't adultery against the law?? Shouldn't they be stoned to death? Not to mention all the internal inconsistencies. I may yet do a post detailing this one.) Nothing like seeing the beginning of our own Taliban.
It's frustrating that people are so insecure with their religious beliefs that they need to attack anything that seems to disagree with them. It's also scary since anything they do is motivated by their belief that God told them to do it. Religion is powerful. But, like anything powerful, it can be misused.
And that's where we sit today.
http://www.defendscience.org/index.html
I've been fed up with this for a very long while and I'm sure my wife will be quite happy that I can vent a tiny bit without having to chew her ear off. :-)
[Oh great, I think I just got myself warmed up.]
I've got a friend at work who I think has recently converted into a religion. That's wonderful. Really! The clues are:
It's against this persons' philosophy that humans could have evolved. (We're too special. Isn't that a sin or something??)
I get little presents consisting of DVDs on how evolution is wrong and creationism is right. (Returned immediately - really pissed me off.)
Then I start getting various emails. The latest one talked about how the USA is a Christian nation and all our laws are derived from the Ten Commandments. (Uh-huh, why isn't adultery against the law?? Shouldn't they be stoned to death? Not to mention all the internal inconsistencies. I may yet do a post detailing this one.) Nothing like seeing the beginning of our own Taliban.
It's frustrating that people are so insecure with their religious beliefs that they need to attack anything that seems to disagree with them. It's also scary since anything they do is motivated by their belief that God told them to do it. Religion is powerful. But, like anything powerful, it can be misused.
And that's where we sit today.
Subscribe to:
Posts (Atom)
