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

Erlang (GeekTalks)

Erlang (GeekTalks)

Erlang talk at GeekTalks event
https://www.facebook.com/events/924154260964782/

Oleg Zinchenko

October 08, 2015
Tweet

More Decks by Oleg Zinchenko

Other Decks in Programming

Transcript

  1. Specific use cases Non OOP paradigm Naive syntax No so

    big community Lack of libs Pros / Cons https://www.erlang-solutions.com/ https://synrc.com/ https://github.com/tapsters https://github.com/erlangbureau
  2. Low level thinking! Functional Fast Robust Expressive syntax Endless running

    apps Update code on a fly Own Scheduler Processes based architecture Supervisor tree No shared memory Pros / Cons
  3. High order functions Lambda functions Separation data and functions Immutable

    Lazy Tail recursion Algebraic data types Pattern matching Functional https://twitter.com/nikitonsky http://tonsky.me/talks/2015-frontendconf/ http://tonsky.me/talks/2015-codefest/
  4. Basics Integer 42 Float 4.2 aka double Atom ok Binary

    <<"Erlang-powa">> Reference #Ref<0.0.0.29> Pid <0.0.42> Port #Port<0.42> Fun #Fun<erl_eval.6.82930912>
  5. Basics2 List [<<42,1,0,90>>, 1, ok] Tuple {<0.0.16>, 107, 42, ["madness",

    true]} we can force lists type and typify turples named tuples =:= records
  6. Example -module(fib). -export([fib/1]). fib(N) when N > 0 -> fib(N,

    1, 0, 1). fib(1, _, _, _) -> 1; fib(2, _, _, _) -> 1; fib(N, N, _, Prev) -> Prev; fib(N, C, Prev2, Prev) -> fib(N, C+1, Prev, Prev2+Prev).
  7. Example QuickSort qsort([]) -> []; qsort([X|Xs]) -> qsort([Y || Y<-Xs,

    Y <= X]) ++ [X] ++ qsort([Y || Y<-Xs, Y > X]).
  8. Application Examples Web Sites Rest Services Video Streaming Chats RabbitMQ

    Riak, CouchDB, Hibari, KAI, LeoFS, Mnesia ejabberd Cowboy Wings 3D PrivatBank Github Pages / Gist