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

Object Oriented Thinking with Elixir and OTP - GORUCO 2017

Object Oriented Thinking with Elixir and OTP - GORUCO 2017

Processes in Erlang / Elixir resemble objects in many ways. Some even argue that Erlang processes and the Actor Model are a purer form of object-orientation.
The Elixir community has a large contingent of Rubyists that have extended many of the core values (and joys) of Ruby into the world of Elixir.
This talk exposes some of the reasons why while providing a starting point for further learning.

Ryan Findley

June 24, 2017
Tweet

More Decks by Ryan Findley

Other Decks in Programming

Transcript

  1. Try it the Elixir way Giving Up the Object-Oriented Ghost

    - Morgan Laco Leveling Up With Ecto - Darin Wilson Refactoring Techniques for Elixir, Ecto, and Phoenix - Gary Rennie Abstractions: A Tale of Keys and Values - Ernie Miller
  2. -- Joe Armstrong, the only co-inventor of Erlang I can

    name -- Wikipedia: Erlang -- Alan Kay, pretty much the father of OO -- C2 Wiki Erlang Worldview • Everything Is An Object • Objects communicate by sending and receiving messages • Objects have their own memory • Every object is an instance of a class • The class holds the shared behavior for its instances • To eval a program list, control is passed to the first object and the remainder is treated as its message • Everything is a process • Processes are strongly isolated • Process creation and destruction is a lightweight operation • Message passing is the only way for processes to interact • If you know the name of a process you can send it a message • Processes have unique names • Processes share no resources • Error handling is non-local • Processes do what they are supposed to do or fail. Definition of OO
  3. Definition of OO -- Joe Armstrong, the only co-inventor of

    Erlang I can name -- Wikipedia: Erlang -- Alan Kay, pretty much the father of OO -- C2 Wiki Erlang Worldview • Everything Is An Object • Objects communicate by sending and receiving messages • Objects have their own memory • Everything is a process • Processes are strongly isolated • Message passing is the only way for processes to interact • Processes share no resources
  4. Definition of OO -- Joe Armstrong, the only co-inventor of

    Erlang I can name -- Wikipedia: Erlang -- Alan Kay, pretty much the father of OO -- C2 Wiki Erlang Worldview • Everything Is An Object • Objects communicate by sending and receiving messages • Objects have their own memory • Everything is a process • Processes are strongly isolated, share no resources • Message passing is the only way for processes to interact
  5. "The elemental abstraction for state is a process --Ernie Miller

    "Abstractions: A Tale of Keys and Values", ElixirConf 2016