Hey! I made a snake game using Reason that you can play here. Also the source code is here if you want to take a look. Writing it in Reason was super interesting, and the community was very helpful and answered a lot of my questions on discord.
This is probably one of my most favorite lines of code I’ve written just because it’s so expressive
let update = (snake: t) => snake |> moveSnake |> pivotBody |> pivotHead;
Advice that I got in discord that I wish I had known earlier:
- Use bs-webapi.
- Use Belt. It’s super useful.
- Use rollup to bundle your code because it’s really good at tree shaking.
- Reading the code that bucklescript generates is super useful, and really helps understand what’s going on. (this was especially useful for when I wrote my own bindings to roughjs)
The only real cons were just that it was very hard for me to debug lists using the in browser debugger since they were a bunch of nested arrays, and the UNKNOWN SYNTAX ERRORS did eat up some of my time.