r/purescript • u/Sh4rPEYE • Jan 28 '21
Which one of Purescript, Elm and Reason is most suited for teaching a project-based FP course?
Beginning this March, I'll lead a new high-school functional programming course, consisting mostly of writing simple 2D games. I can't decide which of these three languages would be best suited for it. Does anybody have experience with any of them? What did you like? What did you not? What should I use?
The students are a bunch of talented high-schoolers, however they only picked up (functional) programming this September. That means good tooling and a friendly compiler are paramount, even more so than usual, because they'll often be leaning on both.
I'd like the course to continue into the next year without changing languages; something like Elm -> Haskell doesn't work for us unfortunately.
I don't have experience with any of the languages, but I write Haskell and Typescript for living, so I should be able pick these up rather quickly. Because I know Haskell so well, I lean towards PureScript, but I don't want to base my decision only on this.
11
u/pr06lefs Jan 28 '21
I'm biased towards elm, since it is a simpler language than purescript but still suited to 2d games. It's friendly compiler serves as a model for other languages. Tooling is solid and simple. There's ellie for examples and setup-free experimenting. There's a great deal less mystery and knowledge needed for Elm, yet some experience with it will acquaint learners with basic ML syntax, which is half the battle when coming to grips with haskell or purescript later on.
5
u/FranklinChen Jan 28 '21
Have you considered using Code World https://code.world/ which uses Haskell?
3
u/D7x7w9pHnT Jan 28 '21
Really depends on what the end goals are. What do you want to leave your students with?
Haskell has the most warts, but since you're a professional Haskeller you could help your students around most of the beginner mistakes. It certainly doesn't have as good as tooling or friendly compiler.
Both Purescript and Elm are a joy to work with, have good helpful compilers, and plenty of documentation.
Using either the Purescript Book or the Elm Guide would be a great start.
They both support 2D games as well: Purescript and Elm
In general Purescript is more FP pure, Elm will get you to making a website quicker.
3
u/imright_anduknowit Jan 28 '21
If you're trying to develop a game, then you're going to need to forego many necessary concepts, e.g. Monads, in order to meet your deadline. With Elm, the barrier to entry is small enough, students can MAYBE build a working game, albeit a simple one.
If, however, you prioritize Functional Programming concepts, e.g. Monads, over building a game, then I'd pick PureScript. But this approach will certainly delay the development of the game for quite some time.
Since they are high-school students, they're probably not very good at delayed gratification and so getting something on screen ASAP is important to keep them motivated making Elm the best choice for them.
They can always move to PureScript later.
1
u/BlueMarble007 Jan 29 '21
What’s the argument against teaching them Haskell itself?
2
u/shefmichelle Jan 28 '21
Have you considered Racket? It isn't the same style as Purescript, Elm and Reason, but I think you can still consider it functional, and Dr Racket is a great environment for learning in. It also comes with loads of libraries built-in.