Skip to content

Instantly share code, notes, and snippets.

@giants415
Created October 24, 2016 18:30
Show Gist options
  • Save giants415/6e4cba266275629d865b2885d39ded30 to your computer and use it in GitHub Desktop.
Save giants415/6e4cba266275629d865b2885d39ded30 to your computer and use it in GitHub Desktop.
Elixir Lightning Talk

##What is Elixir?

Elixir is a dynamic, functional language designed for building scalable and maintainable applications. Elixir leverages the Erlang VM, known for running low-latency, distributed and fault-tolerant systems, while also being successfully used in web development and the embedded software domain.

##Benefits of Elixir

  1. Scalability

    • All Elixir code runs inside "processes" which stay isolated from each other and exchange information with messages
  2. Fault-tolerance

    • Portions of the code can run while other parts are non-functional through the use of Elixir's "supervisors"
  3. Functional Programming

    • Code is written to be short, fast, maintainable, and semantic so developers are able to quickly understand and access the contents
    • Using "guards", the pattern matching style of Elixir allows for assertion of specific conditions for code to execute
  4. Extensibility and DSLs

    • Allows for pieces of code to be called from other places in order to test newer code that is being written.
  5. Growing Ecosystem

    • Elixir has "mix" (similar to rails/rake) which allows new projects to be created, tested, and managed
  6. Interactive Development

    • Comes with IEx (Elixir's interactive shell) which provides debugging tools, code reloading, and documentation (very similar to IRB/Pry)
  7. Erlang Compatible

    • Runs on the Erlang VM (used by Heroku, WhatsApp, and more)

###Before getting started: Erlang

  • Programming language originally developed by Ericsson Computer Science Laboratory
  • Uses a collection of middleware and libraries with Open Telecom Platform (OTP)
  • Allows for code to be changed without stopping the system it is being written/tested for
  • Interested in developing with Erlang?

##Getting Started

  • Install Erlang

  • Install Elixir w/ brew

     brew install elixir
    

##Phoenix Framework Phoenix is a popular development framework written in Elixir which utilized the server side MVC pattern.

Phoenix provides the best of both worlds - high developer productivity and high application performance. It also has some interesting new twists like channels for implementing realtime features and pre-compiled templates for blazing speed.

Phoenix is the "top layer of a multi-layer system designed to be modular and flexible."

The layers consist of Plug, Ecto, and the Erlang HTTP server (A.K.A Cowboy)

Plug : A specification for construction composable modules. Plugs function as reusable modules or functions built to Plug specifications. Plugs can handle almost anything and so Phoenix makes use of them in the router and controllers.

Ecto : a language integrated query composition tool and database wrapper for Elixir.

With Ecto, we can read and write to different databases, model our domain data, write complex queries in a type-safe way, protect against attack vectors - including SQL injection, and much more.

##Resources Learn Elixir and Erlang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment