This week I’ve been looking into other languages.
I’m not a huge fan of space-is-important languages since I think it makes it harder to make your code pretty, but I am actively trying to do something new here. Perhaps if I try it, maybe my worries will not be justified! Certainly tons of developers use python (and I do from time to time at work) so perhaps if I tried working with it, that will allow me to see the benefits.
Compilation to multiple platforms is also appealing, since that means I’m not limited in the future if I want to, for example, distribute on Steam.
I was impressed with the Elm tutorial pages. Unlike the propaganda-laden ClojureScript, there was not a constant theme of how great functional languages are and how anyone who would use an imperative language is an idiot. Instead the tone was informative and practical, and the pages simply told me how things worked in a Elm program. I also liked the practical advice that was added alongside.
I followed the tutorials, skipping or skimming over bits that I understood, and quickly got to a state where I had merged and extended two of the examples and made a web page that shows the current time, has a button to press that does something, and counts up how many ticks have gone by.
This is great – this is exactly where I need to be for my game, and within perhaps two hours of the install.
So I think I have something I can work with. Elm meets most of my criteria for a suitable language, although I’m slightly concerned that it’s not a widespread language. Hopefully that won’t matter too much, though. It does have the bonus aspect of being something completely different for me – I’m looking forward to seeing how I can make a functional useful program out of a functional language!
Over the next few days I’m going to try to make a basic game loop with two interface buttons:
- One to send my witch character off collecting herbs – this will trigger an action that takes a small amount of time and herbs will arrive after that
- One which plants herbs in a herb garden which will automatically produce more herbs over time.