<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A Lexical Mistake &#187; Gamedev</title>
	<atom:link href="http://alexicalmistake.com/category/gamedev/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexicalmistake.com</link>
	<description>Languages; Past, Present and Future</description>
	<lastBuildDate>Sun, 06 Sep 2009 22:00:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Pythonic Diversion</title>
		<link>http://alexicalmistake.com/2009/01/a-pythonic-diversion/</link>
		<comments>http://alexicalmistake.com/2009/01/a-pythonic-diversion/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 02:41:49 +0000</pubDate>
		<dc:creator>Lorenz Pretterhofer</dc:creator>
				<category><![CDATA[Gamedev]]></category>

		<guid isPermaLink="false">http://alexicalmistake.com/?p=162</guid>
		<description><![CDATA[This project is no longer in development.

With all this Haskell programming and a rather lengthy predicted alpha data for the Haskell game engine, I started to wonder about my last game development project. Actually, it&#8217;s probably more accurate to say, I was looking over the Secret Maryo Chronicles forums and remembered how much I wanted [...]]]></description>
			<content:encoded><![CDATA[<p><em style="color: #880000;">This project is no longer in development.</em></p>
<p><img src="http://alexicalmistake.com/wp-content/uploads/2009/01/smc-front-page.png" alt="smc-front-page" title="smc-front-page" width="250" height="137" class="alignright size-full wp-image-166" /><br />
With all this Haskell programming and a rather lengthy predicted alpha data for the Haskell game engine, I started to wonder about my last game development project. Actually, it&#8217;s probably more accurate to say, I was looking over the <a href="http://www.secretmaryo.org/">Secret Maryo Chronicles</a> forums and remembered how much I wanted to create a similar game, obviously with a somewhat different gameplay and tools.</p>
<p>See, this story goes further back to when I was still learning the basics of Haskell. I&#8217;d produced a simple game demo, but made no real progress in adapting that code base into something that would scale to a full game. That&#8217;s without considering the game specific tools either. My solution was to start a new project with the explicit goal of simply creating an actual game and level editor, based on the existing assets from Secret Maryo Chronicles placing the game under the same GPL license.</p>
<p>Since this isn&#8217;t the most graphic story from here, we&#8217;ll cut back to the present, which brings me to the first simple tech demo since I restarted the project. Its not much yet, just some code to test some basic view layout containers&#8212;the <a href="http://shoooes.net/tutorial/">Shoes</a> style stack and flow, although the larger design is inspired by <a href="http://blog.3plus4.org/2008/06/20/which-is-which-in-newspeak-ui-hopscotch/">Hopscotch</a> more than Shoes.</p>
<p>I should probably point out that the entire program runs on wxPython and OpenGL, but doesn&#8217;t use the wxWidgets controls, but rather a uses a simple custom framework designed for rendering directly in OpenGL. This is meant to simplify creating the in-game menus and since the editor will need to utilize many of the in-game graphics anyway, not to mention the level test functionality, it will probably help there too.</p>
<p>This demo doesn&#8217;t do much really, it&#8217;s just a simple stack and flow layout container test, with a few image views. Also, you&#8217;ll need the wxPython, PyOpenGL and the Python Image Library (PIL) for this one. There is a fallback library, but I haven&#8217;t fixed a minor image flip but in the usage of said library, so the images will appear upside down. The demo should appear similarly to the screenshot below. (I found I had to move the window to get the OpenGL view to start drawing. Since I&#8217;m not developing on Mac OS I didn&#8217;t realize until I grabbed the screenshot for this post itself.)</p>
<p><img src="http://alexicalmistake.com/wp-content/uploads/2009/01/screenshot2.png" alt="screenshot2" title="screenshot2" width="450" height="288" class="alignnone size-full wp-image-175" /></p>
<p>To checkout the simple view framework demo for yourself, simply run the following commands (or for the git users out there, its on the demo-view-framework-1 branch.)</p>
<pre>
git clone git://github.com/krysole/smc-ma.git smc-ma
cd smc-ma
git checkout demo-view-framework-1
</pre>
<p>Then running the command <code>python main.py</code> should start the code.</p>
<p>&#8211; Lorenz</p>
]]></content:encoded>
			<wfw:commentRss>http://alexicalmistake.com/2009/01/a-pythonic-diversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just a little bit of progress</title>
		<link>http://alexicalmistake.com/2009/01/just-a-little-bit-of-progress/</link>
		<comments>http://alexicalmistake.com/2009/01/just-a-little-bit-of-progress/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 10:52:07 +0000</pubDate>
		<dc:creator>Lorenz Pretterhofer</dc:creator>
				<category><![CDATA[Gamedev]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[Fire]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://alexicalmistake.com/?p=156</guid>
		<description><![CDATA[This project is no longer in development.
Well, its been somewhat slower going for the implementation of Fire lately. The interpreter I&#8217;m implementing is fairly simple, just an AST and direct interpretation of that, kind of like a Lisp meta-circular evaluator, but it has been surprisingly difficult to get around the complexity of the interpreter. I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p><em style="color: #880000;">This project is no longer in development.</em></p>
<p>Well, its been somewhat slower going for the implementation of Fire lately. The interpreter I&#8217;m implementing is fairly simple, just an AST and direct interpretation of that, kind of like a Lisp meta-circular evaluator, but it has been surprisingly difficult to get around the complexity of the interpreter. I&#8217;m starting to thing this project may take a little longer than I originally expected, but that&#8217;s OK, it&#8217;s still been quite a lot of fun so far.</p>
<p>The biggest hurdle I&#8217;ve stumbled on over the past couple of weeks is getting the actual interpreter doing anything at all. There&#8217;s plenty of code sitting in the modules, but none of it can actually work since I haven&#8217;t quite managed to finish the implementation based on the design in use.</p>
<p>So Fire is basically just a heavily modified Smalltalk (or Self.) Most of the semantics are the same, with the significant exclusion of directly modifiable variables&#8212;but even those are supplemented with transaction variables and more functional programming facilities. At least that&#8217;s the design of the language so far.</p>
<p>The problem is that Fire, like Smalltalk, uses strict evaluation and at least some of the methods may need to, <em>gasp</em>, perform IO! To actually implement something like this, I have to implement the strict evaluation using the IO monad, even if it&#8217;s only by composing monads (or similar.) The story doesn&#8217;t quite end there though.</p>
<p>Programmers can also define local methods within a method in Fire. These methods are part of the lexical context, and correlate to the respective extension to the  message send syntax. This means that the lexical context must be threaded through the evaluation of statement in a method.</p>
<p>Also, not all method calls return successfully. The return operator is also a variation of the normal return from a message send. The design of Fire here, calls for the usage of an Either return value, where the Left constructor provides a Fire exception object.</p>
<p>We would essentially like to hide the general flow using a monad for these two so that implementing methods for Fire in Haskell is as straight-forward as possible, not to mention the implementation of the interpreter itself.</p>
<p>So the decision I&#8217;m going with at the moment is to ignore any direct IO, which may eventually have to be reified back in later on, as well as transactions which should be a little simpler to put back in, and create a monad that captures both pieces of information. In theory, maybe it&#8217;s possible to implement this by combining monads&#8212;but the truth is, I&#8217;m just not that good yet. For that matter, this will be the first monad I&#8217;ve implemented (besides simple examples.)</p>
<p>Before I attempt the new design for the interpreter however, I also have another task I&#8217;m looking at which should be the topic of my next post. Testing Parsec parsers. All I&#8217;m going to say for now is that it involves QuickCheck, possibly because I haven&#8217;t actually finished writing the code yet. Until then, back to coding for me.</p>
<p>&#8211; Lorenz</p>
]]></content:encoded>
			<wfw:commentRss>http://alexicalmistake.com/2009/01/just-a-little-bit-of-progress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smalltalk and Fire</title>
		<link>http://alexicalmistake.com/2009/01/smalltalk-and-fire/</link>
		<comments>http://alexicalmistake.com/2009/01/smalltalk-and-fire/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 03:02:58 +0000</pubDate>
		<dc:creator>Lorenz Pretterhofer</dc:creator>
				<category><![CDATA[Gamedev]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[Fire]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Smalltalk]]></category>

		<guid isPermaLink="false">http://alexicalmistake.com/?p=117</guid>
		<description><![CDATA[This project is no longer in development.
Of all the programming languages I&#8217;m proficient in, not even Haskell is so curiously fun and exciting (in my mind) as the Smalltalk programming language. See the idea behind Smalltalk is deceptively simple, you have objects, which you send messages to. Those messages are handled by methods and finally, [...]]]></description>
			<content:encoded><![CDATA[<p><em style="color: #880000;">This project is no longer in development.</em></p>
<p>Of all the programming languages I&#8217;m proficient in, not even Haskell is so curiously fun and exciting (in my mind) as the Smalltalk programming language. See the idea behind Smalltalk is deceptively simple, you have objects, which you send messages to. Those messages are handled by methods and finally, both messages and objects may maintain and carry references to other objects. This may just sound like any other object-oriented programming language, but all of this happens at run-time, including the creation of those methods, objects and classes!</p>
<p>Given my affinity for computer games, it&#8217;s not surprising then, that I&#8217;ve been eyeing off the usage of some dialect of Smalltalk for programming computer games. Even the performance of Smalltalk is competitive compared to many other high level programming languages. Since most high level game code is easier to program with the increased flexibility scripting/dynamic languages provide Smalltalk has always seemed to me, to be a very attractive counterpart to a C/C++ engine.</p>
<p>The same principle could also be applied to the Lua programming language, which is extraordinarily popular in game development right now, which is more or less <em>designed</em> to be attached to an engine written in the standard engine languages, C and C++.</p>
<p>As I pointed out in my last post, originally I only intended to create a game engine in Haskell, which could then help when developing games or frameworks dealing with the high level game code. But to make this easier I decided to put the conventional game development wisdom to good use, and add to the mix a scripting language instead. Also relevant are Haskell&#8217;s concurrency capabilities which, I believe, are drawing the most attention from more mainstream game developers.</p>
<h3>A Counterpart To Haskell</h3>
<p>It might be interesting to note that, in the early design of Fire, the language wasn&#8217;t actually going to be based on Smalltalk or any language specifically, rather, I was working out some of the design points to help in taking advantage of Haskell&#8217;s concurrency and functional programming capabilities. Eventually I came up with a basic features list along the lines of object-oriented, semi-functional, highly concurrent and prototype based (class-less).</p>
<p>While collecting my thoughts and trying to understand which kinds of syntax would be appropriate I noticed that regardless of which syntax I used, the language would have to almost completely separate the concept of mutable state from the objects themselves, allowing only the use of transaction variables. While I could technically have gone with almost any syntax from there, it&#8217;s a pretty sure thing that regardless of the syntax used, Fire was going to be a somewhat unfamiliar thing to work with. This is where Smalltalk syntax lends itself, not being difficult to adapt and extend, while also known for being easy to learn and unusually expressive.</p>
<p>There were some issues to deal with however. To start with, Smalltalk syntax isn&#8217;t technically a full language syntax, but only provides the syntax for method definitions. By proxy, the construction of objects and message sends is achieved, with a fair bit of help from the development environment (UI). It also helps to point out that <em>image</em> based languages are notoriously difficult to bootstrap, while many game developers these days use text based VCS anyway, it was obvious I would first have to invent the missing syntax.</p>
<p>After (admittedly) more than a few attempts, and the larger part of a notebook full of musings and hypothetical example code, I finally had a complete syntax and at least most of the basic semantics in mind. The resulting syntax now includes a module level notation, an object literal notation, there is a simplified notation for creating lists and everything else is a consequence of sending messages, as expected.</p>
<h3>Difficulties</h3>
<p>There are some issues in combining any object-oriented language with functional programming or concurrency. To make things simpler, and because Fire is designed for game development anyway, I&#8217;ve kept the basic semantics imperative, or more succinctly the language still has the conventional IO semantics of Smalltalk. The main differences, at this point, are the lack of mutable variables within the language itself (beyond TVars) and the extensive use of threads (asynchronous messages).</p>
<p>To make working with transaction variables easier, Fire does provides <em>properties</em>, implemented as objects responding to a &#8216;get&#8217;/&#8217;set:&#8217; property protocol, and a property method syntax which maps a method pair (&#8217;var&#8217;/'var:&#8217;) to another object implementing the property protocol. Any object could theoretically be used here including IORef based objects, but that would generally risk concurrency issues and would probably be a bad idea. This is of course, alongside the usual method definition syntax, and a syntax for creating simply immutable variables, which is syntactic sugar for unary methods.</p>
<p>For those who have worked with Smalltalk, it&#8217;s immediately obvious that the main strength of the design has actually been lost however. That it, the main strength of Smalltalk has always been, at some level, the development environment itself. For those not familiar, the built in development tools allow any object, class or method to be reworked at any point while a program is running, even in the debugger. When developing an application, this level of flexibility is essential to the velocity a Smalltalk programmer can work at.</p>
<p>Such a development environment is probably going to be the most difficult thing to replicate in Fire, since both the UI frameworks as well as the tools themselves must be created from scratch. The VM will also likely require a way to allow programmers to ignore the immutability restrictions.</p>
<p>Luckily I do have something along the lines of a plan. What I believe will do the trick here is a simple dual mode VM, allowing (through the reflection layer) the modification of objects, while the finished games will use a release mode, preventing objects from being accidently scrambled. This solves both the development environment concerns, while keeping the language concurrency safe and hopefully simpler to integrate into the Haskell based engine. As as for the UI, I&#8217;ll get to that in a later post&#8230;</p>
<p>Clearly there&#8217;s a lot of stuff going on here, but for now, most of the work will focus on simply getting the spec written and the VM functioning. After then I can start moving only some of the details like the engine itself, and the libraries on either side of the language bridge. Actually, there&#8217;s the language bridge too, for that matter.</p>
<p>The purpose of this post is really just to give some idea of the reasoning behind a couple of the high level design choices used in Fire. There are plenty of other topics to consider yet, just at the language level, for example, prototypes systems are even more convention based than Smalltalk since the entire class system is replaced simply by methods for cloning and modifying the definition of objects. In any case, I think it should be interesting to see Smalltalk finally being applied to some serious game development, especially paired up to Haskell as well.</p>
<p>&#8211; Lorenz</p>
]]></content:encoded>
			<wfw:commentRss>http://alexicalmistake.com/2009/01/smalltalk-and-fire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Game Scripting Language (In Haskell)</title>
		<link>http://alexicalmistake.com/2008/12/a-game-scripting-language-in-haskell/</link>
		<comments>http://alexicalmistake.com/2008/12/a-game-scripting-language-in-haskell/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 08:21:29 +0000</pubDate>
		<dc:creator>Lorenz Pretterhofer</dc:creator>
				<category><![CDATA[Gamedev]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[Mention]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[Smalltalk]]></category>

		<guid isPermaLink="false">http://alexicalmistake.com/?p=88</guid>
		<description><![CDATA[Mention in this post refers to a different project than The Mention Programming Language based on Smalltalk. In fact, name was originally intended for a Smalltalk anyway and got reused twice privately before I was happy with the scope of the project (feasibility).
Also, this project was killed some time ago. I&#8217;ve moved onto other things [...]]]></description>
			<content:encoded><![CDATA[<p><em style="color: #880000;">Mention in this post refers to a different project than The Mention Programming Language based on Smalltalk. In fact, name was originally intended for a Smalltalk anyway and got reused twice privately before I was happy with the scope of the project (feasibility).</em></p>
<p><em style="color: #880000;">Also, this project was killed some time ago. I&#8217;ve moved onto other things and when I look into more Haskell programming I will not be resurrecting this project (I have some more practical ideas in mind).</em></p>
<p>In my last attempt at coding gamedev, Haskell style, I found my true enemy to be my inability to fathom the modeling of high level game objects in basic Haskell records. The problem was pretty simple, I&#8217;m either not yet good enough to figure out how to implement high level game objects in Haskell, or the task requires something closer to the Functional Reactive type frameworks. The same Functional Reactive Programming that I still, to this day, don&#8217;t really understand.</p>
<p>In theory I should probably just keep reading through my copy Real World Haskell, but I always like to have one gamedev project and one language that I&#8217;m working on. This doesn&#8217;t necessarily include any reading or minor experiments of course, but it does help to limit how thinly I spread my free time and it&#8217;s nice to keep the gamedev and language design cravings in check (plus, it&#8217;s kind-of a fun, strange kind of duo, really).</p>
<p>Since my Haskell game project was essentially killed a while back, that left me with some time to work on a some gamedev projects in Python. The premise was, high level language, good for modeling game objects and apparently a solid library lineup. Solid at least, until I realized that almost all of my games require one simple critical feature. Tools.</p>
<p>The odd reality of any serious game development is that, no matter how clever your game is, you still need the tools, in which all of the content is created and developing those tools is, in my experience, a very hardcore UI intensive process, which given the current state of UI frameworks in Python is well&#8230;not good. Actually, perhaps that&#8217;s not fair, GTK may have done the trick nicely, but by the time I&#8217;d figured out how much UI I felt was really necessary, it seemed like I shouldn&#8217;t have to develop yet more UI code for the in-game UI.</p>
<p>Oh&#8230; and the Mention programming language is on temporary hiatus due to the heavy usage of untested extensions to the lambda calculus and type theory. While I slowly learn the math skills involved in learning the type theory (not that there aren&#8217;t other benefits to be had from learning mathematics properly anyway), I figure its going to take me at least a year to get it fully on track again.</p>
<h3>Moving On&#8230;</h3>
<p>So now there I was&#8230; back in Haskell&#8230; the Mention language stalled&#8230; and no game development project in sight&#8230; So I came up with an idea. What if I put some of the ideas I had floating around, and put them all together as a game, a language, and something to keep me working through Haskell. I would be developing a game engine designed specifically to beat the crap out of Haskell&#8217;s concurrency&#8212;and my CPU too, I suppose&#8212;while I also designed a high level game object language to implement the actual, high level game stuff.</p>
<p>It wasn&#8217;t actually until I&#8217;d been working on the language for a couple of weeks, when I realized what I was actually trying to implement, however. This link should probably actually be old news to anyone interested in gamedev, but here it is anyway: Tim Sweeney&#8217;s POPL 2006 talk &#8220;The Next Mainstream Programming Language: A Game Developer&#8217;s Perspective&#8221; (<a href="http://www.cs.princeton.edu/~dpw/popl/06/Tim-POPL.ppt">PPT Slides</a>, <a href="http://www.scribd.com/doc/5687/The-Next-Mainstream-Programming-Language-A-Game-Developers-Perspective-by-Tim-Sweeney">Scribd Slides</a>, I couldn&#8217;t find the video of the talk again.)</p>
<p>In the talk, he covers quite a few of the practical qualities that a modern commercial game contain in lines of code, complexity, and so on, but the point that stuck with me the most was the section on Concurrency. I swear, it literally screams &#8220;HASKELL!,&#8221; and not just because Haskell is mentioned later on, either. What I didn&#8217;t realize at the time, was that I&#8217;d end up trying to pull off a solution to Sweeney&#8217;s challenge, rather than simply using Python or Ruby and keeping the games&#8230; non-concurrent (or semi-concurrent).</p>
<p><em>There is actually a little section on why he doesn&#8217;t like Haskell at the very end of the slides. I&#8217;d just like to point out (for those who don&#8217;t realize this) that they&#8217;re all mostly irrelevant concerns since they&#8217;re all solvable in about five-seconds-flat by anyone who has more than two months of experience with Haskell, or aren&#8217;t significant problems anyway (laziness is not a performance hog, and targeting GHC optimizations isn&#8217;t impossible, <em>et cetera</em>). Honestly, I actually think it&#8217;ll probably be the two months of experience that causes the most problems (i.e. the unpopularity), but that may not be as much of an issue either, as better learning materials emerge.</em></p>
<h3>Three Languages, for a Good Computer Game</h3>
<p>So I&#8217;ve mentioned Haskell, and alluded to a scripting language, and of course we also have our shader language. To start with, I&#8217;d like to point out that the shader language is only partially bound to the game language, and even then it&#8217;s an indirect link, courtesy of the abstraction layer that typically accompanies the rendering code&#8212;that&#8217;s engine side&#8212;thus, the shader language may either be a separate language project, or (as I&#8217;ll be using) a prepackaged solution like GLSL. Regardless, at the moment only the engine and the scripting language are important.</p>
<p>This brings us to the title of the post then, a game scripting language, and it&#8217;s a strange one too. The problem is actually not as simple as just dropping in any kind of scripting language. No, the engine is intended to push Haskell&#8217;s concurrency potential to the limit (even on tomorrow&#8217;s hardware), but for this to happen, the scripting language must not become a bottleneck in the process. Sounds simple, right&#8230; but what happens when you build a game that scales big, really big even&#8212;beyond Supreme Commander big&#8212;and now it&#8217;s the scripting language that&#8217;s trying to handle unreasonable amounts of data (in addition to the engine). I don&#8217;t want to force game programmers to rewrite high level game code back in Haskell, simple to make it fast enough, that&#8217;s the entire purpose of the scripting language.</p>
<p>The solution then is the same as in the engine, make it massively concurrent, just like that Tim Sweeney talk was implying. But, a presumably object-oriented language, with extreme concurrency can only really mean one thing&#8212;it has to be semi-functional, and support either the process-oriented approach (Erlang), or the same Software Transaction Memory as Haskell below it&#8212;I chose the latter.</p>
<h3>From Smalltalk, To Software Transactional Memory</h3>
<p>Given the requirement for a Software Transactional Memory, it might seem obvious to simply write a variant of OCaml or Lua, but my experience with Smalltalk demanded otherwise. I believe that the best design pattern for implementing games is the prototype pattern. There are only really a few languages that make this pattern the global design pattern for the language, and in my opinion, JavaScript isn&#8217;t really the language of choice for writing semi-functional code in.</p>
<p>What I&#8217;ve done then is to start from a basic Smalltalk messaging syntax (that&#8217;s about the only real syntax in Smalltalk anyway) and then extend it to a full, text only syntax, removing all of the class and inheritance features and lastly, removing the main source of side effects, mutable variables. The result is a semi-functional object-oriented programming language, exclusively applying Software Transactional Memory for mutable object state, and making heavy use of prototypes and delegation.</p>
<p>There&#8217;s actually quite a lot, going into the design of <em>Fire</em>, oh yeah, that&#8217;s the name of this little programming language, and it would be quite pointless to go into great detail, at the end of an already lengthy post. What I can promise however, is a complete language specification, for those who are interested in the precise definition of the language and core libraries. And for everyone else, I should be following up this post later with essays covering some of the challenges faced in the unusual design requirements of The Fire Programming Language.</p>
<p>Anyway, that&#8217;s basically the status update, or the plan at least. The Fire Programming Language does actually have a complete syntax already too, and the first draft of said syntax chapter in the spec is also almost complete. Any question or reservations about the project are more than welcome, either in the comments or by email, and lastly&#8230; This is a long term project, one which I suspect may take anywhere up to year or more, before it hits a 1.0. What I do expect though, is some alphas and betas ready within 6 months or so and I&#8217;ll be setting up some git (public) repositories over the next couple of months for anyone who wants to muck about with it or give feedback (and the spec will slowly appear on a pages section of this blog).</p>
<p>&#8211; Lorenz</p>
]]></content:encoded>
			<wfw:commentRss>http://alexicalmistake.com/2008/12/a-game-scripting-language-in-haskell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Language Design and Small Team Game Development</title>
		<link>http://alexicalmistake.com/2008/06/language-design-and-small-team-game-development/</link>
		<comments>http://alexicalmistake.com/2008/06/language-design-and-small-team-game-development/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 13:12:19 +0000</pubDate>
		<dc:creator>Lorenz Pretterhofer</dc:creator>
				<category><![CDATA[Gamedev]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[DSL]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[Object Oriented]]></category>

		<guid isPermaLink="false">http://krysole.net/2008/06/12/language-design-and-small-team-game-development/</guid>
		<description><![CDATA[I&#8217;ve been mulling over my old game development hobby for a little while now, and after messing around with Python a little I noticed that once again, there seems to be very little in the way of promising concurrent game object level languages floating around. At least languages that I&#8217;m aware of.
What I&#8217;m talking about [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been mulling over my old game development hobby for a little while now, and after messing around with Python a little I noticed that once again, there seems to be very little in the way of promising concurrent game object level languages floating around. At least languages that I&#8217;m aware of.</p>
<p>What I&#8217;m talking about exactly is game languages which allow the game objects themselves to participate in concurrent programming practices, without using intricate and complex locking sequences, or losing the right to talk directly to engine/library level services like physics or high-level game state (moving between the level and a menu for example).</p>
<p>Instead, almost all game level languages at the moment seem to be evangelizing the importance of being script level uncompiled beasts that require little to no real programming experience before becoming a productive member of the game code team!?</p>
<p>Of course I&#8217;m not saying that this is an inherently bad practice with the current level of technology floating around, but I do have to wonder whether this is still relevant for small team game development in the near multi-core parallelism future. Perhaps too far, but I think also relevant is the much slower pace of Open Source Game Development, which realistically speaking needs technology almost 3 years ahead of its time just to break even on an initial 1.0 release!</p>
<p>My question is actual reasonably simple despite the cynical tone up to this point&#8230; Can we realistically design a new object oriented DSL that contains the necessary concurrency techniques to allow programmers to write reliable and correct concurrent game code. This actually goes beyond just the engine code for which we&#8217;ve always been able to reasonably easily move to a more sophisticated language like Haskell but more towards the game specific stuff, which we cannot afford to bog down in complicated syntax and general side effect hostility.</p>
<p>I actually believe this is possible, and I&#8217;ve already begun planning the first steps towards writing some basic engine code that will underpin the project but I&#8217;m definitely more interested in seeing how effectively I can pin down the STM concurrency model into an object oriented syntax.</p>
<p>Ok&#8230; what about the language stuff&#8230;</p>
<p>I&#8217;ve actually been looking for a good excuse to both learn Haskell more fully (I&#8217;ve really only coded trivial examples in it so far), as well as properly exercise the Parsec combinator parser and finally, and perhaps most of all, design a new object model and object oriented programming language using that model.</p>
<p>The last, ironically may have to be restrained a little, but a concurrent perhaps slightly more conventional object oriented language may not be so bad. The point is that the project will involve a fairly comprehensive object oriented programming language, and one that is not only fully concurrency enabled but also tailored to game development tasks.</p>
<p>This is probably a good place to point out, that the conventional object oriented language I&#8217;m talking about here doesn&#8217;t include either C++, Java, Ruby or even the CLOS, but rather I&#8217;m talking specifically about the Smalltalk family of languages here. Its the work done on Smalltalk/Squeak, Self, Slate and more recently Newspeak that I find the most interesting, and the dialect I develop will likely incorporate many of the simpler innovations in the object systems they use.</p>
<p>The most critical issue that I&#8217;m aware of is the complexity added by the multi-dimensional objects used by most OO languages these days (including Smalltalk in this case). Rather than allowing the object state to exist in two (or more) dimensions I&#8217;ll be limiting them to a single flattened dimension similarly to record types, and the programmer will need to use either delegation/cooperation or composition in order to accomplish tasks in a reusable fashion. If you didn&#8217;t follow the dimension of state thing I&#8217;m actually just talking about Inheritance (another dimension might be Aspects, <em>et cetera</em>).</p>
<p>While I don&#8217;t want to go to much further into the syntax I would like to note that my intentions for this, apparently built in, concurrency will probably be in the form of an asynchronous send, paired with transaction support (which will actually be the only way to guarantee that data is written correctly). The asynchronous send, by definition, allows the receive to process it in a different thread&#8230; but since my little language is probably going to be more or less interpreted or at least green threaded, I&#8217;m pretty sure that I can just replace the async send operation as a plain old spawn operation.</p>
<p>The async message send in this case should provide a convenient way of signaling between game objects, and paired with the transactions (noting that very few Erlang processes don&#8217;t actively apply transactional semantics as well), I should have an effective way of implementing fully concurrent game code.</p>
<p>Well then&#8230; hopefully I don&#8217;t get killed between all of these projects and we&#8217;ll see something interesting come out of this stuff. Until then&#8230;</p>
<p>&#8211; Lorenz</p>
]]></content:encoded>
			<wfw:commentRss>http://alexicalmistake.com/2008/06/language-design-and-small-team-game-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
