Author Archive

Comet for the Non-Web Programmer

Wednesday, July 16th, 2008

the revolution
Orbited 0.5 enables a software developer to create robust, performant network applications for the web. If you know one of the common web frameworks, or are already comfortable writing PHP, for example, just download the Orbited client for your preferred language and you’re good to go. However, if you’ve never done any web work before, or are fed up with the traditional approach, you can just bypass the HTTP hacks altogether and instead write your internet application the way folks have been writing network software since the 70s - with a socket.

(more…)

Your pyevent Worries Are Over

Sunday, February 17th, 2008

One of the most frequent problems people have with Orbited generally surfaces before they write a single line of application logic — before, in fact, they successfully start the Orbited server for the first time. This problem is pyevent. It’s a brilliant piece of software, but many of us want to build small projects or simply prototype without having to install two sets of additional headers and gcc.

To most of you, I’m sure this doesn’t sound like a great hardship. Comet developers, however, are not most of anything. We’re strange people and we often work under strange conditions. My house loses its internet connection every few minutes; other developers are subject to the irrational decrees of their admins, or the arcane limitations of their indie operating systems. People have literally decided not to use Orbited because they couldn’t compile pyevent properly. We’re modern folks, and the rule is: make it work for everyone.

(more…)

Nobody Does It Better (than Jacob)

Monday, July 16th, 2007

So Jacob loves WebIRC. Seriously, he can’t get enough. I think we’re going to have an intervention soon.

The server’s going strong without any major changes since I wrote it two long months ago. In fact, today is WebIRC’s two-month birthday, and someone didn’t send a card. Anyway, it’s about as stable as you can get. I had a computer connected for 52 hours before it crashed for unrelated reasons. Seriously, it does that all the time, I need to reformat. In fact, 52 hours might be the longest it’s gone without crashing lately.

Jacob’s really been doing some exciting things with the application, taking it in a direction I never really considered. He’s simplifying it, for starters, stripping away all the functionality that seemed cool 15 years ago but just confuses people used to Google Talk. He’s developing it into something that should debut in the next month or so on Orbited.org: a very small (in pixels), lightweight little marvel that you can just stick in the corner of any old website. That’s just plain awesome.

Ok, if you really miss it that much, the old WebIRC will run here for a while.

Color Me 1991

Thursday, June 7th, 2007

The fellow who gave me the WebIRC idea recently brought to my attention the shocking truth: WebIRC is NOT in color. Well, was not. I was bummed for a little while, and when I got home I wasted some time trying to write an easy fix (hah!), but then God spoke to me. I said: “GO FORTH AND TYPE ‘MIRC COLOR JAVASCRIPT’ INTO GOOGLE.” The first hit, mirc_colorize.js, by my hero, Chris Chabot, happened to save the day. One line, folks, and WebIRC assaulted my eyes with all the colors of the mIRC.

Then I took a nap.

WebIRC

Wednesday, May 16th, 2007

Is that a good name? I think so. We’ll see, I guess. So Twisted worked beyond my wildest dreams for the MUD. Anyway, a few days ago I was showing it off and a friend of mine mentioned an IRC MUD that he had written as a kid. We got to talking about how much we all owe to IRC, and, determined not to allow the bread and butter of our childhood to go the way of parachute pants, I decided to jam IRC into the wide world of the world wide web.

How, you ask? Well, Twisted has at least one IRC library. A string here, a thread there, and ta-da!, we’ve stitched together Twisted IRC, Twisted Orbited, and my very own Twisted HTTP library.

The Twisted libraries and the IRC server itself do 90% of the work, server-side, and the rest behaves exactly like the MUD. The server, through Orbited, sends a JSON list of the form [data_type,data] (’data’ is generally a list, itself), and the iframe passes it to the javascript.

In other words, I did no work at all on this project.

So it’s basically a fully-functional IRC client (baaaaaaasically), and all it can really use is a fresh paint job. I hear there are a few AJAX libraries with some very pretty paint. Any volunteers?

Oh, here is the project.

MUD (!)

Thursday, April 26th, 2007

So we just released 0.1.1, which means you guys all get to play with the toys we’ve been working on. You’ve seen the first Orbited chat demonstration. Now here’s the first Orbited game (brought to you by the new iframe transport)!

I know you better than you think. You had your 10th birthday party at a library because you didn’t get internet access until middle school. When you got there, the librarian wouldn’t even let you play because it was peak library season. And now, you relive the shame five days a week because your boss won’t let you install zMUD on the company computer.

But you’re reading this in a web browser, right? Well, dust off your vorpal sword and join the dozens already exploring this monument to the 90’s.

This was surprisingly easy to implement, and you will soon see that I have very little ’splainin to do. Here’s how it works:

You have

  • http.py
  • game.py, where all the objects in the game live
  • a few short files with very human-readable information about the world
  • app.py

app.py is a very simple animal. Besides a world clock and a couple functions for handling basic game mechanics, app.py doesn’t really have anything but connect() and msg(), which listen to http.py, which in turn takes orders from the browser. But isn’t it time the browser listened to me, for a change?

Downstream messages are sent out by the objects in game.py and delivered by Orbited to the iframe, which signals an event that is processed in the game’s javascript.

But the developer doesn’t need to know anything about orbit, or, really, the iframe. She only needs to know four things:

  1. <iframe id=”events” style=”display:none;”></iframe> goes in websitename.html
  2. the browser connects to and updates the server with XMLHTTPRequests
  3. the server generates Orbit events
  4. the application magically updates itself

Go forth brave adventurer, full speed ahead, you’re welcome.

UPDATE 6-6-2007

0.1.3 auto-wraps events, so the server code is further simplified! And the game will be running here for a while.

Twisted HTTP Servers Oh My!

Monday, April 23rd, 2007

So lately I’ve been hearing a lot of hype about Twisted. Twisted is event based. Twisted is fast. Twisted does every single thing in the universe.

I recently started working on a secret Orbited project with a generous helping of Twisted, which practically wrote the bulk of it for me.

This time yesterday, I sat here with a (rather skeletal) backend that seemed to do what it was told. This was encouraging, but I knew that it was all pointless without a web interface. I mean, web integration is the whole point of Orbited.

The problem at this point was a little strange: there were multiple Twisted HTTP libraries, they were too comprehensive, too featured, too big, and I was too tired to figure it out. Maybe I was burned out on the Twisted API, perhaps I was even a little crazy at this point, but I didn’t want anything to do with IResource and leaf nodes, and I decided that it would be easier to just write my own HTTP server.

This, of course, isn’t to say Twisted abandoned me in my hour of need. I mean, really, most of http.py IS Twisted (including Twisted’s famous Protocol and ServerFactory). But it’s exactly what I needed, something simple: the status line, the headers, the form, and a way to write your response. All it does is call your App().dispatch(request) function and provide headers and a response object.

More on the secret Orbited project coming soon…

Hello Internet

Wednesday, March 28th, 2007

Hi everyone. I’m joining the Orbited development team, which means you’ll be seeing a lot of me around here. For those readers of the Orbited blog who haven’t heard of Orbited, it’s basically what we all wanted for Christmas when we were kids trying to figure out sockets. Obviously, my first act as an Orbited developer will be to implement everything my mother never gave me fifteen years ago. Stay tuned.