Pro Yearly is on sale from $80 to $50! »

Elixir by a Rubyist

98195776df79590269541395c699f816?s=47 João Moura
September 21, 2015

Elixir by a Rubyist

If you are just getting started with Elixir or want to start learning it, this talk is perfect for you.
We'll go trough basics and dive into the language! Check the ecosytem that is emerging around it focusing into build web applications using Elixir's greatest features.
In this talk we'll talk about what is Functional Programming, how it works, why you should consider using it when building new applications and how elixir is driven by it.
It'll also point out the similarities between Elixir and Ruby, it aim to help Rubyists to understand it in an easier way. If you are a Rubyist you will probably feel great about this talk.

98195776df79590269541395c699f816?s=128

João Moura

September 21, 2015
Tweet

Transcript

  1. by a Rubyist Elixir Elixir by a Rubyist

  2. None
  3. None
  4. None
  5. None
  6. João Moura Senior engineer at Ride @joaomdmoura github/joaomdmoura

  7. by a Rubyist Elixir Elixir by a Rubyist

  8. # .NET (Axiom) 0 System A+ A++ ABAP ABC C

    ALGOL ABLE ABSET ABSYS ACC Accent e DASL ACL2 ACT-III Action! ionScript Adenine Agda Agilent VEE Agora AIMMS Alef ALF ALGOL 58 ALGOL 60 ALGOL 68 ALGOL W Alice Alma-0 AmbientTalk Amiga E AMOS AMPL APL Babbage Bash BASIC bc BCPL BeanShell Batch (Windows/Dos) Bertrand BETA Bigwig Bistro BitC BLISS Blue Boo Boomerang Bourne shell BREW C-- C++ - ISO/IEC 14882 C# - ISO/IEC 23270 C/AL Caché ObjectScript C Shell Caml Cayenne CDuce Cecil Cel Cesil Ceylon CFEngine CFML Cg Ch Chapel Charity Charm Chef CHILL CHIP-8 chomski ChucK CICS Cilk CL (IBM) Claire Clarion Clean Clipper CLIST Clojure CLU CMS-2 Cobra CODE CoffeeScript Cola ColdC ColdFusion COMAL COMIT COMPASS Component Pascal Converge Cool Coq Coral 66 Corn CorVision COWSEL CPL D DASL Dart DataFlex Datalog DATATRIEVE dBase dc DCL Deesel (formerly G) Delphi DinkC DIBOL Dog Draco DRAKON Dylan DYNAMO E E# Ease Easy PL/I Easy Programming Language EASYTRIEVE PLUS ECMAScript Edinburgh IMP EGL Eiffel ELAN Elixir Elm Emacs Lisp Emerald Epigram EPL Erlang F F# Factor Falcon Fantom FAUST FFP Fjölnir FL Flavors Flex FLOW-MATIC FOCAL FOCUS FOIL FORMAC @Formula Forth Fortran - ISO/IEC 1539 Fortress FoxBase FoxPro FP FPr Franz Lisp Frege F-Script G Google Apps Script Game Maker Language GameMonkey Script GAMS GAP G-code Genie GDL GJ GEORGE GLSL GNU E GM Go Go! GOAL Hamilton C shell Harbour Hartmann pipelines Haskell Haxe High Level Assembly HLSL Hop Hope Hugo Hume HyperTalk programming Languages Escher ESPOL Esterel Etoys Euclid Euler Euphoria Goo Gosu IBM RPG ICI Icon Id IDL Idris IMP Inform Io Ioke IPL IPTSCRAE ISLISP ISPF ISWIM HAL/S Hamilton C shel Harbour Hartmann pipelin Haskell Haxe High Level Assem HLSL Hop Hope Hugo Hume HyperTalk IBM Basic assembly lan IBM HAScript IBM Informix-4GL IBM RPG ICI Icon Id IDL Idris IMP Inform Io Ioke IPL IPTSCRA ISLISP ISPF J JO JS JScr JavaF
  9. None
  10. None
  11. # .NET (Axiom) 0 System A+ A++ ABAP ABC C

    ALGOL ABLE ABSET ABSYS ACC Accent e DASL ACL2 ACT-III Action! ionScript Adenine Agda Agilent VEE Agora AIMMS Alef ALF ALGOL 58 ALGOL 60 ALGOL 68 ALGOL W Alice Alma-0 AmbientTalk Amiga E AMOS AMPL APL Babbage Bash BASIC bc BCPL BeanShell Batch (Windows/Dos) Bertrand BETA Bigwig Bistro BitC BLISS Blue Boo Boomerang Bourne shell BREW C-- C++ - ISO/IEC 14882 C# - ISO/IEC 23270 C/AL Caché ObjectScript C Shell Caml Cayenne CDuce Cecil Cel Cesil Ceylon CFEngine CFML Cg Ch Chapel Charity Charm Chef CHILL CHIP-8 chomski ChucK CICS Cilk CL (IBM) Claire Clarion Clean Clipper CLIST Clojure CLU CMS-2 Cobra CODE CoffeeScript Cola ColdC ColdFusion COMAL COMIT COMPASS Component Pascal Converge Cool Coq Coral 66 Corn CorVision COWSEL CPL D DASL Dart DataFlex Datalog DATATRIEVE dBase dc DCL Deesel (formerly G) Delphi DinkC DIBOL Dog Draco DRAKON Dylan DYNAMO E E# Ease Easy PL/I Easy Programming Language EASYTRIEVE PLUS ECMAScript Edinburgh IMP EGL Eiffel ELAN Elixir Elm Emacs Lisp Emerald Epigram EPL Erlang F F# Factor Falcon Fantom FAUST FFP Fjölnir FL Flavors Flex FLOW-MATIC FOCAL FOCUS FOIL FORMAC @Formula Forth Fortran - ISO/IEC 1539 Fortress FoxBase FoxPro FP FPr Franz Lisp Frege F-Script G Google Apps Script Game Maker Language GameMonkey Script GAMS GAP G-code Genie GDL GJ GEORGE GLSL GNU E GM Go Go! GOAL Hamilton C shell Harbour Hartmann pipelines Haskell Haxe High Level Assembly HLSL Hop Hope Hugo Hume HyperTalk Elixir Escher ESPOL Esterel Etoys Euclid Euler Euphoria Goo Gosu IBM RPG ICI Icon Id IDL Idris IMP Inform Io Ioke IPL IPTSCRAE ISLISP ISPF ISWIM HAL/S Hamilton C shel Harbour Hartmann pipelin Haskell Haxe High Level Assem HLSL Hop Hope Hugo Hume HyperTalk IBM Basic assembly lan IBM HAScript IBM Informix-4GL IBM RPG ICI Icon Id IDL Idris IMP Inform Io Ioke IPL IPTSCRA ISLISP ISPF J JO JS JScr JavaF
  12. None
  13. None
  14. None
  15. None
  16. the future is dynamic the future is dynamic

  17. None
  18. 177 mm² 177 mm²

  19. the future is concurrent the future is concurrent

  20. Thread, Process & Cores

  21. Multithread

  22. Process

  23. Process Threads

  24. Cores

  25. None
  26. None
  27. Erlang VM

  28. Erlang

  29. Actor Model

  30. None
  31. 30 years

  32. None
  33. Ruby +

  34. Ruby + Erlang VM

  35. Ruby + Erlang VM Steroids

  36. Elixir

  37. Functional “doing the same thing over and over again and

    expecting different results” - Albert Einstein
  38. None
  39. • Cleaner code

  40. • Cleaner code • Transparency

  41. • Cleaner code • Transparency • Parallelization

  42. • Cleaner code • Transparency • Parallelization • Modularity

  43. • Cleaner code • Transparency • Parallelization • Modularity •

    Easier debugging
  44. a = 0 def increment1 a += 1 end

  45. def increment2(a) return a + 1 end

  46. indexes = [1, 2, 3] indexes << 4 indexes #

    [1, 2, 3, 4]
  47. indexes = [1, 2, 3] all_indexes = indexes + [4]

  48. result = func1(a, b) + func2(a, c)

  49. func1(a, b) func2(a, c)

  50. func1(a, b) func2(a, c) } Parallelization

  51. None
  52. None
  53. None
  54. 05.000.000

  55. None
  56. None
  57. None
  58. None
  59. None
  60. None
  61. None
  62. Example I

  63. None
  64. None
  65. None
  66. None
  67. None
  68. Example II

  69. None
  70. None
  71. None
  72. None
  73. None
  74. None
  75. None
  76. None
  77. None
  78. None
  79. Rake + Bundler

  80. Mix

  81. mix test

  82. mix phoenix.new

  83. mix deps

  84. gemfile.rb

  85. mix.ex

  86. defp deps do [ {:phoenix, "~> 0.15"}, {:postgrex, ">= 0.0.0"},

    {:cowboy, "~> 1.0”} ] end
  87. Sent 200 in 184ms

  88. Sent 200 in

  89. Sent 200 in 233µs

  90. Joe Armstrong “ ” This is good shit. Co-creator of

    Erlang
  91. the future is dynamic the future is dynamic

  92. the future is concurrent the future is concurrent

  93. Erlang VM

  94. Elixir

  95. None
  96. None
  97. None
  98. ElixirbyaRubyist.com #ElixirbyaRubyist

  99. @joaomdmoura ElixirbyaRubyist.com