/ projects / coalton-raylib

coalton-raylib

repotags
https://git.sr.ht/~nebulae/coalton-raylibgame dev, coalton, common lisp, programming
table of contents

2/5 in the series liberatory computing ∀


the problem

i love programming in ML-family languages like Haskell & OCaml, but they typically aren't interactive like Common Lisp , which makes programming games more difficult .

this is because you have to restart the entire program you're working on every time you compile a new change[1] .

one possible solution

as an ML language built on top of Common Lisp , Coalton can provide a statically typed , functional ( with typeclasses ! ) , & highly interactive game programming environment .

coalton-raylib is an example project i've shared that uses the raylib graphics library .

i've written the draw loop in Common Lisp , & the data model & update functions in Coalton[2] . that means you can selectively reevaluate data & functions while the game is running , while benefiting from compile-time type errors if you make a mistake !

conclusion

this was just a small experiment , that i figured i'd share in case it's useful for anyone else . i'm not sure if i'll use this for a larger game eor not , given that Coalton hasn't reached 1.0 yet , but it's great to know that it's a possibility .

footnotes

  1. there are ways to smooth this over , but they can add a lot of complexity
  2. that's just the method i found to be the most ergonomic , but i'm certain that others could find better ways of architecting a game with coalton