• Dmitry Rubinstein
  • 23 February 2019
  • Comments

Try vs Case: The last battle


In this article we’ll try to battle different Elixir control structures in order to understand their efficiency and applicability in our projects.


  1. You can use try with else - instead of case literally (only literally!);
  2. Never use with instead of case - only instead of case chains;
  3. Use try if you need it - for catch cases;
  4. Forget about throw and catch in your code - they are really slow;

Do you want to know, what literally means? Welcome under cut!

  • Dmitry Rubinstein
  • 15 February 2019
  • Comments

Fast Cowboy microservice: Recipe

Cowboy with Websocket

In nowadays world of microservices and small web applications, Elixir’s ecosystem obviously have it’s own possibilities to implement them. If you want to create small endpoint, process WebHooks for your process or just like to build everything by yourself it’s good idea not to bring to your project heavy-weight frameworks like Phoenix.

Let’s look at how this problem can be easily solved.

TL;DR: Use Aqua to bootstrap ready-to-go project.

  1. $ mix archive.install hex aqua #(only if not installed)
  2. $ mix aqua new plug my_app --ws --static
  3. ???
  4. Profit!

  • Dmitry Rubinstein
  • 23 May 2017
  • Comments

Functional Rust: Cooking some beef!

Cow logo

One day I’ve stumbled upon Brainfuck-like language “Cow”. And suddenly I’ve came up with an idea to write an interpreter for it in new hip language Rust. Rust is an multi-paradigm language, which means you have to chose in which style you want to write your code in. I’ve chosen functional programming.