A "Hello World" style lightning talk I prepared for a Hello World of programming languages event at work. The goal was to give a rundown of languages we have been playing with and are interested in, and share an overview of the language.
The requirement was to give an overview of the language; where it's weaknesses might lie, as no language is perfect for everything; show FizzBuzz in the presentation to have a baseline, and show off an example of what makes it interesting, which included a demo of the Erlang VM's ability to do live code reloading.
1. Hello, Joe. Hello, Mike;
Hello, Robert.1
A Hello World Style Lighting Talk on Erlang.
1. From Erlang the Movie (https://archive.org/details/ErlangTheMovie)
2. Hello, Erlang.
Erlang and OTP was designed for building
distributed, asynchronous, highly-concurrent, fault
tolerant applications with high availability.
3. Hello, Erlang.
Erlang and OTP was designed for building
distributed, asynchronous, highly-concurrent, fault
tolerant applications with high availability.
#BuzzwordBingo
6. Hello, Telecom.
• 100s of Thousands, if not Millions, of calls
happen at the same time
• Your phone line has to always be available
7. Hello, Telecom.
• 100s of Thousands, if not Millions, of calls
happen at the same time
• Your phone line has to always be available
• My call cannot corrupt your call
13. Hello, Failure.
• In the Real World things fail. Embrace it.
• “Let It Crash” philosophy
14. Hello, Failure.
• In the Real World things fail. Embrace it.
• “Let It Crash” philosophy
• Immutability
15. Hello, Failure.
• In the Real World things fail. Embrace it.
• “Let It Crash” philosophy
• Immutability
• No Shared State
16. Hello, Failure.
• In the Real World things fail. Embrace it.
• “Let It Crash” philosophy
• Immutability
• No Shared State
• Isolated Processes Communicate Through Message Passing
(Actor Model)
17. Hello, Failure.
• In the Real World things fail. Embrace it.
• “Let It Crash” philosophy
• Immutability
• No Shared State
• Isolated Processes Communicate Through Message Passing
(Actor Model)
• Supervision Hierarchy
18. Hello, Failure.
• In the Real World things fail. Embrace it.
• “Let It Crash” philosophy
• Immutability
• No Shared State
• Isolated Processes Communicate Through Message Passing
(Actor Model)
• Supervision Hierarchy
• Live code reloading
26. Hello, “Weaknesses”.
• No strings as a data type
• List of Integers or Binary types
• Not super performant for string manipulation, but good enough for most
scenarios
27. Hello, “Weaknesses”.
• No strings as a data type
• List of Integers or Binary types
• Not super performant for string manipulation, but good enough for most
scenarios
• Not great for GUIs
28. Hello, “Weaknesses”.
• No strings as a data type
• List of Integers or Binary types
• Not super performant for string manipulation, but good enough for most
scenarios
• Not great for GUIs
• Not going to be run on your mobile device;
29. Hello, “Weaknesses”.
• No strings as a data type
• List of Integers or Binary types
• Not super performant for string manipulation, but good enough for most
scenarios
• Not great for GUIs
• Not going to be run on your mobile device;
• but great for you mobile device backend.
30. Hello, “Weaknesses”.
• No strings as a data type
• List of Integers or Binary types
• Not super performant for string manipulation, but good enough for most
scenarios
• Not great for GUIs
• Not going to be run on your mobile device;
• but great for you mobile device backend.
• WhatsApp anyone?
31. Hello, “Weaknesses”.
• No strings as a data type
• List of Integers or Binary types
• Not super performant for string manipulation, but good enough for most
scenarios
• Not great for GUIs
• Not going to be run on your mobile device;
• but great for you mobile device backend.
• WhatsApp anyone?
• Not insanely fast
32. Hello, “Weaknesses”.
• No strings as a data type
• List of Integers or Binary types
• Not super performant for string manipulation, but good enough for most
scenarios
• Not great for GUIs
• Not going to be run on your mobile device;
• but great for you mobile device backend.
• WhatsApp anyone?
• Not insanely fast
• "There's no such thing as fast, only fast enough" ~ Joe Armstrong
34. Hello, fizzbuzz.erl
-module(fizzbuzz).
-export([fizzbuzz/1]).
fizzbuzz(N) ->
Translations = lists:map(fun translate/1, lists:seq(1, N)),
lists:foreach(fun(Item) -> io:format("~s~n", [Item]) end, Translations).
translate(N) when N rem 3 =:= 0 andalso N rem 5 =:= 0 ->
'FizzBuzz';
translate(N) when N rem 3 =:= 0 ->
'Fizz';
translate(N) when N rem 5 =:= 0 ->
'Buzz';
translate(N) ->
integer_to_list(N).
35. Hello, fizzbuzz.ex
defmodule FizzBuzz do
def fizzbuzz(n) do
1..n
|> Enum.map(&translate/1)
|> Enum.join("n")
|> IO.puts
end
def translate(n) when rem(n, 3) == 0 and rem(n, 5) == 0, do: :FizzBuzz
def translate(n) when rem(n, 3) == 0, do: :Fizz
def translate(n) when rem(n, 5) == 0, do: :Buzz
def translate(n), do: n
end