Elixir: Your Next Addiction

2014-04-08 by Daniel Farrell (Meetup)

Sample code from talk is on Github.

Functional Programming

  • programming == data transformation
  • first class functions
  • immutable data
    • allows for massively parallel execution
  • recursive iteration
  • tail recursion optimization

Patter Matching

  • assignment
  • different versions of the same function
  • case statement
  • gaurd clause
  • if/else (rarely used)

Syntax

  • basic types
    • string
    • int
    • float
  • atoms (symbols)
  • modules
  • linked list
  • tuples
  • HashDicts (maps)
  • anonymous functions
  • functions (name/arity)
  • pipeline
  • records -> maps/structs
  • protocols
  • macros
  • list comprehensions
  • enum/stream
  • processes
  • nodes

Confusion

  • no date/time datatypes
  • anonymous function called with . in front of parenthesis (.())
  • 'string' versus "string"
    • 'linked list of ascii character codes'
    • "utf-8 blob"
  • quote/unquote and __using__

Tools

  • mix - build tool
  • lex - repl
  • kiex - manage and run multiple versions of elixir
  • ExDoc - documentation
  • ExUnit - testing
  • expm.co - third-party package repository

Web Tools

Erlang's Cowboy server (and others) is fast enough to not need to run behind a proxy server like nginx.