Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Fun with Elixir and the Erlang VM

1d27f02822d73e2c64e87e14c45bffcc?s=47 yawnt
October 05, 2013
200

Fun with Elixir and the Erlang VM

Introduction to Elixir, a metaprogramming friendly language that runs on the top of the Erlang VM.

1d27f02822d73e2c64e87e14c45bffcc?s=128

yawnt

October 05, 2013
Tweet

Transcript

  1. ELIXIR and the Erlang VM Fun with

  2. YAWNT Hey, i’m on  & 

  3. NODEJITSU I do  at

  4. LAZY Erlang concepts for the and the IMPATIENT

  5. functional Erlang is a language

  6. awesome As such, it has lots of features

  7. data Functions are

  8. REcursion It uses to solve problems

  9. Guards

  10. pattern matching

  11. Referential transparency

  12. PROCESSes... But

  13. Unique ... make Erlang

  14. concurrent Processes are

  15. MESSAGES They use to communicate

  16. picture shamelessly ripped from learnyousomEerlang

  17. PEOPLE Processes are like

  18. indEpendent They are

  19. fault They are tolerant

  20. isolated They are

  21. distributed They are

  22. BEAM Why a language on VM ? Recap

  23. concurrent It is and DISTRIBUTED

  24. FAULT tolerant It is

  25. OTP It can use

  26. None
  27. OLD But Erlang is

  28. macros Silly

  29. syntax Clunky

  30. flexibility Little

  31. None
  32. Modern What if we could use a language

  33. None
  34. $ git clone \ https://github.com/elixir-lang/elixir.git \ .elixir $ cd .elixir

    $ make test $ echo "PATH=$HOME/.elixir/bin" >> .zshrc $ source .zshrc
  35. “ Elixir is a metaprogrammable, functional language built atop the

    Erlang VM. It is a dynamic language with hygIenic macros that leverages Erlang's ability to build concurrent, distributed, and fault-tolerant applications with hot code upgrades.“ @JosEValim
  36. GOODNESS All the Erlang

  37. PLUS

  38. SYNTAX It has Ruby-inspired

  39. defmodule Hi do def greetings do IO.puts "hi 33dev!" end

    end
  40. FRIENDLY It is DSL

  41. defmodule ATest do use ExUnit.Case test "true should be true"

    do assert(true == true) end end
  42. MACROS It has powerful

  43. defmodule MacroTest do defmacro if_not(pred, block) do quote do if(!unquote(pred))

    do unquote(block) end end end def try_unless do if_not 1==2 do IO.puts "hey" end end end
  44. protocols It has

  45. defprotocol Blank do def blank?(data) end defimpl Blank, for: List

    do def blank?([]), do: true def blank?(_), do: false end
  46. Records It has sane

  47. defrecord Trento, [people: nil, students: 0] do def get_people(city) do

    city.people end end
  48. “ Elixir is the son of ERLANG and RUBY, but

    Ruby missed out and the real father is LisP.“ @DCH__
  49. None
  50. questions? or hit me up later

  51. </talk> Thanks for listening

  52. NEXT  this talk  Erlang/OTP in Action  elixir-lang.org

     Elixir google groups  Programming Elixir