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

The First Few Sips

The First Few Sips

Haskell, Clojure, Scala, Scheme. We all have a laundry list of functional programming languages that we tried to have our functional programming epiphany with, but it just didn’t happen. Then along came Elixir. This exciting new programming language ripped the clothing off of functional programming (FP) and showed us that FP isn’t some esoteric paradigm reserved only for those with PhDs in Math Wizardry. Elixir showed us that FP is about the transformation of data -- and that it can be fun!

As a newcomer to Elixir and coming from an object-oriented background, join me as I share my thoughts and experiences from my journey learning Elixir. Other newcomers should be able to relate. The more experienced Elixir users will be able to see where new users are getting hung up at so that we can target pain points and increase the adoption of Elixir.

Richard B

July 25, 2014
Tweet

More Decks by Richard B

Other Decks in Programming

Transcript

  1. Richard Bishop Software Developer/Consultant (you can hire me!)! I write

    (sometimes): rubiquity.com! I complain (frequently): @rbondev on Twitter
  2. class Cow! def make_sound! "Moooooo"! end! end class Pig! def

    make_sound! “Oink, oink"! end! end class AnimalPresenter! def talk! puts @animal.make_sound! end! end
  3. defmodule AnimalTalker do! def talk(%{type: “cow”}) do! ! “Mooooo”! !

    end! ! def talk(%{type: “pig”}) do! !! “Oink oink”! ! end! end
  4. class Orders! def initialize(orders = [])! @orders = orders! end!

    ! def by_price! ...! end! ! def by_user! ...! end! end! Duplicated! else where?
  5. “ Never use a macro when you can use a

    function ” Macro Mantra™
  6. A LANGUAGE OF MACROS defmacro unless(clause, options) ...! if(unquote(clause), !

    do: unquote(else_clause), ! else: unquote(do_clause))! end! defmacro if(condition, clauses) do! ...! end!
  7. THIRD SIP RECAP Lock free concurrency! What Alan Kay likely

    wanted! Processes encapsulate state! Supervision Trees
  8. THE FOUR SIPS Elixir is like Ruby on the Erlang

    VM Elixir is like CoffeeScript for Erlang Actors are more OO than objects Elixir is a language in its own right
  9. Elixir Elixir is a functional, meta-programming aware language built on

    top of the Erlang VM. It is a dynamic language that focuses on tooling to leverage Erlang's abilities to build concurrent, distributed and fault-tolerant applications with hot code upgrades.
  10. GIVING PEOPLE CREDIT Elixir color palette by user masyaf of

    colourlovers.com http://www.colourlovers.com/palette/3203120/Elixir ! State definition from Rich Hickey’s “Simple Made Easy” talk http://www.infoq.com/presentations/Simple-Made-Easy ! Aristocrat posturing with his glass of wine image http://tvtropes.org/pmwiki/pmwiki.php/Main/WineisClassy ! Woman sipping coffee while pondering something important image http://blog.febc.org/the-4-step-recipe-for-knowing-god/ ! Sly man enjoying his glass of whiskey a little too much image http://www.scoopwhoop.com/inothernews/whiskey-drinker/