I swear, if I read one more programming tutorial that starts with a recursive factorial function instead of a simple “Hello world” I’ll pray for perpetual nigerian spam on their inboxes. So, I was delighted to try out some Ocaml stuff today that didn’t involve factorials.
Since I like dabbling with data visualization I was happy to find the following snippet:
|
|
Simple enough, apparently draws something on an OpenGL display. According to a friend of mine I am supposed to be able to compile ocaml code to a native app. Being on Mac OS X I was sceptical. Native OS X apps usually involves drawing arrows between events and boxes in some funky XCode window.
But, lo and behold:
sudo port install ocaml sudo port install LablGL ocaml opt -I +lablGL lablglut.cmxa lablgl.cmxa ogldemo.ml -o ogldemo
…creates an app that opens a window with the spinning triangle on OS X. And compilation is fast! I need to learn more about ocaml…