SlideShare una empresa de Scribd logo
1 de 25
Intro to Erlang


May 19, 2009


Ken Pratt
http://kenpratt.net/
What is Erlang?



       +      =
      Open
     Source
History

 Created in ’86
 Open-sourced in ’98
 “Programming Erlang” published in ’07
 Taking off in popularity (3 more books on the way)
Ruby killer?


 Absolutely not!
The philosophy

Simple language
Ultra-lightweight concurrency
No shared state (and no locks, no mutexes)
<3 asynchronous message passing
Processes should be able to run forever
The language
Functional
Strong, dynamic typing
NO shared state(!!) (and no mutable variables)
Pattern matching on steroids
<3 tail recursion
Compiled to bytecode, runs on VM
Silly code example
Architecture




  = light-weight process with a built-in mailbox
Distributed architecture




   = light-weight process with a built-in mailbox
Concurrent programming

It is VERY easy to turn procedural code into concurrent
code (as long as you follow conventions)
Code with race conditions either goes in a singleton
process or in a transaction in Mnesia
It is harder to write distributed applications, but still
much, much easier than most platforms (primarily due
to no shared state, no locks, no synchronization, etc...)
Libraries

 Native and “OTP” libraries do all the concurrency heavy
 lifting for you
 Supervisor trees
 Mnesia distributed database
 Web frameworks (Nitrogen, Webmachine)
 JSON!
So what?


       Who the hell would use
    this obscure functional crap?
Highly-concurrent phone switching servers
99.9999999% uptime (~3ms down/year)
Soft real-time characteristics
Fault tolerant
Facebook Chat backend
7+ million active chat channels at peak
~100 servers (= 700,000 channels/server)
AJAX + Comet (long-polling)
Amazon SimpleDB
Schema-less database
IM client integration
ejabberd (Erlang Jabber service)
Chat room polling in Campfire
283 LoC
1500 req/sec
...and many more
Ruby + Erlang


      They can work together
Katamari/Fuzed

Rails server clustering
Erlang bindings for Rails
YAWS web server
Nanite

A “self-assembling cluster of Ruby daemons”
Daemons can be anything small or large, including a
Rails server or map/reduce tasks
RabbitMQ handles the distributed stuff
Erlectricity

 “Real” Erlang/Ruby interaction
 Bi-directional communication using Erlang’s binary
 format
 Erlang treats Ruby processes as “just another” Erlang
 process
BUT

        “Use the right tool for the right job.”


      Erlang is great for distributed services...

...but Ruby is still king for expressing business logic.
Where to start

    “Programming Erlang”
      by Joe Armstrong
      (creator of Erlang)


                Slides & videos online!
        (I’ll post the link to the mailing list)
          http://www.erlang-factory.com/
    conference/SFBayAreaErlangFactory2009
Erlang meetup

http://www.meetup.com/erlang-vancouver
First meetup in mid-to-late June
“Intro to Erlang Programming”(?)
Definitely won’t conflict with Ruby meetup
Thanks!

Más contenido relacionado

La actualidad más candente

Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
Tech_MX
 
20. Parallel Databases in DBMS
20. Parallel Databases in DBMS20. Parallel Databases in DBMS
20. Parallel Databases in DBMS
koolkampus
 
Parallel Processing Presentation2
Parallel Processing Presentation2Parallel Processing Presentation2
Parallel Processing Presentation2
daniyalqureshi712
 

La actualidad más candente (20)

Computer architecture page replacement algorithms
Computer architecture page replacement algorithmsComputer architecture page replacement algorithms
Computer architecture page replacement algorithms
 
A Role of Lexical Analyzer
A Role of Lexical AnalyzerA Role of Lexical Analyzer
A Role of Lexical Analyzer
 
TOC 3 | Different Operations on DFA
TOC 3 | Different Operations on DFATOC 3 | Different Operations on DFA
TOC 3 | Different Operations on DFA
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
DBMS 9 | Extendible Hashing
DBMS 9 | Extendible HashingDBMS 9 | Extendible Hashing
DBMS 9 | Extendible Hashing
 
Automata Theory - Turing machine
Automata Theory - Turing machineAutomata Theory - Turing machine
Automata Theory - Turing machine
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem Solution
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Multiprocessor Systems
Multiprocessor SystemsMultiprocessor Systems
Multiprocessor Systems
 
Compiler question bank
Compiler question bankCompiler question bank
Compiler question bank
 
20. Parallel Databases in DBMS
20. Parallel Databases in DBMS20. Parallel Databases in DBMS
20. Parallel Databases in DBMS
 
6. describing syntax and semantics
6. describing syntax and semantics6. describing syntax and semantics
6. describing syntax and semantics
 
Distributed database management systems
Distributed database management systemsDistributed database management systems
Distributed database management systems
 
Go lang
Go langGo lang
Go lang
 
Low level java programming
Low level java programmingLow level java programming
Low level java programming
 
Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introduction
 
Threads
ThreadsThreads
Threads
 
Parallel Processing Presentation2
Parallel Processing Presentation2Parallel Processing Presentation2
Parallel Processing Presentation2
 
Full solution to bounded buffer
Full solution to bounded bufferFull solution to bounded buffer
Full solution to bounded buffer
 

Destacado

An Erlang Game Stack
An Erlang Game StackAn Erlang Game Stack
An Erlang Game Stack
Eonblast
 
Starting an Erlang Project
Starting an Erlang ProjectStarting an Erlang Project
Starting an Erlang Project
Masahito Ikuta
 
Distributed Erlang Systems In Operation
Distributed Erlang Systems In OperationDistributed Erlang Systems In Operation
Distributed Erlang Systems In Operation
Andy Gross
 
東京Node学園#8 Let It Crash!?
東京Node学園#8 Let It Crash!?東京Node学園#8 Let It Crash!?
東京Node学園#8 Let It Crash!?
koichik
 
Erlang vs. Java
Erlang vs. JavaErlang vs. Java
Erlang vs. Java
Artan Cami
 

Destacado (20)

Erlang OTP
Erlang OTPErlang OTP
Erlang OTP
 
Intro To Erlang
Intro To ErlangIntro To Erlang
Intro To Erlang
 
1 hour dive into Erlang/OTP
1 hour dive into Erlang/OTP1 hour dive into Erlang/OTP
1 hour dive into Erlang/OTP
 
An introduction to erlang
An introduction to erlangAn introduction to erlang
An introduction to erlang
 
Getting real with erlang
Getting real with erlangGetting real with erlang
Getting real with erlang
 
リアルタイムサーバー 〜Erlang/OTPで作るPubSubサーバー〜
リアルタイムサーバー 〜Erlang/OTPで作るPubSubサーバー〜 リアルタイムサーバー 〜Erlang/OTPで作るPubSubサーバー〜
リアルタイムサーバー 〜Erlang/OTPで作るPubSubサーバー〜
 
An Erlang Game Stack
An Erlang Game StackAn Erlang Game Stack
An Erlang Game Stack
 
The Erlang Programming Language
The Erlang Programming LanguageThe Erlang Programming Language
The Erlang Programming Language
 
Introducing Elixir and OTP at the Erlang BASH
Introducing Elixir and OTP at the Erlang BASHIntroducing Elixir and OTP at the Erlang BASH
Introducing Elixir and OTP at the Erlang BASH
 
Java tips
Java tipsJava tips
Java tips
 
Afinal, o que é Docker? (Webinar Umbler)
Afinal, o que é Docker? (Webinar Umbler)Afinal, o que é Docker? (Webinar Umbler)
Afinal, o que é Docker? (Webinar Umbler)
 
Mochiweb LT
Mochiweb LTMochiweb LT
Mochiweb LT
 
Starting an Erlang Project
Starting an Erlang ProjectStarting an Erlang Project
Starting an Erlang Project
 
Kademlia
KademliaKademlia
Kademlia
 
Microservices in GO lang
Microservices in GO langMicroservices in GO lang
Microservices in GO lang
 
Distributed Erlang Systems In Operation
Distributed Erlang Systems In OperationDistributed Erlang Systems In Operation
Distributed Erlang Systems In Operation
 
東京Node学園#8 Let It Crash!?
東京Node学園#8 Let It Crash!?東京Node学園#8 Let It Crash!?
東京Node学園#8 Let It Crash!?
 
RabbitMQ
RabbitMQRabbitMQ
RabbitMQ
 
Concurrency in Elixir with OTP
Concurrency in Elixir with OTPConcurrency in Elixir with OTP
Concurrency in Elixir with OTP
 
Erlang vs. Java
Erlang vs. JavaErlang vs. Java
Erlang vs. Java
 

Similar a Intro to Erlang

Erlang及其应用
Erlang及其应用Erlang及其应用
Erlang及其应用
Feng Yu
 

Similar a Intro to Erlang (20)

Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018
Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018
Gabriele Santomaggio - Inside Elixir/Erlang - Codemotion Milan 2018
 
Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spaces
 
Peyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_futurePeyton jones-2011-parallel haskell-the_future
Peyton jones-2011-parallel haskell-the_future
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
Erlang及其应用
Erlang及其应用Erlang及其应用
Erlang及其应用
 
Osdc 2011 michael_neale
Osdc 2011 michael_nealeOsdc 2011 michael_neale
Osdc 2011 michael_neale
 
Why Erlang? - Bar Camp Atlanta 2008
Why Erlang?  - Bar Camp Atlanta 2008Why Erlang?  - Bar Camp Atlanta 2008
Why Erlang? - Bar Camp Atlanta 2008
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Learning Elixir as a Rubyist
Learning Elixir as a RubyistLearning Elixir as a Rubyist
Learning Elixir as a Rubyist
 
Intro to Elixir talk
Intro to Elixir talkIntro to Elixir talk
Intro to Elixir talk
 
RestMS Introduction
RestMS IntroductionRestMS Introduction
RestMS Introduction
 
Repeating History...On Purpose...with Elixir
Repeating History...On Purpose...with ElixirRepeating History...On Purpose...with Elixir
Repeating History...On Purpose...with Elixir
 
Parllelizaion
ParllelizaionParllelizaion
Parllelizaion
 
Rust presentation convergeconf
Rust presentation convergeconfRust presentation convergeconf
Rust presentation convergeconf
 
Elixir
ElixirElixir
Elixir
 
Beam me up, Scotty
Beam me up, ScottyBeam me up, Scotty
Beam me up, Scotty
 
Stay fresh
Stay freshStay fresh
Stay fresh
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Life Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby AppsLife Beyond Rails: Creating Cross Platform Ruby Apps
Life Beyond Rails: Creating Cross Platform Ruby Apps
 
Writing and testing high frequency trading engines in java
Writing and testing high frequency trading engines in javaWriting and testing high frequency trading engines in java
Writing and testing high frequency trading engines in java
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Intro to Erlang

Notas del editor