Elug SP 2016 -- From Ruby to Elixir: What now?

Elug SP 2016 -- From Ruby to Elixir: What now?

4569aec00cb223b3fbf484f9e7ba1256?s=128

Renan Ranelli

January 30, 2016
Tweet

Transcript

  1. FROM RUBY TO ELIXIR: WHAT NOW ?? Renan Ranelli

  2. Renan Ranelli (Milhouse)

  3. (former) Software Engineer @ Renan Ranelli (Milhouse)

  4. Software Engineer @ Renan Ranelli (Milhouse)

  5. Renan Ranelli (Milhouse)

  6. AGENDA • Why are people talk so much about functional

    programming (FP)? • A little bit of context on what we are doing with Elixir @ Xerpa • Elixir & Ruby – What's the difference? • The main problems & difficulties we encountered so far • Final points & discussion
  7. None
  8. WHAT IS HAPPENING IN THE HARDWARE INDUSTRY? • You should

    google “no more free lunch” and read the first article. Seriously. • Since I'm already here, I'll give you a primer: – CPU clock is not getting exponentially faster – Transistor number is still growing rapidly – No performance gain for single threaded apps – Concurrency is the next major revolution in how we write software
  9. None
  10. > Concurrency is the next major revolution in how we

    write software > Applications will increasingly need to be concurrent if they want to fully exploit continuing exponential CPU throughput gains > Efficiency and performance optimization will get more, not less, important
  11. This was written in March 2005

  12. 2005

  13. In 2005: – Java 5 was hot news. – Windows

    XP. Vista only in 2007. – No AWS, Twitter, Netflix. – Ruby on Rails launched in December 13th. – Youtube was just founded. – We never have heard of Justin Bieber – I was playing Gunbound & Tibia. No money for WoW.
  14. This was written in March 2005

  15. ELIXIR @ XERPA

  16. ELIXIR @ XERPA

  17. ELIXIR @ XERPA • Our Stack so far: – Phoenix

    – Postgresql (?!) – Clojurescript (Re-frame/react) – ElasticSearch (?!) – Ruby + Selenium for acceptance tests – Shell + Ansible + AWS for all things
  18. ELIXIR @ XERPA

  19. Elixir is * not * Ruby

  20. (although it ends up to be surprisingly similar) (show RedisProxy

    code)
  21. ELIXIR >> RUBY • Where Elixir excels over Ruby ?

    – IMMUTABILITY
  22. ELIXIR >> RUBY • Where Elixir excels over Ruby ?

    – IMMUTABILITY – THERE IS A COMPILER
  23. ELIXIR >> RUBY • Where Elixir excels over Ruby ?

    – IMMUTABILITY – THERE IS A COMPILER – IMMUTABILITY
  24. ELIXIR >> RUBY • Where Elixir excels over Ruby ?

    – IMMUTABILITY – THERE IS A COMPILER – IMMUTABILITY
  25. ELIXIR >> RUBY • Where Elixir excels over Ruby ?

    – IMMUTABILITY – THERE IS A COMPILER – IMMUTABILITY – Docs & tooling receive much more love (!?)
  26. ELIXIR >> RUBY • Where Elixir excels over Ruby ?

    – IMMUTABILITY – THERE IS A COMPILER – IMMUTABILITY – Docs & tooling receive much more love (!?) – MACROS (!? ruby doesn't need them!)
  27. ELIXIR >> RUBY • Where Elixir excels over Ruby ?

    – IMMUTABILITY – THERE IS A COMPILER – IMMUTABILITY – Docs & tooling receive much more love (!?) – MACROS (!? ruby doesn't need them!) – OTP
  28. ELIXIR >> RUBY • Where Elixir excels over Ruby ?

    – IMMUTABILITY – THERE IS A COMPILER – IMMUTABILITY – Docs & tooling receive much more love (!?) – MACROS (!? ruby doesn't need them!) – OTP – Iex >> Irb (!?)
  29. PHOENIX >> RAILS • Where Phoenix excels over Rails ?

    – SUPER DUPPER FAST (!?)
  30. PHOENIX >> RAILS • Where Phoenix excels over Rails ?

    – SUPER DUPPER FAST (!?) – Much easier to setup for high concurrency
  31. PHOENIX >> RAILS • Where Phoenix excels over Rails ?

    – SUPER DUPPER FAST (!?) – Much easier to setup for high concurrency – Much less magic. Mostly everything is based on simple function calls.
  32. PHOENIX >> RAILS • Where Phoenix excels over Rails ?

    – SUPER DUPPER FAST (!?) – Much easier to setup for high concurrency – Much less magic. Mostly everything is based on simple function calls. – Views vs Templates.
  33. Now to the not-fun part.

  34. PROBLEMS WE ENCOUNTERED SO FAR • The ecosystem is still

    very small (and buggy). – No options for monitoring apps (like new relic, appsignal, honeybadger). – No Sidekiq. – ExMachina (elixir's factory girl) is so broken. – No Monads.
  35. PROBLEMS WE ENCOUNTERED SO FAR • The ecosystem is still

    very small (and buggy). – No usable client for elastic search (?!) – No usable (at the time?) library for exposing jsonapi (?!) – No usable (at the time) library to handle acls (?!) – No usable bindings for ImageMagick (?!) – Releases are so damn hard and un-12factor – Hot code reloads are much much harder than people say – Almost no problems with core libs like Ecto, Plug & Phoenix though.
  36. RUBY STILL HAS THE EDGE IN THESE AREAS: – Ruby

    can tap into the JVM with Jruby. – Ruby's stdlib has waaaaaaay more stuff out of the box – A *big* and mature ecosystem – A lot of developers willing to work with it – Although Elixir can tap into erlang-land's libraries and tools, they are much harder to use (less googlability, bad/incomplete docs)
  37. bottomline

  38. On Elixir • Elixir is *very promissing*, and has learned

    a lot from other communities. (e.g. Queryable is an idea from .net's Linq) • You can see that it evolves and taps into the learning experiences of other languages & communities. It still lacks a mature ecosystem but it is gaining traction fast. • If you truly aim to invest yourself in it, you must be ready to get your hands dirt and write a lot of infrastructure you can take for granted in Ruby-land. Do not underestimate the complexity of managing library code + tests + docs + versioning + bug tracking.
  39. On Ruby • Although Ruby is no longer the crème-de-la-crème,

    it is not stagnant. • Many nice ideas on how to add better concurrency to Ruby. Ruby 3 promises to be 3x faster than Ruby 2, while keeping maximum backwards-compatibility.
  40. OBRIGADO !

  41. @renanranelli /rranelli Renan Ranelli (Milhouse) milhouseonsofware.com