Erlang (and Elixir) Koans

I just received a comment on my blog for a very old post I did about Ruby Koans, so naturally wondered whether there was one for Erlang and Elixir - there is!

http://elixirkoans.io

If you’re wondering what they are, here’s the description from the original (Ruby) version:

The Koans walk you along the path to enlightenment in order to learn Ruby. The goal is to learn the Ruby language, syntax, structure, and some common functions and libraries. We also teach you culture. Testing is not just something we pay lip service to, but something we live. It is essential in your quest to learn and do great things in the language.

The koans are broken out into areas by file, hashes are covered in about_hashes.rb, modules are introduced in about_modules.rb, etc. They are presented in order in the path_to_enlightenment.rb file.

Each koan builds up your knowledge of Ruby and builds upon itself. It will stop at the first place you need to correct.

Some koans simply need to have the correct answer substituted for an incorrect one. Some, however, require you to supply your own answer. If you see the method __ (a double underscore) listed, it is a hint to you to supply your own code in order to make it work correctly.

And if you get stuck, my old blog post might give you so tips (the main one is that don’t try to make it harder than what it might seem - they’re not trick questions :lol:)

5 Likes

Very cool! I starred it and will start working through these later.

3 Likes

Now this is nostalgic. I remember going through Ruby Koans years ago!

I’m very glad there’s an Erlang version and I think I’m going to go through it just for the feeling.

2 Likes

Haha yeah I was surprised when I got the email notification myself - can’t believe ten years have passed :icon_eek:

If you and @Neiby end up doing the Erlang Koans, please let us know how you get on :023:

3 Likes

Koans are awesome in general, I was actually first introduced to them with the Rust Koans (there are more normal github programmy koans too of course) before I figured out it was a whole thing among a lot of languages. ^.^

(I came late to the koan party, lol)

3 Likes

I spent a bit of time going over the Erlang Koans today and it was still quite fun! The repo is missing some newer things, like gen_statem instead of gen_fsm and has more links to LYSE than I would have expected (i.e. I would have expected a koan for syntax like $a before needing to use it) for a guided tour, but it’s nice.

Maybe we should consider making an official version for BEAM languages.

2 Likes

Do it Stephan!! :003:

2 Likes

As you can see from how delayed my response is, I don’t have much free time! :laughing:

I’d love to start work on this if I did though, so if anyone else wants to start I’d be more than happy to test out some of the Koans. Maybe one day I will have free time to tackle a writing project like this.

1 Like