Home · Posts
Open Sourcing Your World of Text
July 25, 2010

The source code to Your World of Text is now available. If you haven't heard of the site, you might want to read the description.

I launched Your World of Text about a year ago with an announcement on Hacker News. It jumped immediately from HN to 4chan, and out from there. For the next few days, I could track when it reached different countries by what language appeared most on the front page. The reception was very encouraging. I've seen a lot of creativity and beauty on the site; some day that might be another post.

These days there's an occasional spike of new traffic, but for the most part it's a steady stream of a few thousand visitors per day. Unfortunately, I can't give the site the attention it deserves. (I'm working on a new chat site.) Too many feedback emails have elicited a "Sorry...", so finally I've decided to open source the thing.

Part of me thinks releasing this code is strange, because I'm much happier with the idea and the having done it than with the code itself. The code feels almost like a byproduct. Which may all just be way of saying that I'd write a lot of it differently today. Anyway, if you're ready to dig in, you don't care about my excuses. Here's the lay of the land:

  • Your World of Text is plain Django. Put in your database settings and you should be able to run it locally right away.
  • The contents of a world are represented by 8x16 character Tile objects. These are created lazily.
  • Most of the code (and all the non-trivial stuff) is client-side, in yourworld.js. It uses the JavaScript Module Pattern.
  • The client simply polls the server for updates. This may not be optimal, but it has held up fine.
  • Extra features like links and protected tiles were added "at great expense and at the last minute". The code may reflect this.
  • Input is received via a hidden input field that always has focus. This technique is more robust than detecting keystrokes, and may be useful in other web applications.

If you want to get involved in Your World of Text, there are a ton of incremental improvements that could be made, and easy ways to to get started. Get in touch if you want suggestions. If, rather, you want to fork the project and go a new direction, here are some ideas: generalize the tile system; implement a client-side scripting language for a LOGO-like accessible programming environment; or make a collaborative brainstorming tool. Whatever it is, email me if I can help in any way.