Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

The mystique of erlang

2,684 views

Published on

Published in: Technology, News & Politics
  • Be the first to comment

The mystique of erlang

  1. 1. © 2010 Shivercube “Do you hear that, Mr. Anderson?That is the sound of inevitability.” - Agent Smith
  2. 2. © 2010 Shivercube “HelloWorld”. or -module(hello). -export([start/0]). start() -> io:format(“HelloWorld~n”).
  3. 3. © 2010 Shivercube  Makes hard things easy  But also makes easy things hard  Virtual machine called BEAM  Brutally efficient, and brutally ugly  Based on Prolog
  4. 4. © 2010 Shivercube  Cloud-based databases  CouchDB  SimpleDB  Facebook Chat  GitHub egitd  Yaws  Wings 3D
  5. 5. © 2010 Shivercube  Functional programming language  Dynamic typing  Built for concurrency  Extremely reliable  No threading  Lightweight processes  “Let it crash” mantra  Hot-swappable code
  6. 6. © 2010 Shivercube  Programs built entirely out of functions  No objects anywhere  Functions are first-class citizens  Functions usually return the same values, given the same inputs  Functions usually do not have side effects  They usually not modify program state  Variables can only be assigned to once
  7. 7. © 2010 Shivercube -module(hellov2). -export([start/0]). start() -> spawn(fun() -> loop() end). loop() -> receive hello -> io:format(“Hello World~n”), loop(); goodbye -> ok end.
  8. 8. © 2010 Shivercube  Reality hurts  Concurrency is hard  We’ve been using the wrong programming model ▪ Functions and methods with side effects ▪ Threads with shared state
  9. 9. © 2010 Shivercube  Share-nothing processes  Side effect free  Concurrency primitives  Sending messages (!)  Spawning messages (spawn)  Receiving messages (receive)
  10. 10. © 2010 Shivercube  Makes hard things easy and easy things hard  Prolog-style syntax alien to most  Functional programming paradigm  Extremely efficient  Extremely reliable  “Let it crash” philosophy simplifies code  Dynamic typing results in better productivity  Simple concurrency  Hot swapping code
  11. 11. © 2010 Shivercube  Erlang Programming http://www.erlang.org/  Erlang (programming language) http://en.wikipedia.org/wiki/Erlang_(program ming_language)  The *Real* Erlang "Hello,World!“ http://egarson.blogspot.com/2008/03/real- erlang-hello-world.html  Erlang for C, C++ and Java Programmers http://tamale.net/erlang/tutorial.shtml

×