WordCount in Elixir
I stumbled upon the reimplementation of the very limited wc
unix utility functionality in Haskell by Chris Penner, and have it redone in pure Elixir.
In this post I cover the whole “optimization” process, starting from naïve implementation and walking down the road with generated pattern-matching clauses and using Flow
to make it concurrent with two lines of code.
Spoiler: I was able to beat C and be even with the aforementioned Haskell solution.
Read next FastRSS - A fast RSS parser implemented using a Rust NIF