Erlang: Software for a Concurrent world
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Erlang: Software for a Concurrent world

on

  • 992 views

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

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

Statistics

Views

Total Views
992
Views on SlideShare
884
Embed Views
108

Actions

Likes
0
Downloads
10
Comments
0

3 Embeds 108

http://miraclethings.nl 105
http://f173840e.theseforums.com 2
http://cd0b8b55.dyo.gs 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Erlang: Software for a Concurrent world Presentation Transcript

  • 1. Erlang“Software for a concurrent world” CWI Amsterdam Arjan Scherpenisse 14 december 2012 arjan@miraclethings.nl
  • 2. Agenda● Intro● Language essentials● Concurrency / failure● OTP● VM / GC / optimisations / pitfalls
  • 3. Erlang Philosophy● The world is concurrent● Things in the world dont share data● Things communicate with messages● Things fail - Joe Armstrong
  • 4. Language essentials
  • 5. Data types● Integer / float● Atoms● Tuples● Lists● Binaries … so where are strings?
  • 6. Datatypes (cont)● Functions● Pids● Ports
  • 7. Concurrency / failure
  • 8. Concurrency● spawn, spawn_link● !, receive
  • 9. Fundamental pieces
  • 10. OTP: Open Telecom Platform
  • 11. OTP● application – Contains independent code, multiple applications per Erlang node● supervisor – Supervises worker processes and supervisors● gen_server – Basic work unit
  • 12. GC / optimisation / pitfalls
  • 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. 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. Common Pitfalls● Message inbox overflowing● Atom table injection / crash● VM tweaks needed for – nr of open file descriptors – nr of processes – heap size
  • 16. Outro
  • 17. What I mainly use it for● Full-stack web development – http://zotonic.com/● HA backend systemsPreventing stuff like this →:-)
  • 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. Thanks! Arjan Scherpenisse arjan@miraclethings.nlhttp://twitter.com/acscherp http://miraclethings.nl/