NumGuess for Haskell, Crystal and Swift

Haskell LogoThree new versions of NumGuess have been released this week:

  • The Haskell version was long outstanding, but it is finally here. It was a tricky language at first look, took some trial and error to get my head around the lack of loops and IO tainting. In the end however, everything fell nicely into place, and the finished code has a nice distribution of pure and IO functions. This release marks my first piece of code in a purely functional language.
  • Crystal is a new programming language with a Ruby-like syntax that gets converted into C, then compiled into machine code. The language is still in alpha development stage, but that shouldn’t stop its NumGuess implementation. It is similar to Java in the sense that everything is an object, although Nil values are handled a bit differently. If you find out how to return a nilable int in the inputNumber() function without compiler errors, please let me know. For the time being, it nicely demonstrates the use of tuples. 😉
  • Finally, Apple’s Swift programming language is about to get open-sourced later this month. Although I can’t see a reason why anyone would pick that language over the more established ones on other platforms, let’s celebrate with a NumGuess implementation. The code was written and tested on Swift 2.0 on a Mac, it’s quite possible that it will break with the open version, we’ll get back to that when it’s out…

If you have a suggestion or find a programming language we missed, please leave it in the comments or contribute to the project on GitHub.

Share Button
Tagged with: , , ,

Leave a Reply