Monday, 27 August 2012

Okay..

After doing a whole bunch of messing around in O'Caml I've come to the conclusion that getting a working environment for 2D/3D development is just too much like hard work.

I've since been evaluating RubyGame (which is nice), but not overly happy with the speed, although it's very rapid for developing.

I've also dug out BlitzMax - now I bought a license for this a few years ago and did a lot of tinkering in it. It's a dialect of Basic but is amazingly easy to get things moving about on screen and there are a ton of game related libraries for it. However, the puritan in me doesn't like the fact it's not a standard language and the fact it's commercial. It is cross platform though, which is a nice bonus.

As usual, I go round in circles trying to make a decision - but choosing the language and using something new is often more interesting to me than the end result!

Let's see where this goes.

Thursday, 9 August 2012

A flight simulator

Okay, I've been digging through my old books and lamenting the loss of a few I threw away due to running out of space. Of those I threw away a few years ago were these:


  • A book on 80286 assembly language - Oh, how powerful was that processor! Search as I might I can't find it anywhere, although I know I bought my copy from Farnell (well, actually my father did, which means I was early teens).
  • Ralf Brown's PC Interrupts - This was essential to any DOS coder, this was jam packed with data. But as a big book with no current use it had to go. Here is a pic below of the front cover

Anyway, enough reminiscing. I did have a point!

Anyway, where were we?

I came across this book while looking through the bookcase:



Now, this is intriguing, but it's hard going. It covers rendering all the way up to polygons on a pixel by pixel basis - there was no blitting or 3D graphics cards back then! Also, there is great swathes of C++ code, hugely verbose but undoubtedly extremely fast for the time.

So, I've been having some thoughts. I really fancy the idea of doing my own flight simulator, maybe using the book as inspiration and stimulation. I do actually rather like the idea of being retro and doing pixel blitting, Bresenham's algorithm et al.

I don't want to use some old style imperative language though, I want to use something modern and functional (preferably).

Language Choice


So, what languages could I choose and what are the pros and cons?

Language Positives Negatives
ClojureJVM libraries, Java2D, Concurrency, funPoor debugging, slow?
F#Great IDE, performance, syntaxMono VM is slow, IDE is Windows only
HaskellPerformance, native binaryIs a pure language a good idea for such a stateful project?
O'CamlPerformance, native binarySingle threaded
ScalaGood compiler, performance, Java2D, JVM libraries, very similar to original C++Too similar to the original C++?!!

Now, what about some more fun languages to do this in? Here are some scripting choices, although they do have a performance hit of course.

Language Positives Negatives
PythonPygame, librariesNot functional
RubyNice syntax, librariesNot functional

Now, if I want something quickly then I suspect Ruby is the way to go as I'm more familiar with the syntax than python (despite it being better supported for this sort of thing).

I think Haskell might be too much of a challenge, and I think Scala will be too easy. I'm also thinking that as it's effectively a 'game' type application that a natively compiled languages might be best - although I'm quite aware that both O'Caml and Haskell have a VM.

Okay, I've make a decision - O'Caml it is. It natively compiles, it's fast and I like the syntax. I'm not overly familiar with the libraries so it'll be a fun exercise. Also, it's a functional language but I can if I feel naughty use mutable variables (or even OO).