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

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Erlang: Software for a Concurrent world

531
views

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.

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
531
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

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/