Thursday, April 21, 2011

Unfortunately, I haven't had a chance to start porting any of the OpenGL SuperBible classes to either Java or Clojure yet.  Hopefully now that I've got a long weekend, I can focus some on it.  Also, my priorities have shifted a little somewhat.

At my work, I've been tinkering with the possibility of using JBoss's netty project to implement some of the things we need to do.  As it so happens, my little game project will also need some networking capability.  For example, it must have the ability to let connected users chat in a room, and also to update "figures" on a map.  I also think it would be useful for getting updates on the software itself.

Netty, though a well documented project, also has a bit of a learning curve.  One of the things I'd like to be able to do is to launch a subprocess in Java, capture that process's stdout, and redirect it to a Netty channel.  Hopefully, I can do this in clojure.  This of course also means I need to build my own version of clojure.contrib.shell-out, since that doesn't seem to do exactly what I need (though I probably should take a look at the source).

In other words, there's a lot of stuff I need to do:


  1. Reimplement my own version of clojure.contrib.shell-out
  2. Create a netty based async IO system I can use for:
    • Chatting between players/GM
    • Launch subprocess and redirect stdout to the netty channel
    • Update figures on a map
    • Download updates to the project
  3. Create a subprocess launcher that I have access to the stdout
  4. Start wrapping the SuperBible libraries (probably straight to clojure via lwjgl)

I've actually begun updating the sojourner project again, though none of the bullet points listed above are anywhere close to done.  I also want to lay down a little general project planning for sojourner rather than just tackle things on the fly like I have been doing.  Having a roadmap helps enforce goals and you can see where you are heading and how much farther you have to go.


Saturday, April 9, 2011

Start porting some of OpenGL SuperBible classes to clojure

My hard copy book of The Joy of Clojure finally came in, and I feel reinvigorated to start programming in my spare time.  As I've been reading the SuperBible book, I realize that it is very much geared towards using its built in classes.  For example, it uses a GLShaderManager class to handle a lot of the shader programs, and it has its own library that deals with a lot of the math basics.

Since I want to do this in clojure, I'm going to have to port or at least heavily borrow from these C++ classes in order to use them.  It's also been about 2 months since I've touched any clojure code, and it's already gotten quite rusty.  For example, while reading through the Joy of Clojure book, I already forgot the differences between map, apply and reduce.  So I hopefully porting the C++ classes to clojure will be a good way to refreshen my clojure.

I'm still not sure what the best way to do this will be.  On one hand, it might be better to port it to Java first, and then make clojure wrappers around it.  If I do that, more people will be able to benefit from it, and I could also in theory use jython or Scala with it if I wanted (not that I know Scala that well).  On the other hand, I think that will not only be more work, there might be stuff lost in translation.  Just like how the Bible got corrupted by going from Aramaic to Latin to English, so too I think would going from C++ to Java to clojure.  That being said, I'll have to deal with Java at some level since I will be using lwjgl as my interface to OpenGL.

So starting today, I'll start work on this port in my sojourner project.  Which by the way, I've totally forgotten how to use leiningen with.  I started looking at cake, but its Windows support seems to be a little iffy, even though I dislike Windows.  Speaking of which, I might also throw Chakra on my main desktop, as its a more user-friendly version of Arch linux.  My other option is throwing Sabayon.  I really want to use a rolling-release style of linux rather than point release versions since upgrading almost inevitably winds up breaking something pretty badly.