SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
Erlang Developments 
Enrique Paz @quiquepaz 
1/22
Introduction About me 
 Erlang Developer since 2008 
 Developing voteraise.com in Ocaml 
 Trying tech leadership @KPN 
2/22
Introduction Disclaimer 
sort_for_talk([Good,Bad,Ugly])- 
[Bad,Ugly,Good]. 
All comments to come are personal opinions. 
Read others’ in the WWW before making up your own 
3/22
The Bad 
4/22
The Bad (Un)Suitability 
Erlang is not a silver bullet 
 Number Crunching 
 Text/String Processing 
 XML and SOAP based Web Services 
“All can be done given time and money” - Ferenc Holzhauser 
5/22
The Bad Learning Curve 
 Design: Processes VS Objects 
I Technical knowledge required 
I Domain knowledge is harder to map 
 Functional Programming 
I Awesome (if you’ve felt the imperative pain) 
I Risk of callback hell 
6/22
The Bad What has improved 
 Learn You Some Erlang 
 Erlang Solutions Webinars 
 Erlang OTP in Action 
 Designing for Scalability with 
Erlang OTP 
7/22
The Ugly 
8/22
The Ugly Syntax 
 Erlang 
myfun(Opts) - 
What = proplists:get_value(what,Opts,some), 
io:format(Doing ~s~n, [What]), 
L = [1, 2, 3], 
lists:foldl(fun(X, Acc) - 
X + Acc 
end, 0, L). 
9/22
The Ugly Syntax 
 Erlang 
myfun(Opts) - 
What = proplists:get_value(what,Opts,some), 
io:format(Doing ~s~n, [What]), 
L = [1, 2, 3], 
lists:foldl(fun(X, Acc) - 
X + Acc 
end, 0, L). 
 Python 
myfun(what=some): 
print (Doing {thing}.format(thing=what) 
l = [1, 2, 3,], 
return reduce(lambda x, y: x + y, l, 0) 
9/22
The Ugly (lack of) Typesystem 
 Erlang 
myfold(F, Acc, []) - Acc; 
myfold(F, Acc, [H|T]) - myfold(F, F(H,Acc), T). 
myfold(fun(X) - X + 1 end, 0, [1, 2, 3]). 
% Error on runtime!! 
10/22
The Ugly (lack of) Typesystem 
 Erlang 
myfold(F, Acc, []) - Acc; 
myfold(F, Acc, [H|T]) - myfold(F, F(H,Acc), T). 
myfold(fun(X) - X + 1 end, 0, [1, 2, 3]). 
% Error on runtime!! 
 Ocaml 
let rec myfold f acc = function 
| [] - Acc 
| h::t - myfold f (f h acc) t 
# val myfold:(’a -’b-’b)-’b-’a list-’b=fun 
myfold (fun x - x+1) 0 [1;2;3] 
# Compilation error!! (could have used (+)) 
10/22
The Ugly What has improved 
 Elixir: a new language for the Erlang VM 
def myfun(what  ’some’) do 
IO.puts Doing #{what} 
l = [1, 2, 3] 
List.foldl l, 0, (1 + 2) 
end 
11/22
The Ugly What has improved 
 Elixir: a new language for the Erlang VM 
def myfun(what  ’some’) do 
IO.puts Doing #{what} 
l = [1, 2, 3] 
List.foldl l, 0, (1 + 2) 
end 
I Direct mixing of Erlang and Elixir code 
I Ruby-like syntax 
I Adoption? 
11/22
The Ugly What has improved 
 Dialyzer: Static type analyzer for Erlang code 
-type opt()::{what, string()}. 
-spec my_fun([opt()]) - pos_integer(). 
12/22
The Ugly What has improved 
 Dialyzer: Static type analyzer for Erlang code 
-type opt()::{what, string()}. 
-spec my_fun([opt()]) - pos_integer(). 
I Improved error catching 
I Improved error reporting 
I Ideally, all the code you use should be typed 
I Still no support for ETS and debugger match_specs 
I Dialyxir for Elixir projects 
12/22
The Good 
13/22
The Good Less Code 
 Functional = re-usability 
 OTP framework: structure and patterns 
 In code assertions / Let it crash 
ok = file:write_file(MyFile, Hello!) 
 Bit syntax 
?IP_VERSION:4, HLen:4, SrvcType:8, 
TotLen:16, ID:16, Flgs:3, FragOff:13, 
TTL:8, Proto:8, HdrChkSum:16, SrcIP:32, 
DestIP:32, RestDgram/binary = IpPkg 
14/22
The Good Less Engineers 
 High engineering level 
I Not trivial to learn 
I Usually not the 1st language 
 The WhatsApp example: 
I 450M users 
I  25 Engineers building client Apps 
I  6 Erlang Engineers building the server 
I  75M users / Erlang Engineer 
15/22
The Good Highly Available 
Availability1 of Erlang based telephone switches in late 
1980s 
 AXD301 reported 9.99999999% 
(nine nines) availability 
 0.6 seconds per 20 years 
1Joe Armstrong: http://pragprog.com/articles/erlang 
16/22
The Good Highly Available 
 Supervision trees provide automatic recovery 
 No downtime system upgrades 
1. Create appup 
2. Generate relup 
3. Deploy relup 
4. Instruct target system to upgrade itself 
17/22
The Good Scalable 
 Light Parallel processes 
I Quick to create: 660K processes/sec 
I  300 words / standard process (2.4KB) 
I No shared memory 2 
I 1 process per: user session, HTTP call. . . 
 Well known bottlenecks 
I gen_server serialization 
I Long lived NIFs 
I Disk I/O 
2almost 
18/22
The Good The community 
 Erlang Mailing List 
 Erlang Central LIVE chat 
 Erlang Camp 
 Erlang Factory (San Francisco) 
 Erlang User Conference (Stockholm) 
 Erlang Factory Lite: Berlin, Moscow, 
NY, Paris, Chicago. . . 
19/22
The Good What has improved 
 Forced wake up (+sfwi) for schedulers 
 ETS concurrency 
 enif_schedule_nif/0 for partitioned NIF invocation 
 Scalability on multicore (RELEASE) 
 And a ton of awesome applications: 
I Nifty 
I Cowboy 
I Concuerror 
I Piqi 
I . . . and, of course. . . 
20/22
The Good What has improved 
21/22
Wrapping up Questions 
22/22

Weitere ähnliche Inhalte

Was ist angesagt?

Comparing Cpp And Erlang For Motorola Telecoms Software
Comparing Cpp And Erlang For Motorola Telecoms SoftwareComparing Cpp And Erlang For Motorola Telecoms Software
Comparing Cpp And Erlang For Motorola Telecoms Software
l xf
 
Improving Robustness In Distributed Systems
Improving Robustness In Distributed SystemsImproving Robustness In Distributed Systems
Improving Robustness In Distributed Systems
l xf
 
Os Worthington
Os WorthingtonOs Worthington
Os Worthington
oscon2007
 
Lex tool manual
Lex tool manualLex tool manual
Lex tool manual
Sami Said
 

Was ist angesagt? (20)

Erlang
ErlangErlang
Erlang
 
1 hour dive into Erlang/OTP
1 hour dive into Erlang/OTP1 hour dive into Erlang/OTP
1 hour dive into Erlang/OTP
 
Comparing Cpp And Erlang For Motorola Telecoms Software
Comparing Cpp And Erlang For Motorola Telecoms SoftwareComparing Cpp And Erlang For Motorola Telecoms Software
Comparing Cpp And Erlang For Motorola Telecoms Software
 
Improving Robustness In Distributed Systems
Improving Robustness In Distributed SystemsImproving Robustness In Distributed Systems
Improving Robustness In Distributed Systems
 
Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...
Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...
Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...
 
Parallel program design
Parallel program designParallel program design
Parallel program design
 
Lex & yacc
Lex & yaccLex & yacc
Lex & yacc
 
LEX & YACC
LEX & YACCLEX & YACC
LEX & YACC
 
Event Driven with LibUV and ZeroMQ
Event Driven with LibUV and ZeroMQEvent Driven with LibUV and ZeroMQ
Event Driven with LibUV and ZeroMQ
 
Logic programming in python
Logic programming in pythonLogic programming in python
Logic programming in python
 
Run rmi
Run rmiRun rmi
Run rmi
 
Os Worthington
Os WorthingtonOs Worthington
Os Worthington
 
Yacc (yet another compiler compiler)
Yacc (yet another compiler compiler)Yacc (yet another compiler compiler)
Yacc (yet another compiler compiler)
 
OIVM
OIVMOIVM
OIVM
 
Yacc topic beyond syllabus
Yacc   topic beyond syllabusYacc   topic beyond syllabus
Yacc topic beyond syllabus
 
Elixir
ElixirElixir
Elixir
 
Pascal Programming Language
Pascal Programming LanguagePascal Programming Language
Pascal Programming Language
 
Lex tool manual
Lex tool manualLex tool manual
Lex tool manual
 
Yacc
YaccYacc
Yacc
 
Basic buffer overflow part1
Basic buffer overflow part1Basic buffer overflow part1
Basic buffer overflow part1
 

Andere mochten auch

The mystique of erlang
The mystique of erlangThe mystique of erlang
The mystique of erlang
Carob Cherub
 
Lightning Talk: Erlang on Xen - Mikhail Bortnyk
Lightning Talk: Erlang on Xen - Mikhail BortnykLightning Talk: Erlang on Xen - Mikhail Bortnyk
Lightning Talk: Erlang on Xen - Mikhail Bortnyk
Elixir Club
 

Andere mochten auch (20)

The mystique of erlang
The mystique of erlangThe mystique of erlang
The mystique of erlang
 
Ruby Code Optimizations (for beginners)
Ruby Code Optimizations (for beginners)Ruby Code Optimizations (for beginners)
Ruby Code Optimizations (for beginners)
 
Testing an Erlang Backend
Testing an Erlang BackendTesting an Erlang Backend
Testing an Erlang Backend
 
Spilgames Storage Platform
Spilgames Storage PlatformSpilgames Storage Platform
Spilgames Storage Platform
 
PropErty based testing
PropErty based testingPropErty based testing
PropErty based testing
 
A Web Widget Platform
A Web Widget PlatformA Web Widget Platform
A Web Widget Platform
 
A Widget Based Web Platform
A Widget Based Web PlatformA Widget Based Web Platform
A Widget Based Web Platform
 
Learn You Some Erlang for great good! 日本語化プロジェクト
Learn You Some Erlang for great good! 日本語化プロジェクトLearn You Some Erlang for great good! 日本語化プロジェクト
Learn You Some Erlang for great good! 日本語化プロジェクト
 
Clojure Reducers / clj-syd Aug 2012
Clojure Reducers / clj-syd Aug 2012Clojure Reducers / clj-syd Aug 2012
Clojure Reducers / clj-syd Aug 2012
 
Monads in Clojure
Monads in ClojureMonads in Clojure
Monads in Clojure
 
Caching Strategies for an Erlang Based Web Stack
Caching Strategies for an Erlang Based Web StackCaching Strategies for an Erlang Based Web Stack
Caching Strategies for an Erlang Based Web Stack
 
BEAMing With Joy
BEAMing With JoyBEAMing With Joy
BEAMing With Joy
 
learn you some erlang - chap0 to chap2
learn you some erlang - chap0 to chap2learn you some erlang - chap0 to chap2
learn you some erlang - chap0 to chap2
 
Erlang Concurrency
Erlang ConcurrencyErlang Concurrency
Erlang Concurrency
 
Elixir basics
Elixir basicsElixir basics
Elixir basics
 
Lightning Talk: Erlang on Xen - Mikhail Bortnyk
Lightning Talk: Erlang on Xen - Mikhail BortnykLightning Talk: Erlang on Xen - Mikhail Bortnyk
Lightning Talk: Erlang on Xen - Mikhail Bortnyk
 
Introduction to Couchbase Server 2.0
Introduction to Couchbase Server 2.0Introduction to Couchbase Server 2.0
Introduction to Couchbase Server 2.0
 
Why erlang
Why erlangWhy erlang
Why erlang
 
Erlang on OSv
Erlang on OSvErlang on OSv
Erlang on OSv
 
A Beginners Guide to Erlang_Erlang Factory Lite_Munich 2013
A Beginners Guide to Erlang_Erlang Factory Lite_Munich 2013A Beginners Guide to Erlang_Erlang Factory Lite_Munich 2013
A Beginners Guide to Erlang_Erlang Factory Lite_Munich 2013
 

Ähnlich wie Erlang Developments: The Good, The Bad and The Ugly

Introduction To Erlang Final
Introduction To Erlang   FinalIntroduction To Erlang   Final
Introduction To Erlang Final
SinarShebl
 
Keynote joearmstrong
Keynote joearmstrongKeynote joearmstrong
Keynote joearmstrong
Sentifi
 
Erlang plus BDB: Disrupting the Conventional Web Wisdom
Erlang plus BDB: Disrupting the Conventional Web WisdomErlang plus BDB: Disrupting the Conventional Web Wisdom
Erlang plus BDB: Disrupting the Conventional Web Wisdom
guest3933de
 
Magic Clusters and Where to Find Them 2.0 - Eugene Pirogov
Magic Clusters and Where to Find Them 2.0 - Eugene Pirogov Magic Clusters and Where to Find Them 2.0 - Eugene Pirogov
Magic Clusters and Where to Find Them 2.0 - Eugene Pirogov
Elixir Club
 
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program DevelopmenKostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Konstantin Sorokin
 

Ähnlich wie Erlang Developments: The Good, The Bad and The Ugly (20)

Erlang, an overview
Erlang, an overviewErlang, an overview
Erlang, an overview
 
Introduction To Erlang Final
Introduction To Erlang   FinalIntroduction To Erlang   Final
Introduction To Erlang Final
 
Introduction to Erlang/(Elixir) at a Webilea Hands-On Session
Introduction to Erlang/(Elixir) at a Webilea Hands-On SessionIntroduction to Erlang/(Elixir) at a Webilea Hands-On Session
Introduction to Erlang/(Elixir) at a Webilea Hands-On Session
 
Elixir and elm
Elixir and elmElixir and elm
Elixir and elm
 
Keynote joearmstrong
Keynote joearmstrongKeynote joearmstrong
Keynote joearmstrong
 
Erlang plus BDB: Disrupting the Conventional Web Wisdom
Erlang plus BDB: Disrupting the Conventional Web WisdomErlang plus BDB: Disrupting the Conventional Web Wisdom
Erlang plus BDB: Disrupting the Conventional Web Wisdom
 
Disrupt
DisruptDisrupt
Disrupt
 
Hierarchical free monads and software design in fp
Hierarchical free monads and software design in fpHierarchical free monads and software design in fp
Hierarchical free monads and software design in fp
 
Magic Clusters and Where to Find Them - Eugene Pirogov
Magic Clusters and Where to Find Them - Eugene PirogovMagic Clusters and Where to Find Them - Eugene Pirogov
Magic Clusters and Where to Find Them - Eugene Pirogov
 
Online test program generator for RISC-V processors
Online test program generator for RISC-V processorsOnline test program generator for RISC-V processors
Online test program generator for RISC-V processors
 
Magic Clusters and Where to Find Them 2.0 - Eugene Pirogov
Magic Clusters and Where to Find Them 2.0 - Eugene Pirogov Magic Clusters and Where to Find Them 2.0 - Eugene Pirogov
Magic Clusters and Where to Find Them 2.0 - Eugene Pirogov
 
Introduction to Elixir
Introduction to ElixirIntroduction to Elixir
Introduction to Elixir
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash Cracking
 
The why and how of moving to php 7
The why and how of moving to php 7The why and how of moving to php 7
The why and how of moving to php 7
 
Improved Reliable Streaming Processing: Apache Storm as example
Improved Reliable Streaming Processing: Apache Storm as exampleImproved Reliable Streaming Processing: Apache Storm as example
Improved Reliable Streaming Processing: Apache Storm as example
 
NDC London 2014: Erlang Patterns Matching Business Needs
NDC London 2014: Erlang Patterns Matching Business NeedsNDC London 2014: Erlang Patterns Matching Business Needs
NDC London 2014: Erlang Patterns Matching Business Needs
 
Elixir introduction
Elixir introductionElixir introduction
Elixir introduction
 
The why and how of moving to php 7.x
The why and how of moving to php 7.xThe why and how of moving to php 7.x
The why and how of moving to php 7.x
 
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program DevelopmenKostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
 
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go WrongJDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
JDD 2016 - Grzegorz Rozniecki - Java 8 What Could Possibly Go Wrong
 

Kürzlich hochgeladen

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Kürzlich hochgeladen (20)

Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 

Erlang Developments: The Good, The Bad and The Ugly

  • 1. Erlang Developments Enrique Paz @quiquepaz 1/22
  • 2. Introduction About me Erlang Developer since 2008 Developing voteraise.com in Ocaml Trying tech leadership @KPN 2/22
  • 3. Introduction Disclaimer sort_for_talk([Good,Bad,Ugly])- [Bad,Ugly,Good]. All comments to come are personal opinions. Read others’ in the WWW before making up your own 3/22
  • 5. The Bad (Un)Suitability Erlang is not a silver bullet Number Crunching Text/String Processing XML and SOAP based Web Services “All can be done given time and money” - Ferenc Holzhauser 5/22
  • 6. The Bad Learning Curve Design: Processes VS Objects I Technical knowledge required I Domain knowledge is harder to map Functional Programming I Awesome (if you’ve felt the imperative pain) I Risk of callback hell 6/22
  • 7. The Bad What has improved Learn You Some Erlang Erlang Solutions Webinars Erlang OTP in Action Designing for Scalability with Erlang OTP 7/22
  • 9. The Ugly Syntax Erlang myfun(Opts) - What = proplists:get_value(what,Opts,some), io:format(Doing ~s~n, [What]), L = [1, 2, 3], lists:foldl(fun(X, Acc) - X + Acc end, 0, L). 9/22
  • 10. The Ugly Syntax Erlang myfun(Opts) - What = proplists:get_value(what,Opts,some), io:format(Doing ~s~n, [What]), L = [1, 2, 3], lists:foldl(fun(X, Acc) - X + Acc end, 0, L). Python myfun(what=some): print (Doing {thing}.format(thing=what) l = [1, 2, 3,], return reduce(lambda x, y: x + y, l, 0) 9/22
  • 11. The Ugly (lack of) Typesystem Erlang myfold(F, Acc, []) - Acc; myfold(F, Acc, [H|T]) - myfold(F, F(H,Acc), T). myfold(fun(X) - X + 1 end, 0, [1, 2, 3]). % Error on runtime!! 10/22
  • 12. The Ugly (lack of) Typesystem Erlang myfold(F, Acc, []) - Acc; myfold(F, Acc, [H|T]) - myfold(F, F(H,Acc), T). myfold(fun(X) - X + 1 end, 0, [1, 2, 3]). % Error on runtime!! Ocaml let rec myfold f acc = function | [] - Acc | h::t - myfold f (f h acc) t # val myfold:(’a -’b-’b)-’b-’a list-’b=fun myfold (fun x - x+1) 0 [1;2;3] # Compilation error!! (could have used (+)) 10/22
  • 13. The Ugly What has improved Elixir: a new language for the Erlang VM def myfun(what ’some’) do IO.puts Doing #{what} l = [1, 2, 3] List.foldl l, 0, (1 + 2) end 11/22
  • 14. The Ugly What has improved Elixir: a new language for the Erlang VM def myfun(what ’some’) do IO.puts Doing #{what} l = [1, 2, 3] List.foldl l, 0, (1 + 2) end I Direct mixing of Erlang and Elixir code I Ruby-like syntax I Adoption? 11/22
  • 15. The Ugly What has improved Dialyzer: Static type analyzer for Erlang code -type opt()::{what, string()}. -spec my_fun([opt()]) - pos_integer(). 12/22
  • 16. The Ugly What has improved Dialyzer: Static type analyzer for Erlang code -type opt()::{what, string()}. -spec my_fun([opt()]) - pos_integer(). I Improved error catching I Improved error reporting I Ideally, all the code you use should be typed I Still no support for ETS and debugger match_specs I Dialyxir for Elixir projects 12/22
  • 18. The Good Less Code Functional = re-usability OTP framework: structure and patterns In code assertions / Let it crash ok = file:write_file(MyFile, Hello!) Bit syntax ?IP_VERSION:4, HLen:4, SrvcType:8, TotLen:16, ID:16, Flgs:3, FragOff:13, TTL:8, Proto:8, HdrChkSum:16, SrcIP:32, DestIP:32, RestDgram/binary = IpPkg 14/22
  • 19. The Good Less Engineers High engineering level I Not trivial to learn I Usually not the 1st language The WhatsApp example: I 450M users I 25 Engineers building client Apps I 6 Erlang Engineers building the server I 75M users / Erlang Engineer 15/22
  • 20. The Good Highly Available Availability1 of Erlang based telephone switches in late 1980s AXD301 reported 9.99999999% (nine nines) availability 0.6 seconds per 20 years 1Joe Armstrong: http://pragprog.com/articles/erlang 16/22
  • 21. The Good Highly Available Supervision trees provide automatic recovery No downtime system upgrades 1. Create appup 2. Generate relup 3. Deploy relup 4. Instruct target system to upgrade itself 17/22
  • 22. The Good Scalable Light Parallel processes I Quick to create: 660K processes/sec I 300 words / standard process (2.4KB) I No shared memory 2 I 1 process per: user session, HTTP call. . . Well known bottlenecks I gen_server serialization I Long lived NIFs I Disk I/O 2almost 18/22
  • 23. The Good The community Erlang Mailing List Erlang Central LIVE chat Erlang Camp Erlang Factory (San Francisco) Erlang User Conference (Stockholm) Erlang Factory Lite: Berlin, Moscow, NY, Paris, Chicago. . . 19/22
  • 24. The Good What has improved Forced wake up (+sfwi) for schedulers ETS concurrency enif_schedule_nif/0 for partitioned NIF invocation Scalability on multicore (RELEASE) And a ton of awesome applications: I Nifty I Cowboy I Concuerror I Piqi I . . . and, of course. . . 20/22
  • 25. The Good What has improved 21/22