Slide 1

Slide 1 text

FROM RUBY TO ELIXIR: WHAT NOW ?? Renan Ranelli

Slide 2

Slide 2 text

Renan Ranelli (Milhouse)

Slide 3

Slide 3 text

(former) Software Engineer @ Renan Ranelli (Milhouse)

Slide 4

Slide 4 text

Software Engineer @ Renan Ranelli (Milhouse)

Slide 5

Slide 5 text

Renan Ranelli (Milhouse)

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

> 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

Slide 11

Slide 11 text

This was written in March 2005

Slide 12

Slide 12 text

2005

Slide 13

Slide 13 text

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.

Slide 14

Slide 14 text

This was written in March 2005

Slide 15

Slide 15 text

ELIXIR @ XERPA

Slide 16

Slide 16 text

ELIXIR @ XERPA

Slide 17

Slide 17 text

ELIXIR @ XERPA • Our Stack so far: – Phoenix – Postgresql (?!) – Clojurescript (Re-frame/react) – ElasticSearch (?!) – Ruby + Selenium for acceptance tests – Shell + Ansible + AWS for all things

Slide 18

Slide 18 text

ELIXIR @ XERPA

Slide 19

Slide 19 text

Elixir is * not * Ruby

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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!)

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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 (!?)

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

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.

Slide 32

Slide 32 text

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.

Slide 33

Slide 33 text

Now to the not-fun part.

Slide 34

Slide 34 text

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.

Slide 35

Slide 35 text

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.

Slide 36

Slide 36 text

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)

Slide 37

Slide 37 text

bottomline

Slide 38

Slide 38 text

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.

Slide 39

Slide 39 text

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.

Slide 40

Slide 40 text

OBRIGADO !

Slide 41

Slide 41 text

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