@elixirlang / elixir-langs3-eu-west-1.amazonaws.com/presentations2014/12_presentation.pdf · Now we...

Post on 22-Aug-2020

0 views 0 download

transcript

@elixirlang / elixir-lang.orgWednesday, May 14, 14

Rails 2.2threadsafe

Wednesday, May 14, 14

Sapir-Whorfhypothesis

Wednesday, May 14, 14

The structure of a language affects the ways in which its

respective speakers conceptualize their world

Wednesday, May 14, 14

Wednesday, May 14, 14

“Threadsafe”

Wednesday, May 14, 14

Functionalprogramming

Wednesday, May 14, 14

Wednesday, May 14, 14

• Explicit instead of implicit state

Wednesday, May 14, 14

• Explicit instead of implicit state• Transformation instead of mutation

Wednesday, May 14, 14

Wednesday, May 14, 14

• Functional

Wednesday, May 14, 14

• Functional• Concurrent

Wednesday, May 14, 14

• Functional• Concurrent• Distributed

Wednesday, May 14, 14

Wednesday, May 14, 14

Switch

Wednesday, May 14, 14

Switch

Wednesday, May 14, 14

Switch

Wednesday, May 14, 14

Switch

Wednesday, May 14, 14

Switch

Switch

Wednesday, May 14, 14

Switch

Browser

Endpoint

Server

Wednesday, May 14, 14

http://blog.whatsapp.com/index.php/2012/01/1-million-is-so-2011/

2 million connections on a single node

Wednesday, May 14, 14

Intel Xeon CPU X5675 @ 3.07GHz24 CPU - 96GBUsing 40% of CPU and Memory

Wednesday, May 14, 14

Idioms

Wednesday, May 14, 14

Sequentialcode

Wednesday, May 14, 14

Sequentialcode

elixir

Wednesday, May 14, 14

Sequentialcode

elixir

Wednesday, May 14, 14

elixir

Wednesday, May 14, 14

elixir

Wednesday, May 14, 14

elixir

Wednesday, May 14, 14

WebDB MailerStats

Wednesday, May 14, 14

WebDB MailerStats

Sup

Wednesday, May 14, 14

WebDB MailerStats

Sup

App

Wednesday, May 14, 14

• Processes• Supervisors• Applications• Message passing• “Fail fast”

Wednesday, May 14, 14

Wednesday, May 14, 14

• Isolated• Concurrent• Fault tolerant

Wednesday, May 14, 14

• Isolated• Concurrent• Fault tolerant• Distributed?

Wednesday, May 14, 14

elixir

Wednesday, May 14, 14

app2@localapp1@local

elixir

Wednesday, May 14, 14

Wednesday, May 14, 14

• Compatibility

Wednesday, May 14, 14

• Compatibility• Extensibility

Wednesday, May 14, 14

• Compatibility• Extensibility • Productivity

Wednesday, May 14, 14

goal #1

Compatibility

Wednesday, May 14, 14

goal #2

Extensibility

Wednesday, May 14, 14

Now we need to go meta. We should now think of a language design as being a

pattern for language designs. A tool for making more tools of the same kind.

Guy Steele - “Growing a language”at ACM OOPSLA 1998

Wednesday, May 14, 14

defmacro unless(expr, opts) do quote do if(!unquote(expr), unquote(opts)) endend

unless(is_number(x), do: raise(“oops”))

elixir

Wednesday, May 14, 14

defmodule MathTest do use ExUnit.Case

test "basic operations" do assert 1 + 1 == 2 endend

elixir

Wednesday, May 14, 14

Wednesday, May 14, 14

from p in Post,where: p.published_at < now and p.author == “José”,order: p.created_at

elixir

Wednesday, May 14, 14

goal #3

Productivity

Wednesday, May 14, 14

Focus on tooling.Demo time!

Wednesday, May 14, 14

elixir-lang.orgWednesday, May 14, 14

Wednesday, May 14, 14

GeeConValim2014

Wednesday, May 14, 14

Wednesday, May 14, 14

Wednesday, May 14, 14

@elixirlang / elixir-lang.orgWednesday, May 14, 14