Archive for the 'Just programming' Category

Forth brain injections for free

Sunday, June 22nd, 2008

The X Factor album coverImage via WikipediaForth is “a little” different than you everyday programming language. Basically it’s different on so many levels. If you ever wondered what it’s like, but didn’t have time or a reason to invest to get/learn/do-enought-to-get-the-feel it — now internets offer you a free ticket to get a taste of it.

Samuel from Falvotech made a video where he coded a HTML parser in gForth, he seems a very fluent Forth programmer and it’s a joy to watch him code (to me at least):

Click here for article and here for the video

I do some coding in Factor which is one of incarnations of Forth but it’s still different in many ways and was always interested how his raw-metal father Forth is. This video was super interesting to me. The core rules are very known to me as it’s the same as in Factor so I could easily follow it, I hope it will be approximately the same for you.

I hope you won’t focus only on “uh how low level is this” and “what crazy stuff is he doing with return stack?” (in few positions of the video) and so miss some things that are pure beauty of the concepts here (like what concatenation brings you). Well, your loss if you do..

— HIGHLY OT —

Hehe, this is above AI, this is AT (Artificial Transcendence).. I just installed the new Zemanta plugin, I am listening to Iron Maiden while writing this article and mentioned it no-where in it and it proposed me picture of Iron Maiden (that you see upthere) in suggestions.

Well it’s even worse, this is future look-up and self inducing prophecy by the plug-in. I was listening to the iron maiden and not mentioning them, it proposed the pic to me, now I did mention them so the picture has a logical place to be in this article and global order is restored once again. I am impressed by the new version guys ;)

Zemanta Pixie

No-login user authentication

Tuesday, June 17th, 2008

I am making some portal. It is a sort of the portal where people will need to register and fill in some info. They have to have an option to login at any later date and modify their info but this will not be like everyday or even every month thing. It seems stupid to me that people have to create and remember a new username/password for every utility that they need limited access to very rarely then.

So I am making some variant of user authentication system for them that doesn’t use usernames or password. The point is that it’s much more minimal to make and use than the standard hog of stuff you have to do to make a usable user authentication system.

So what elements does normal system need:

  • verification email with a link and functionality to accept verification
  • login (username/password) form and functionality
  • forgot password link, form and functionality
  • change password form and functionality
  • logout link

This no-login system is basically like a one-time-password system where it is not limited to one-time, because it would be impractical and it has no reason to be.

So how does it work: When you register to the web-app you receive an email. In it there is a link, you click it and you are “logined” into the web-app. When you need that web-app user area again you open the email and click it again (or you bookmark it, or whatever). But you can delete (loose) the email at any time and when you need access again you go to web-app and fill in your email into “get me a new key” form and you receive another link on email that you can use as long as you want and then delete too (if you want).

So what elements does this system need:

  • sending out email with the link - 80% the same for the first time (registration) and for all “get me new key” times
  • “get me new key” form and functionality
  • logout link

you don’t need verification via email - because the email with the key link is also a verification of their email
you don’t need login form and functionality - obviously
you don’t need forgot password link, form and functionality - because you are meant to forget it and you use “get me new key” anyway
you don’t need change password form and functionality - because there is no password

So it has some pluses, but I will see how it performs in real. If you see any weaknesses go ahead and tell me!

Ask Robi new screenie

Tuesday, May 27th, 2008

This is the new screen-shot of Ask Robi. Now I need to get a new VPS so I can install it there and give it to few beta testers to trash it a little.

ask robi

If anyone wants to be a beta tester write me to janko DOT itm AT gmail DOT com.

btw: Ask Robi is not a chatbot. I made a chatbot years ago and in my oppinion they are basically usseles. This is more like a sort of wikipedia that communicates.

Many ways to skin a FAt CaT OR …

Sunday, April 27th, 2008

Some people go to church on Sundays and some find time to divulge to the non-urgent ie. play with Factor a little. Well, I am not playing, I started making something concrete in Factor. Something that was cooking in my head for 6 whole years, and if no one made it in this time I might just step out and do it.

Well the concept is still not fully cooked, but I decided it’s time to stop boiling it and put it out on a pan and burn it a little and see what we get. So today I made few more words and a bunch of unit tests for it. Ok, so I am coding a very concrete thing in Factor for the first time. I like when I see that the Forth philosophy about re-FACTORing (yeah, hence the name I think) words to smaller and smaller independent words showed it’s beauty.

My main words with very rich functionality basically needed very very little stack shuffling ( just a dup, swap or over here and there - and I didn’t use cleave combinators) but then I came to one very simple utility word that because of few specifics used them noticeably more.

It was no problem to write but because Factor is so versatile I was sure there are other more elegant solutions. So I pasted that word on Factor’s paste and asked on IRC and so far I have 4 solutions that used very different concepts each, so I think it’s an interesting example of Factor.

This is my original, made in the “primitive” way with just stack shuffling… The code takes assoc. array, extracts/processes few values from it and leaves 3 values on stack. Basically very simple unimportant stuff…

: unpack-answer-to-me ( array -- type_subj answer id )
    "type" over at "subject" pick at " " prepend append
    "answer" pick at
    "id" roll at ;

#! Example of use..
{ { "type" "typ" } { "subject" "subj" } { "id" 12 } { "answer" "ans" } }
unpack-answer-to-me .s
! returns
"typ subj"
"ans"
12

Itvar on IRC came to this solution, he used locals. I think it’s much more readable than mine..

:: unpack-answer-to-me ( array -- type_subj answer id )
  "type" array at
  "subject" array at " " prepend append
  "answer" array at
  "id" array at ;

Then Itvar made a word using the new cleave combinators. Cleave combinators are new “invention” (I think) in stack based world and I didn’t see them in action until this. This code looks very good to me and nicely reflects the logical structure of code.. The cleave stuff is that bi and tri

: rev-at swap at ;

: cleave-unpack-answer ( array -- type_subj answer id )
  [ [ "type" rev-at ] [ "subject" rev-at ] bi " " prepend append ]
  [ "answer" rev-at ]
  [ "id" rev-at ] tri ;

Before Itvar showed this code I was thinking that I could make some sort of “extract” combinator myself that could be useful in all such cases. I made modify-values combinator before and really liked what it allowed. Well it was too interesting to-not-do it so I made it and this is the usage..

: unpack-answer-to-me ( array -- type_subj answer id )
    { { { "type" "subject" } [ " " prepend append ] }
      { { "answer" } [ ] }
      { { "id" } [ ] }
    } extract-values+ ;

Well I am biased and I don’t know Factor well yet, but I like this solution the most :) . Cleave is cool too. I will post the code for this and some other combinators soon-ish. This post is getting too long already.

update

johnnowak , a guy who is making his own stack based language Fifth (5th — website should be coming soon) came up with yet another solution. I like this one because it creates/uses 2 very general purpose and useful combinators to get a very straightforward solution.

: 2dip -rot 2slip ;

: extract swap [ at ] curry each ;

: unpack-extract
  { "type" "subject" "answer" "id" } extract
  [ " " prepend append ] 2dip
;

Here is more readable formatted code for all 5 examples.

FotoLOAD mini will get released

Friday, April 25th, 2008

Finally, I am about to release FotoLOAD mini. I had the app almost ready for months, my sister made the website design now and it looks that the thing will get out of the house in the next week or so. Website is still not totally finished but here it is..

www.fotoloadstudio.com


screenshotThe page and app is in Slovene language for now, but it is already being translated to English and some other languages. It’s an application that photo-studios can use to offer their customers fast and simple way to upload photos for printing. I made such web-app for one studio like 7 years ago (with PHP and REBOL), I later made better one for another studio few years back, but this solution is made for “them all” and brings big improvements to the previous two. FotoLOAD mini is a mini and is somewhat limited but also free. There is also a non-mini which won’t be free :) , but I think it will still be very accessible.

So if you have (or know anyone who has) a photo studio, test it out and tell me what you think. English version will be out before fifth may also.

NullCMS - my first webdev test in Factor

Sunday, April 20th, 2008

I didn’t have real time to further experiment with Factor for the last month or more. I only took one Sunday weeks back and wrote a really mini mini CMS like thing to see my still very crude and young web-dev Factor libs in action for the first time.

Factor has it’s own webdev framework/libraries (and you should check it out), but I am experimenting a little here so I am making a sort of lower level and minimalistic libraries of my own. I don’t have time to install a VPS with Factor currently so I just made a quick video of it and posted the code at Factor’s paste. Here is the video..

And here is the Factor code + HTML templates.

It consists of roughly 27 lines of Factor code, 14 lines of HTML template code and 19 lines of JavaScript. For a cms to be somewhat useful I would need to add some user authentication also. Basically you can display, create, edit and delete pages and you get a flat menu for navigating them.

Mini tour to IMSGY

Tuesday, April 15th, 2008

My almost 2 year old son is sick with a fewer so he is just trying to sleep but wakes up every few minutes coughing. Really depressing when your kid is sick and anything you do doesn’t really help him much… For few hours I was staring in the air in minutes when he sleeps but now I got of my ass and wrote these slides to tell somethin more concrete about ex. tinyIMS that I mentioned yesterday and which I now named IMSGY. It’s all WIP..

You are getting boring with all that Python (2/3)

Saturday, April 12th, 2008

Not awesome

OK, so why do I think python is nice but not the most awesome language there is.

I can not make in-browser (flash) games with python like I can for example in Haxe (swf).

I can not make cpu intensive games with it like I can for example in Java or Processing (like this). And these games can still run in a browser via applets, even with openGL if you are lucky.

I can use wxPython to make desktop apps, positive is that they have native GUI, negative is that I have to program in a dirty low level of a c++ to do it. You even look at c++ wxWidgets API docs to program python (at least few years back you did). Swing (yes from “horrible clumsy Java” that gets compared to py a lot) is the most advanced and elegant GUI thing I have ever seen for example. So at the end, I don’t want to use python to do GUI apps.

Python as a language is nice, but I would like something like OCaml with some added elegance 150x more, I want more FP power, I want revolutionary progressive/aggressive languages… like Lua, OCaml, Factor and Haxe/nekoML/neko-vm or clojure.. Guido guides python on too safe paths IMHO..

OKeyish

I will probably use python for not cpu intense casual games via pycap. Rabbyt and pyglet are also cool but only for non casual games (no DX) where I usually have different needs for cpu or if I don’t I do them in haxe to get flash deployment option too.

Python has a very nice set of 3d engines (Panda3d, pythonOgre, irrlich binding…) and if I was making something 3d and light on the cpu I could use it. ( Well, a big competitor for this use case for me is Luxinia with lua which I played with a lot and like it a lot ) but python still is strong in light 3d.

I might use it for web-apps also. I think there has some very good points compared to scripting relatives (php, ruby, perl..), it’s quite faster and I wouldn’t use Java for web-apps because I have a feeling it imposes to much structure for a web-app. But all these langs would loose my focus immediately if something like OCaml would have a good low level web server base to build upon. Currently my favorite here is Factor but I am in experimental phase with it.

I will write one more post about this.

You are getting boring with all that Python (1/x)

Saturday, April 12th, 2008

Serial Computer PortImage via Wikipedia I quite like python. I used python as a first language for 2 years couple of years back.

I made a relatively complex web-app in it (using Zope, back then there were no Django’s and likes). Kids could create accounts and then create their relatively free-form multi-page websites and similar stuff.. it was sort of myspace before myspace… Later I rewrote the app in php because after I got 3000 daily users I had to reset the server every few days and getting into that ZODB mentality to fix and upgrade things was beginning to get hard for me.

I made 2 relatively complex GUI business apps in it (with wxPython), first was a complete program for managing a “snail” shop (not e-shop) and selling in it. As an interesting tidbit, python talked via serial port directly to that small printer to print recipes which was cool :) .

Another was more graphical and was used to graphically manage an industrial warehouse of stacked boxes and shelved packs and you would put boxes apart, take 2 packs and put the rest on XY shelf.. basically you simulated actions on a pc, got a “action recipe” and someone would then do it in real so you could then always know what pack is on which shelf or box and how many there are by looking at your computer.

Both apps still run today, the first one on multiple shops.

I also used python for millions of small things and everyday hacking and learning (from pygame to twisted matrix, pyAIML, medusa server, xmlrpc, panda3d, pyOGRE …)

For example I am sure I made the first AIML bot that could talk in slovene language (Robotek ROBI). I used pyAIML and made a custom XML server with Twisted that would talk to the flash front end. I stopped running it because I had to switch webhost and the new one didn’t let me run a custom python server and I basically didn’t like the AIML concept (back then there were no $5 VPS options like there are now, at least I didn’t know for them).

I will continue this topic as I haven’t really got to what I wanted to say at all. By “you” I mean all the python fans on reddit and everywhere else… Python is nice and I would use it in a lot of cases but I don’t see it as order of magnitudes different or better than most other solutions or the best choice for most of the use cases.

Hello worlders vs. Factorialers

Wednesday, April 2nd, 2008

A selection of programming language textbooks on a shelf. Levels and colors adjusted in the GIMP.Image from WikipediaIt struck me today. There are basically just two kinds of programming languages and programmers in the world..

The first one can make output without even blinking but complex algorithms don’t smell to good to it..

The second one elegantly calculates complex sequences of useless numbers but you will need a degree if you want to print them out..

OK, there is a group of languages that bite the big chunk of elegance from the second with the careless (power) of first one.

To me a evolution towards more functional coding came by itself by just writing a lot of code and slowly progressing my imperative based coding style (before I even knew what FP is).

As a quick example of FP-ish solution vs. the Imperativ-ish. I was writing some AS3 code yesterday and I figured out that AS3 is less FP-ish than the very similar Haxe language that I am more used to.

Haxe..

function sayHi(name:String)
{
    return "Hi" if (name != "") " " + name else "";
}

It hurt me but in AS3 I had to do it “yer olde” way

function sayHi(name:String)
{
    var t = "Hi";
    if (name != '') t += " " + name;
    return t;
}

It’s not about lines of code. It’s about that in haxe I made simple “direct” expression. In AS3 I had to make some state, then modify it if certain case is true and then return it.

This solution is so ugly for this very simple problem that I am not sure if I didn’t miss some better way to do it imperatively too.

itmchat is on code.google now

Monday, March 17th, 2008

Source: WikipediaI finally committed itmchat sources to the google code. The whole thing is a work in progress. I rewrote a lot of it so that it has more features and will be easier to extend in future. Right now I am testing and debugging it. I would like to stabilize it and put it online so this version gets tested in real too. Then I intend to add some new features and then clean it up and optimise it.

The 0.01 version is running on some portal for few months now and hadn’t had any problems so far. I wasn’t in the name-making mood when I was opening the Google code project so the name is a little stupid, but who cares.

Itmchat is written in Haxe (server, flash client) and some javascript(JS client) and uses Haxe remoting for all comunication.

Factor & shit, I am that naive sucker

Friday, March 14th, 2008

Factor gets a lot of bashing at reddit. That is not that bad because traction always produces more energy and output than a soapy you are OK, I am OK, we are all OK stuff.

Few days back certain Factor non-fan amongst many other things wrote:

Because such Forth-like untyped languages have been around for decades and I was using them around 1990. Adapting the concept to 2008 may be fun for you and help you suck in a few naive developers but it doesn’t make it a serious platform; read up a little

While people on factor’s irc channel look highly educated programmers to me I recognised myself in this. Not that I am proud, but reality is I am sort of naive developer and I did get sucked into Factor. I am not formally educated as a programmer. I am more like the guy who once jumped into the river and managed not to sink, and then just stayed there, gradually improving his swimming, but never took time to learn the official butterfly stroke because he was too busy catching the fish.

Well I am “naive developer” in some way but I am also very pragmatic because the “useful working maintainable output” vs. the “sh*t that went into making it” is the only thing that matters to me at the end. I don’t code to learn, I learn to code.

And that’s why I now think that Factor will be my web-dev tool? Because I have tested and got very good results with 3 sides of web-development so far:

As my first Factor lines of code I tried to see how I could extract some data out of text. This simple and small vocab is what I came up with, and was amazed by cleanness and obviousness. So I see that making nice vocabularies that will help me parse strings will reall NOT be a problem with factor.

"i:1;name:Jon;age:3;surname:Wu;;i:2;name:Jill;age:9;surname:Huan;;"
      "i:2" cut-to "name:" cut-off ";" snatch-to
      "surname:" cut-off ";" get-to .s
! "Jill"
! "Huan"

So factor can read, but can it generate? Next, I wanted to se how I can generate SQL, this came out so far:

: get-users ( -- )
   SELECT*
      "users" FROM
      "enabled = 1" WHERE
      "username" ORDER get-rows ;

get-users
! SELECT *  FROM users
! WHERE enabled = 1  ORDER BY username ;

: get-users-of-group+ ( orderby group fields -- )
   SELECT
      "users" FROM
      swap "enabled = 1 AND group = ##" ##1' WHERE
      swap ORDER ;

"email" 51 "email, username" get-users-of-group+
! SELECT email, username  FROM users
! WHERE enabled = 1 AND group = 51  ORDER BY email ;

: change-email ( id email -- )
   "users" UPDATE
      "email = ##" ##1' SET
      swap WHERE-id exec ;

123 "j@a.com" change-email
! UPDATE users  SET email = 'j@a.com'
! WHERE id = 123 ;

Then I tried to make the XHTML forms generating vocabulary:

: show_user-form ( -- )
   "post" "./user" start-form
      "your info" start-fieldset
         "Email" label (*) endlbl
            "email" "" "class='big'" text-input endrow
         "Name" label  endlbl
            "name" "" "size='12'" text-input endrow
         no-label endlbl
            "action_add-user" "Save" "" submit-input endrow
      end-fieldset
   end-form show! ;

The code creates the first form on this page.

Any part of my web-dev toolkit I tried to create in Factor so far was better looking than the ones I had developed in other languages. That’s why I will continue with Factor. I know and used only the “primitive” stuff of Factor until now so I am excited to see what’s ahead.

My current state of language stuff and why should you care

Saturday, March 8th, 2008

Source: ShutterstockJava : I liked Java but some of my love for all c++/java like languages is gone now. I see the elegance and power in some different paradigms now. If I would have to do a GUI, CAD like thing again I would still use it. I still love Swing, Piccolo and some other things about it. I am not sure if I will make the WATERISK game in it as I said previously.

Factor : I am 90% sure I will use it as my default web-dev platform. I am building core webdev utilities when I have some spare time.

OCaml : I Tried to find a use for it in web-dev but after looking at things decided not to. I will continue to learn it and write another GL/SDL tutorial (but not tomorrow) or just try to make WATERISK in it.

PHP : Will continue using it for webdev where clients request it or where deployment is very important.

Haxe : Will continue to use it for swf (flash games) development. I hope to work on and release open source chat server written with it soon.

Lua : Will probably use it for a 3d project made in Luxinia engine. I would really love to, but a chance is I will cave to the f****** business senses and use Adobe Director just because of in-browser deployment.

Flex, AS3 : I have a very concrete project with Flex that will start ASAP. First time using it.

Erlang : After OCaml I was looking at Erlang for webdev (mochiweb, erlyweb, jaws). After a lot of consideration I decided I will not for now.

Clojure : I want to dip my fingers into Lisp family of languages and this one seems most intriguing to me (rich data structures, concurency, JVM). Maybe it could substitute some cases where I used java before. LWJGL, JOGL, Swing come to play… maybe some web stuff, who knows..

And why should you care?
you really should not, did you just read all this?

(edit: zemantified… cool)

MySQL+PHP vs XSLT mini rumble

Friday, February 29th, 2008

I use XML+XSLT instead of MySQL+PHP on 2 of my websites. For some reason I always imagined XSLT is fast. Yesterday I added something made with X+X combination to QUBIDRAW also so I decided to do a small comparison because my “is fast” assumption was based on.. well, nothing.

I made two scripts called tablepush that pushes some tabular data and shape it into html table. One script uses basic mysql functions and then php to do the html shaping:

<?php
$link = mysql_connect('localhost:3307', 'root', 'rootp');

mysql_select_db('mlvsx');

$query = 'SELECT * FROM '.$_GET['data'];
$result = mysql_query($query);

echo "<table>";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
    echo "<tr>";
    foreach ($line as $k => $col_value) {
		$tag = '';
		if ($k == 1) $tag = 'strong';
		else if ($k == 2) $tag = 'em';

		$t1 = ''; $t2 = '';
		if ($tag) {
			$t1 = "<$tag>";
			$t2 = "</$tag>";
		}

        echo "<td>{$t1}{$col_value}{$t2}</td>";
    }
    echo "</tr>";
}
echo "</table>";

mysql_free_result($result);
mysql_close($link);
?>

The other loads XML and uses XSLT to turn it to html table:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="html" encoding="iso-8859-1" indent="no"/>

	<xsl:template match="things">
		<table>
		<xsl:apply-templates />
		</table>
	</xsl:template> 	

	<xsl:template match="thing">
		<tr>
			<td><xsl:value-of select="@id" /></td>
			<xsl:apply-templates />
		</tr>
	</xsl:template> 	

	<xsl:template match="aaa"><td><strong><xsl:value-of select="." /></strong></td></xsl:template>
	<xsl:template match="bbb"><td><em><xsl:value-of select="." /></em></td></xsl:template>
	<xsl:template match="ccc"><td><xsl:value-of select="." /></td></xsl:template> 	

</xsl:stylesheet>

Results using http_load to do the load test on my local (older) computer are :

Table with 3 rows

my-php : 25 requests / sec
X-X : 49 requests / sec

Table with 50 rows

my-php : 21 requests / sec
X-X : 39 requests / sec

Table with 350 rows

my-php : 11 requests / sec
X-X : 13 requests / sec

So it seems XSLT is quite fast. I will keep using it for the cases where it makes sense (like a lot of discrete data with known and non-frequent relations). It’s funny to me that XSLT is in a way quirky and hackish and yet elegant. you can find complete sources and data to do the test here: LAMP XSLT .

It would be interesting to test some other platforms too…

Functional programming & immutable objects explained — IRC style

Saturday, February 23rd, 2008

I was on #ocaml channel on irc.freenode.org. (btw - freenode hosts channels for a lot of popular languages and technologies). This was a while back when I started making OCaml SDL examples that you can find on this blog. I think this short IRC chat told me more about FP than anything I read before.

<middayc-> when I read about FP I read that things should be immutable and that there should be little state or side effects… but if I am making a game I need states all around the place … a trivial example, I need an x,y and velocity vector of every bullet, particle effect, main character, enemies with more states regarding to their behaviour .. etc… is this ok then or I don’t get something

<hcarty> For the velocity vector example - one way to think about it would be to have your update function return a new “bullet” rather than modifying the old one.

<hcarty> But it’s a style choice, and OCaml lets you have it both ways

<middayc-> :) that is an interesting view (new bullet every time)

<Yoric[DT]> But OCaml is often able to optimize this “create a new bullet each time” to “reuse the same bullet”.

<RobertFischer> middayc- Whenever possible, use many small, rapidly-GC’ed data elements.

<RobertFischer> Ocaml is highly optimized for that kind of behavior.

<RobertFischer> All of your ex-Java (or whatever) training which says that “object creation is expensive” needs to go out the window.

<RobertFischer> You’re generally best off using records or tuples (as appropriate) and minimizing the amount of mutable data you have. This will give you the best performance in Ocaml.

<middayc-> aha … yes I was thinking about GC in that way

<RobertFischer> Thinking in terms of list/graph processing instead of message passing is also a major performance improvement.

<RobertFischer> So, when you have a bunch of sprites and a change in the moment in time, don’t think of telling each and every sprite to update itself — that’s the OO way to approach the problem.

<ita> does the use of closures instead of classes change anything speed-wise?

<middayc-> huh I have no idea what is list/graph processing …

<RobertFischer> Do you know what a graph is?

<middayc-> no

<RobertFischer> A graph is a data structure of data structures.

<middayc-> aha .. like a tree

<middayc-> like list is flat — a graph is structured?

<RobertFischer> Yes, where each node is a data structure. So a list of lists, a tree of lists, a tree of maps of lists of map-list tuples.

<RobertFischer> Whatever.

<ita> middayc-: {vertex, arcs}

<middayc-> aha … I begin to understand what you mean by list/graph processing vs object.update()

<RobertFischer> The more you can just tell OCaml (or any FP language), “Here’s how to process each element of that graph, and here’s the graph to process”, the better off you’ll be. See fold and iter of examples of that.

<middayc-> cool … you should write a book … you explain it in a way I can quickly understand

<RobertFischer> If you think of your state as a graph of elements, and can define a function which changes your state and returns the new graph of elements, then you’re going to be digging around at the best performance in Ocaml.

<RobertFischer> I’m doing a podcast and writing a blog.

<RobertFischer> I’ll work on a book later. :-D

<middayc-> aha … a new graph each time?

<middayc-> I have to invert my brain from stuff I am used to and then it all makes sense

<RobertFischer> Pretty much.

Thanks guys for explaining it to me so well! Since then I wrote 3 examples of using SDL with OCaml and I used no mutable state and felt no need to use it. I like the code I wrote with this paradigm a lot. I will continue building a game in OCaml and see what happens next.