Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What Perl Should Steal From Erlang

What Perl Should Steal From Erlang

A lightning talk about what Perl should steal from Erlang.

Jade Allen

June 14, 2012
Tweet

More Decks by Jade Allen

Other Decks in Programming

Transcript

  1. What not to steal 1> [83,116,114,105,110,103] == "String". true 1>

    A = {ok, foo}. {ok,foo} 2> if A =:= [] -> undefined; true -> wtf end. wtf
  2. What not to steal 1> [83,116,114,105,110,103] == "String". true 1>

    A = {ok, foo}. {ok,foo} 2> if A =:= [] -> undefined; true -> wtf end. wtf
  3. Still a lot of goodness! Spawn • Make a new process

    locally or on another node (Honey badger don't care) • Lots of awesome patterns to deal with process pools
  4. Still a lot of goodness! Supervisors • Monitor processes including other

    supervisors (maybe) • Restart them when they die (or not)
  5. Still a lot of goodness! Supervisors • Monitor processes including other

    supervisors (maybe) • Restart them when they die (or not) http://flic.kr/p/6Mkcdh
  6. Still a lot of goodness! Supervisors • Monitor processes including other

    supervisors (maybe) • Restart them when they die (or not) • POE::Component::Supervisor
  7. Still a lot of goodness! Supervisors • Monitor processes including other

    supervisors (maybe) • Restart them when they die (or not)
  8. Still a lot of goodness! Crash on failure • Idiomatic Erlang

    isn't defensively coded • Idiomatic Erlang crashes (hopefully with a nice stacktrace) and its supervisor restarts it for more abuse^H^H^H^H^H work.
  9. Still a lot of goodness! Crash on failure • Idiomatic Erlang

    isn't defensively coded • Idiomatic Erlang crashes (hopefully with a nice stacktrace) and its supervisor restarts it for more abuse^H^H^H^H^H work. http://flic.kr/p/a9GjkM
  10. Still a lot of goodness! Crash on failure • Idiomatic Erlang

    isn't defensively coded • Idiomatic Erlang crashes (hopefully with a nice stacktrace) and its supervisor restarts it for more abuse^H^H^H^H^H work. • autodie
  11. Still a lot of goodness! Crash on failure • Idiomatic Erlang

    isn't defensively coded • Idiomatic Erlang crashes (hopefully with a nice stacktrace) and its supervisor restarts it for more abuse^H^H^H^H^H work.
  12. Guards -export([foo/2]). foo(A, B) when is_integer(A) -> frobulate(B); foo(A, B)

    when is_tuple(B) -> frobulate(A); foo(A,B) -> erlang:error(badarg).
  13. Guards -export([foo/2]). foo(A, B) when is_integer(A) -> frobulate(B); foo(A, B)

    when is_tuple(B) -> frobulate(A); foo(A,B) -> erlang:error(badarg).
  14. Guards -export([foo/2]). foo(A, B) when is_integer(A) -> frobulate(B); foo(A, B)

    when is_tuple(B) -> frobulate(A); foo(A,B) -> erlang:error(badarg).