0
Erlang“Software for a concurrent world”        CWI Amsterdam      Arjan Scherpenisse      14 december 2012    arjan@miracl...
Agenda●   Intro●   Language essentials●   Concurrency / failure●   OTP●   VM / GC / optimisations / pitfalls
Erlang Philosophy●   The world is concurrent●   Things in the world dont share data●   Things communicate with messages●  ...
Language essentials
Data types●   Integer / float●   Atoms●   Tuples●   Lists●   Binaries    … so where are strings?
Datatypes (cont)●   Functions●   Pids●   Ports
Concurrency / failure
Concurrency●   spawn, spawn_link●   !, receive
Fundamental pieces
OTP: Open Telecom Platform
OTP●   application    –   Contains independent code, multiple applications        per Erlang node●   supervisor    –   Sup...
GC / optimisation / pitfalls
Performance●   Processes are cheap●   Data copying is expensive●   Handle much of request in single process●   Cache local...
Garbage Collection●   per process, no global gc sweep = no locking     of vm●   can specify per-process initial heap size●...
Common Pitfalls●   Message inbox overflowing●   Atom table injection / crash●   VM tweaks needed for    –   nr of open fil...
Outro
What I mainly use it for●   Full-stack web development    –   http://zotonic.com/●   HA backend systemsPreventing stuff li...
Sources of Inspiration●   Erlang - the ghetto●   Intro to erlang (slideshare)●   Erlang - message passing concurrency (sli...
Thanks!   Arjan Scherpenisse arjan@miraclethings.nlhttp://twitter.com/acscherp  http://miraclethings.nl/
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Erlang: Software for a Concurrent world
Upcoming SlideShare
Loading in...5
×

Erlang: Software for a Concurrent world

594

Published on

Introduction to Erlang for the talk at the Programming Environments Meetup at the Centrum for Mathematics and Computer Science (CWI), December 14, 2012.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
594
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Erlang: Software for a Concurrent world"

  1. 1. Erlang“Software for a concurrent world” CWI Amsterdam Arjan Scherpenisse 14 december 2012 arjan@miraclethings.nl
  2. 2. Agenda● Intro● Language essentials● Concurrency / failure● OTP● VM / GC / optimisations / pitfalls
  3. 3. Erlang Philosophy● The world is concurrent● Things in the world dont share data● Things communicate with messages● Things fail - Joe Armstrong
  4. 4. Language essentials
  5. 5. Data types● Integer / float● Atoms● Tuples● Lists● Binaries … so where are strings?
  6. 6. Datatypes (cont)● Functions● Pids● Ports
  7. 7. Concurrency / failure
  8. 8. Concurrency● spawn, spawn_link● !, receive
  9. 9. Fundamental pieces
  10. 10. OTP: Open Telecom Platform
  11. 11. OTP● application – Contains independent code, multiple applications per Erlang node● supervisor – Supervises worker processes and supervisors● gen_server – Basic work unit
  12. 12. GC / optimisation / pitfalls
  13. 13. Performance● Processes are cheap● Data copying is expensive● Handle much of request in single process● Cache locally in process dict● Reduce size of messages● Bigger binaries (> 64 bytes) are shared and reference counted, make use of them.● String processing is expensive● Keep eye on process inboxes
  14. 14. Garbage Collection● per process, no global gc sweep = no locking of vm● can specify per-process initial heap size● prevent big GCs ● keep big data outside process ● or in process dict ● large binaries = external, use refcounting
  15. 15. Common Pitfalls● Message inbox overflowing● Atom table injection / crash● VM tweaks needed for – nr of open file descriptors – nr of processes – heap size
  16. 16. Outro
  17. 17. What I mainly use it for● Full-stack web development – http://zotonic.com/● HA backend systemsPreventing stuff like this →:-)
  18. 18. Sources of Inspiration● Erlang - the ghetto● Intro to erlang (slideshare)● Erlang - message passing concurrency (slideshare)● Erlang concepts (slideshare)● Concurrency and Paralellism in Erlang (hopkins univ)
  19. 19. Thanks! Arjan Scherpenisse arjan@miraclethings.nlhttp://twitter.com/acscherp http://miraclethings.nl/
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×