Tao of the Machine

Programming, Python, my projects, card games, books, music, Zoids, bettas, manga, cool stuff, and whatever comes to mind.


1. Writing a scanner and a parser is really a lot easier in Python. (As opposed to C, C++ or Pascal, for example.)

2. Still, it's a pain in the neck. (At least I think so. ;-)

3. Generating a parse tree is easy too, without having to worry about memory management.

Maybe Python is an ideal language for learning this kind of stuff. I bought a book on writing compilers and interpreters last year, but it uses C++ examples, and I have great difficulty seeing through all the red tape and gobbledygook, even when the code examples illustrate concepts that really aren't that complex. Sigh. (I also have an older edition of the Dragon Book that uses Fortran, of all languages. :-)

Of course, one could object, that Python may be a suitable language for writing toy parsers and homework exercises, but it's not suitable for a "real world" parser (compiler, interpreter). Maybe not right now, but give it time. Ten years ago, I wouldn't have thought of using an interpreted language for serious purposes. These days, I'm using Python almost every day, both professionally and for pet projects. Fast forward ten years... maybe computers will be so fast that writing an interpreter (or compiler) in an interpreted language may actually be fast enough. Heck, people may even be writing emulators in Python. Who knows.

6502 emulator in Python, anyone? :-)

2003.04.27. Update. Seems somebody already wrote a 6502 cross assembler in Python.

Posted by Hans Nowak on 2003-04-18 19:16:04   {link}
Categories: Python

Poker night

It seems the "Iraq Most Wanted" playing cards have reached Ebay. Get 'em while they're hot... :-)

Posted by Hans Nowak on 2003-04-15 15:33:36   {link}
Categories: general


Anybody has an example of how to use Twisted for a peer-to-peer chat program?

What I have in mind is this: The same program can be used initially to "listen" (server) or to "connect" (client), and after a connection has been established, they are equal peers that can both send and receive the same commands.

I do not want a full-fledged chat system (like IM or IRC whatever), because this will only be the basis for the game that I have in mind. It's some kind of board game, where the same protocol will be used to send text (chat) or commands (game moves).

I started with the sample echo client and server, hoping that I could somehow change them into different protocols, but no success so far. Now if anybody would read this blog, I might be able to get some interesting comments or replies. Alas... :)

Posted by Hans Nowak on 2003-04-14 23:09:46   {link}
Categories: Python

Monkey Island 4

I'm currently playing this game for the Playstation 2. I didn't like the 3D and the controls when playing it on the PC, but somehow it feels different on the PS2 (even though it's roughly the same game!). A 3D game "feels right" to me on a modern console; it "feels wrong" to me on a PC, where I like only a few 3D games. And, being an old schooler, I feel that an adventure should be text or point & click; it certainly shouldn't look like Quake.

So, yes, you don't point and click anymore; rather, you run around like in a 3D shooter or PS2 RPG, and when you encounter an object or person, some text appears at the bottom of the screen. The main PS2 buttons let you examine, pick up, and use an object. Inventory is used with the L2 button. It seems strange at first, but you get used to it.

That said, I have been enjoying this adventure a lot. Some puzzles are hard, but there are good hints to be found on the Net. :) Some of them are very clever, though, and can be figured out with some thinking, whether lateral or logical. The solution of how to stop the guy from shooting boulders at your house was great, for example. (Spoiler: attach the rubber band to his "calibration cactus". Then get him to take a snack break, so you can mess with the catapult's controls. He has to do a "calibration shot", shoots at the cactus, and...)

The humor is funny at times, but it's also a bit over the top. I mean, it gets a bit old if every single thing Guybrush says (in his irritating Eminem-like voice) has to be a joke or a pun. The original Monkey Island was funny too, but suffered less from this.

I still think LucasArts should do a version of Loom for the PS2...

Posted by Hans Nowak on 2003-04-13 22:58:38   {link}
Categories: games

Phenotype's Zoids site

This page has some interesting Zoids stuff.

Posted by Hans Nowak on 2003-04-12 22:56:40   {link}
Categories: Zoids

Generated by Firedrop2.