Archive

Archive for November, 2007

Screw that

November 30th, 2007

I’m no web designer. I’ll just keep the modified template that I have.

robin Uncategorized

Cosmetic changes in the works

November 29th, 2007

I think I am going to spend some time screwing around with the layout for my blog. Using someone else’s template is cool, but I like to write my own. Plus, it makes a good project, and I am always in need of another project.

robin Uncategorized

C compiler in the works

November 29th, 2007

As my many fans may know, I am doing an independent study next year for college credit, writing a C compiler for a CPU I have designed. I’ve basically decided on doing this in Java, and this largely because of the awesomeness of Eclipse. I suppose there are other languages for Eclipse, but the Java interface is just so slick it’s… well it’s good. Best IDE I’ve ever used.

Anyways, I was looking around today for parser plugins. Eclipse’s support for parser generators is not all that amazing. It has no support by default, and the CUPS/LEX plugin which I downloaded a while back doesn’t seem to work at all. Nothing for byaccj at all. Finally I found an ANTLR plugin, which I have yet to test but apparently is pretty decent, if I can judge by the screenshots.

I also went looking for a C grammar written in ANTLR, and found one. It’s rather big. I read through the whole thing, and I understand it, and I think that I will use it in the compiler. Of course I will have to give the author credit, but C is such an irregular language that writing a parse grammar for it myself would be hellish. (God forbid I try to write one for C++.) Of course, I suppose that’s the point of an independent study. But I’d rather spend my time learning things like code optimization. Just writing the code generation part itself is going to be a piece of work, because my CPU is so simple that doing anything with it is damn complicated. Things as simple as dereferencing a pointer require black-magic tricks like self-modifying code.

My strategy at this point is to have my compiler run in several phases, possibly with each distinct phase being a separate program. The first one will be the pre-processor, which will output pure C code. Next will be the parser/code generator, which will output code in a sort of transitional pseudo-instruction language. That will be fed to the optimizer, whose output will finally be translated from the pseudo-instructions into SISC instructions. If I am feeling particularly masochistic, I may try writing an optimizer for SISC instructions as well. But that sort of thing is a little bit crazy-talk, since optimizing self-modifying code sounds like a black art to me.

Of course, that’s just the compiler itself. I still need to write both an assembler and a linker, which requires devising an object file format. I’ll need to write a BIOS for the CPU too, so that programs can actually do something. They shouldn’t have to talk to the hardware directly.

In addition, in order to fully support C, I’ll have to include the standard C library. That one could/would/will be a bitch. I’m not sure that I will make it that far. In a pinch I might be able to take the GNU standard C library and compile it for SISC, but even that would require a lot of tweaking. After all, GNU libc is written to take advantage of a POSIX kernel API, and there’s no way in hell I’m going to write an entire kernel too. As such, I may skip out on the standard library. I’m in this to write a compiler, not an entire fucking operating system.

Good lord, this project is getting more and more complex the more I flesh out what is actually involved. I’m kind of glad that I’m already working on it, despite the fact that my independent study won’t officially start until next semester. I’m going to need all the time I can get. On the plus side, this means that I will have a project to do over winter break, which means I won’t have to deal with a month of idleness.

So yeah I found this grammar and that’s cool.

robin Uncategorized

More random

November 29th, 2007

I have decided to type an entire blog post with my eyes shut. So, here I am. I have my eyes shut, sitting in the Johnson Center. Hopefully I won’t hit the caps=lock by mistake, since that is my most common error. I think I can do it, though.

My plan is to type the entire thing, including the sequence which will post i.

So far, I have done just that.

robin Uncategorized

Utterly delicious new winter coat

November 29th, 2007

My mom ordered me a winter coat from LL Bean last week, and it came yesterday. It’s a pretty badass affair, and I am thoroughly enamored with it. It’s dark blue, goes down to my knees, and has a hood. The thing is quite thick, and made with Thinsulate. It’s warm as hell.

Part of me can’t wait for it to get cold as balls so that I can wear it. It’s that cool.

robin Uncategorized

ALSO I LIKE MAKING POINTLESS BLOG POSTS

November 29th, 2007

I WANT A NEW PHONE

November 29th, 2007

Maybe I will get one for Christmas.

robin Uncategorized

Solution to any software engineering problem

November 29th, 2007

Add more people.

robin Uncategorized

Got that stat test back

November 28th, 2007

Well, I dropped by my statistics teacher’s office this morning to pick up my test. Here’s the background info:

This was exam 2 of the semester, the next one being the final. After the teacher had graded it, he announced that the scores were so bad that he was giving us another test, a take-home one of the same difficulty, and was going to average the two scores together.

So, I saw him, and got my test. He said I did pretty well on it, but there wasn’t a total score written on it anywhere. He also explained how the test was being curved: Anyone who actually turned in the take-home test got a 100 on it. Sounds good, I thought. So a bit later I go through the test, adding up my score, which came to 53. Then I added up the possible score, which came to 52. Yeah, that’s right, I got better than 100% on the test that was apparently a classroom bomb. What’s more, that “curve” of averaging the test with a 100% will actually bring my grade down.

I’m pretty proud of myself. This semester is shaping up pretty well.

robin Uncategorized

Latest MSWM beta

November 27th, 2007

I’m using the latest Missing Sync for Windows Mobile 4.02 beta, beta 6. It adds support for the bluetooth sync, as well as overall stability improvements. I like it. It means that I can sync my PDA while I’m away from my desk again, which really comes in handy. Woo woo!

robin Uncategorized