Monthly Archive for November, 2005Page 2 of 2

WANTED: Apple PowerBook

Well, OK, I think it’s time I made a post on the blog. Amazingly enough, there’s a reason I don’t keep my own blog up to date and thats that I never have anything to say worth putting the effort in to actually write down or type in.

Anyway, I’ve been eyeing up a Mac Laptop for a long time and with the new iteration of Apple Powerbooks all with Superdrives and somewhat cheaper (especially with Academic pricing) they seem all the more attractive.

I’ve had a tab open in Firefox for the last 3 days with the 15″ Powerbook on it, drooling when I switch on my computer at the sight of it! Academic pricing on that baby is $3675 incl. GST which for the specs really isn’t bad at all.

With my 21st birthday coming up and Mum wanting to buy a laptop at some stage I’m hoping I can sort out some kind of swapsies deal, I give her my PC (which has a list of problems I might address later) and she buys me a Powerbook for my 21st Birthday present. It’s a very tall ask, very, very! But it could quite possibly be one of the most uber presents of ever, everness… ever.

Anyway, back to my PC laptop. It was bought at the start of 2003 at The PC Company before it went bust later that year. It is noisy, the fan spins continuously, the screen brightness controls have a limited range, it clocks back when it is on battery power; with no option to make it run at full speed, the battery is now dead; the lower battery warning switches on as soon as I unplug it from the wall and it doesn’t have native USB2.0 support.

On the plus side, it is a Pentium 4, 2.4GHz processor, has a 40GB harddrive and 512MB RAM and tons of (read: 4) USB ports (USB1.1 only sadly).

I think I’d feel slightly bad for giving my Mum what I think is such a piece of crap but in all honesty it looks like the perfect machine for her, she wants something low profile that is a computer basically, this thing isn’t slow my any stretch of the imagination and plays DVD’s, burns CD’s etc so I guess it’ll be OK, except, it is pretty much useless as a portable laptop with a battery in that condition.

Either way, I’ve had altogether enough of using Windows and feel it time to move up in the world to a platform where Developers respect the User Interface Guidelines a little more and generally a more stable base and implementation of an Operating System. The whole UNIX backend is a huge drawcard for me as well, there are so many things I get annoyed with doing on Windows, sometimes I just want to do it the *nix way, like compiling an Open Source C++ program or timing the runtime of a process without 3rd party (probably GUI based) software.

Coroutines

I would like to support coroutines / generators in my virtual machine, even if I don’t decide to use them. I’ve heard that they are quite hard to implement. I’m planning on having a thread system anyway, coroutines seem just like an extension. I was thinking that a coroutine is a new thread that runs completely off a mutex of sorts, where the original thread doesn’t run until the coroutine ‘yeilds’ and the coroutine doesn’t run again until a thread calls it. While the resulting implementation might not use actual mutex’s (eg properly substitute threads) this sounds like a viable way to implement coroutines.

Sound like it will work? Something I’m missing? Should I be bothered anyway?

Added new plugins

I’ve just added all the plugins that this theme (K2) works with, except FlickrRSS (no real need - this is a multi person blog) and del.icio.us cached (same reason).

The additions are:

Should make this blog that much more interesting and useful without me actually writing anything.

BTW, write stuff people! This means you Alex.

VM design, fundamental choices

While thinking and playing with a few ideas, I realised that my parameter stack isn’t going to be very big. Because I was only planning on having push and pops (no direct access) there isn’t a way to use much more than is required to complete an expression (eg a = a + b - c). So this means I will be using local variables a lot more. The parameters passed to a function were going to be popped off and put into local variables so they can be used.

All this got me thinking that I could use a register based machine instead. I’ve heard that they are faster, and possibly a bit easier to program in the compiler. Either a register based vm, or a stack based one that can address offsets from the stack - so I can use it for temp variables and leave the parameters on it.

Another question that popped up concerns the variable stack. I was planning to be able to increase and decrease the section of the variable stack that the current funciton is using. This is good because a function will only use up as much variable stack space as needed when it calls other functions.

My first impression is to have it stack based with the ability to access offsets, and keep the dynamic sized local variable stack.

Another thing to think about is that I want to implement static-closure code block things - the ability to come back to sections of code within a function from other funcitons higher up on the stack. These bits of code can access and modify the local variables that are in the original function as well as have their own variables. Nested static-closures as well. I was planning on having independant local variable stacks in each ‘frame’. The closure uses the parameter stack normally (it’s a function in it’s own right) but uses the original function’s variable stack for it’s variables.