7.25.2006
4:56 AM

We don't have to talk about the Matrix. We could just talk about... stuff. Your favorite bands. Chicks who've broken your heart. The Matrix.

I just watched the 6-episode Clerks cartoon and I have to say I am mostly disappointed. However, I have succeeded in killing some braincells in the process, so yay for me!


7.23.2006
2:39 AM

Okay, so I've been putting some thought into encapsulation in Io. With a lack of namespaces, avoiding clutter and name collisions becomes fairly tough. For example, this does not work:

Math := Object clone do(
    PI := 3.14159265
    Circle := Object clone do(
        newSlot("radius")
        with := method(r,
            self clone setRadius(r)
        )
        area := method(
            PI * radius^2
        )
        circumference := method(
            2 * PI * radius
        )
    )
)

Math Circle with(5) area println
# Exception: Circle does not respond to 'PI'

Clearly there is a problem here. In 'area', I try to refer to PI, which resides in the same "namespace" as Circle. That's not how Io resolves names, though. It looks up names through an object's protos, and Math is simply not in there. So what we need to do is append Math to Circle's protos:

Math := Object clone
Math do(
    PI := 3.14159265
    Circle := Object clone appendProto(Math) do(
        newSlot("radius")
        with := method(r,
            self clone setRadius(r)
        )
        area := method(
            PI * radius^2
        )
        circumference := method(
            2 * PI * radius
        )
    )
)

Math Circle with(5) area println
# 78.539816

Yeah, that seems to work, but it is pretty clear that explicitly adding the namespace is a lot of repetition, if you have a lot of objects within the namespace, and you have to define the namespace over two lines so that it can refer back to itself. So I defined a new Namespace object that creates its own Object prototype. When a new Namespace is cloned, it defines a new Object and appends itself to its prototypes:

Namespace := Object clone do(
    init := method(
        self Object := Object clone appendProto(self)
    )
)

Fairly simple. Now, to make use of it:

Math := Namespace clone do(
    PI := 3.14159265
    Circle := Object clone do(
        newSlot("radius")
        with := method(r,
            self clone setRadius(r)
        )
        area := method(
            PI * radius^2
        )
        circumference := method(
            2 * PI * radius
        )
    )
)

Math Circle with(5) area println // 78.539816

There! Nice and clean. Happy Ioing!


7.22.2006
3:57 AM

For those of you who think that I had forgotten that I even had a blog, well, you were wrong! Ha! I hope none of you took out bets, because you're going to be pretty sore at me now.

If you've been wondering what I've been working on these past few days, well, simply: nothing at all! Truly. I can't download Visual Studio Express on my own, as it would take some 25 hours, and I don't ever have that much time, ever. Porting Io to Windows is going to require something much more inventive, and while I'm contemplating that, I'm afraid the project must take a break for something much more important.

On Phoenix Wings, baby.

This is a project that is so epicly important that I have been putting it off for years, just like doing important things with my life. It occurs to me that I must get on it or this horse will never fly.

Plus, my team is getting pretty restless.

In any case, I have been researching various platforms and languages, trying to find one that would be the most accessible to me, and the most practical for game development, and I have concluded that the .NET platform would give me a fairly good foothold, providing me with libraries such as OpenGl and DevIl, through the Tao Framework, without being too much of a hassle (as in, C).

Of course, once I decided on the platform, I had a number of languages to look at. Now, I do like Python, but it seems to me that IronPython won't leave me with the tools I need to create an effective project. That is, the only thing that is really available to me is #develop, and that only gives three options: C#, VB.NET, and Boo.

VB.NET was a definite out. So now I'm looking into using a combination of Boo and C# to create the game. Perfect! Now... what was that plotline again?

Of course, by perfect I mean: If you have any better ideas, leave me a note.


7.14.2006
5:52 AM

Now downloading ... it might be a couple days ... but if I can get Io to build in Visual Studio Express, maybe there is some hope for Io on Windows without cygwin. I'll put up some new cygwin builds up later tonight.


3:07 AM

7.13.2006
4:51 AM

Yeah, you heard me. I've finally made progress on building IoServer and IoDesktop (versions of the IoVM which have extra bindings to make them more useful). Now, not saying that they're perfect, but they are available. IoDesktop is also missing the Audio binding, so no audio support yet. This is a work in progress!

The latest cygwin builds of IoServer, IoDesktop, and IoVM will be packaged together here.

One of these days, I'll get it working right


7.12.2006
6:41 AM

You know how I blogged yesterday about why's little meta-programming trick in Ruby? Well, as it turns out, it is just as easy, if not easier, to do in Io.

Trial := Object clone do(
  runMe := method(
    self runMe = method(Exception raise("NO MORE."))
    writeln("Your trial period has ended.")     
  )
)

t := Trial clone
t.runMe #=> Your trial period has ended.
t.runMe #=> Exception: NO MORE.

I don't know why I had any doubts.


4:28 AM

EasyParser was my first project with Io. It was initially a port of the magnificient pyparsing library, but as the languages differ, so do the libraries.

Anyway, EasyParser.io is an alternative way to construct grammars and process text. Each element can be used as an insertion point to process tokens and produce objects within a parse tree, so that only a single pass is needed. Here's an example:

fourFn := EasyParser clone do(
    // Parse expressions
    number := charsIn(nums)
    
    +- := literal("+") or literal("-")
    */ := literal("*") or literal("/")
    
    lparen := literal("(") suppress
    rparen := literal(")") suppress

    expr := scout
    
    atom := number or(lparen and(expr) and(rparen))
    
    term := scout
    term is(atom and [(*/) and term])
    
    expr is(term and [(+-) and expr]) ignore(whitespace)

    main := stringStart and(expr) and(stringEnd)

    // Parse actions
    number onParse(tokens at(0) asNumber)
    
    term onParse(
        oper := tokens at(1)
        if(oper == "*",
            tokens at(0) * tokens at(2)
        ,
        if(oper == "/",
            tokens at(0) / tokens at(2)
        ,
            tokens at(0)
        ))
    )
    
    expr onParse(
        oper := tokens at(1)
        if(oper == "+",
            tokens at(0) + tokens at(2)
        ,
        if(oper == "-",
            tokens at(0) - tokens at(2)
        ,
            tokens at(0)
        ))
    )
)

This defines a simple four-function evaluator. Now, we can just:

fourFn parseString("41 + 1") at(0)               //=> 42
fourFn parseString("1 + 2 * (5 - 4) / 2") at(0)  //=> 2
fourFn parseString("10 * (4 + 2)") at(0)         //=> 60

I've set up a darcs repo on my http space over at leafo.net, so get the source at:

darcs get --partial http://paragon.leafo.net/easyparser/

And update with:

darcs pull http://paragon.leafo.net/easyparser/

A quick sidenote: I'm putting up a daily Windows build of Io, straight from darcs, right here. I'm pouring forth all efforts to get IoDesktop and IoServer running, but it's an uphill struggle. I'll update you as we get closer.


7.11.2006
4:26 PM

Expiring a method. And let’s keep meta out of this.
 class Trial
    def run_me
       def self.run_me; raise Exception, "NO MORE." end
       puts "Your trial period has ended." 
    end
 end

 t = Trial.new
 t.run_me
 #=> Your trial period has ended.
 t.run_me
 #=> (trial):3:in `run_me': NO MORE. (Exception)
The run_me overwrites itself. But notice it uses def self. This overwrites the method in the object, not in the class. So you can create more Trial objects which haven’t self-destructed yet.
why the lucky stiff

Now that is neat. When I get home later tonight (I'm on lunch break now, I've got about 5 minutes), I'm going to see how I can apply this technique to Io, if at all.

Ciao.


7.10.2006
6:23 AM

The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
Nathaniel Borenstein

I thought this was a perfectly great way to end a day of ... compiling.


5:18 AM

Look what I found today!

Prototype is a JavaScript framework that aims to ease development of dynamic web applications. Featuring a unique, easy-to-use toolkit for class-driven development and the nicest Ajax library around, Prototype is quickly becoming the codebase of choice for web application developers everywhere.
What I'm most interested in is how I'll be able to use it with Opera 9 Widgets. There are some pretty nice prizes available, after all. :)


7.09.2006
6:05 AM

The following is the work-in-progress "science" behind my game-in-planning On Phoenix Wings. It should fairly well explain itself, but I've been told it goes over peoples' heads.

The Divide
The universe is seperated into two distinct levels of existance: the physical and the spiritual. In a sense, they exist in the same space, but in regular circumstances do not interact. The spiritual realm is filled with wild energies and manifestations; the physical realm is where all the rocks, trees, water, stars, galaxies, and, of course, people, exist.

The Bridge
Between the two realms of existance exist the powers of the soul. Any entity within the physical realm may bear a soul, and in doing so, is granted life. A living being, therefore, is made up of a physical body, and a soul, which acts as a bridge to the spiritual realm. This grants three abilities.

Manifestation
The first of these abilities is the power of manifestation. The ensouled must simply believe in something strongly enough and a manifestation of said something is created within the spiritual world. Not only that, but collective beliefs build up the same manifestation, creating a powerful image of the belief within the spiritual world.

The Bearer
The second ability is the ability to transfer energy from the spiritual energy into oneself. A strong emotion such as fear, or love, for a spiritual manifestation created by belief will cause the boundaries between the physical and spiritual realms to weaken, the soul of the individual acting as a bridge. The stronger the belief, the more powerful the personal manifestation becomes. If belief disappears, the power disappates over a short period of time.

The Anchor
The final ability is the ability to transfer energy to another. If the ensouled believes that another physical entity is the physical manifestation of a spiritual force, then that being acts as an anchor in the physical realm for the spiritual force to manifest itself. If the Anchor is ensouled, then it may harness the powers of the spiritual force, as a Bearer. Often, this power is far greater than that of a Bearer, as the effects of the believers is cumulative. Again, as with personal power transferance, if the belief disappears, the power will disappate over a short period of time.

The Heir
If an Anchor without a soul is destroyed, then a rift in the physical space where it existed appears, and the pent up spiritual energy flows freely until another entity claims it. If an ensouled can inherit the energy before it disappates, they may use that power to inspire fear or love in order to become an Anchor themselves. One ensouled may inherit many powers and believers at one time.

God
There exists a belief among many people in a transendant God, one that exists outside of the physical realm, and therefore has no physical manifestation. God is believed to be omniscient, omnipotent, but imperceivable. It is believed that He will not manifest Himself until the supposed End of Days. It is concievable, therefore, that one could become God by inheriting and combining the spiritual energies neccessary to gain those abilities, and then causing a cataclysm so disastrous that it is thought to be the End of Days, and then portray yourself as the manifestation of God. Since there is a massive belief in God, He does exist within the spiritual realm, and the ensouled in question will become His Anchor, and harness powers beyond comprehension.


7.08.2006
5:47 AM

Ah, Windows. I know we've been together a long time, but... I really want to program, and you really make it so very hard. Please go die. I'll even give you a proper funeral.

In less depressing news, I have compiled the latest IoVM tarball. Also, I've picked up a pocket reference for C, and I'll soon start hacking at the Io source. Of course, I hate C. I'm only doing this for the good of my favorite little language that could.


7.07.2006
6:27 AM

... content? Never! Hi. Welcome to splattercoding. To give you a quick rundown of my intentions, splattercoding is a place for me to put random smatterings of code (of dubious usefulness) and musings on programming, and the world in general. Hopefully someone will read it and inspire me to continue talking to myself.

Doubtful.

Still, I needed a place to post my thoughts so that they are not lost forever. Who knows? Maybe they'll actually be needed?

Doubtful.

I suppose I should tell you a bit about myself as a programmer. I like dynamic languages. Python, Ruby ... and most recently, Io. I program as a hobby (or, if you prefer, addiction). Probably some sort of psychological need for control or something. Whatever. Now, I'd give you some examples of my work but they're over on the other side of the room and I simply don't have the energy right now. We'll get to those later.

So! my first posted endeavour into the coding world: creating a template for splattercoding. It is a modern, minimalistic design inspired by Steve Dekorte's blog. After wrestling with the intricacies of the templating language (darn those opening and closing tags), and possibly 100's of "Preview"s, I came up with what you see now. Pretty neat, huh?

Until next time.