Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Elixir - a brief intro for pythonistas
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Eleni Lixourioti
March 25, 2019
Programming
69
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Elixir - a brief intro for pythonistas
Lightning talk given at Python DBBUG.
Credit on last slide.
Eleni Lixourioti
March 25, 2019
More Decks by Eleni Lixourioti
See All by Eleni Lixourioti
GDPR + Django Model Collector
geekfish
0
260
Intro to Python
geekfish
0
95
Other Decks in Programming
See All in Programming
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
190
AmebaブログはKMPから卒業します
kmars0605
0
240
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
940
ActionController meets Protocol Buffers
sorah
0
700
ジョジョの世界をXRで再現する
mofurune
0
190
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.4k
最近”作らせてる” ローカルAIアプリの話
akit37
0
500
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
240
残高管理から台帳サービスへの進化
artoy
1
210
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.8k
AIに “答え“を書かせるのを やめてみた
___akari11
0
130
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
210
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
580
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
860
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
47k
Speed Design
sergeychernyshev
33
2.2k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Optimising Largest Contentful Paint
csswizardry
37
4k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
880
Transcript
Elixir a brief intro for pythonistas
Disclaimer...
Elixir
None
Elixir • General Purpose • Dynamic • Functional • "Expressive"
• OTP (Erlang libraries and VM) • interoperability • ! Concurrency !
! Concurrency • EVM processes (not OS processes) • Like
super tiny threads... • ...but no shared state! • Easy to spawn • Actor Model • Supervisors (it's processes all the way down...)
Show me the code
Python def hello(name): print(f"Hello, {name}") Elixir defmodule MyApp.Greetings do def
hello(name) do IO.puts("Hello, #{name}") end end hello("Linda") # Both hello "Linda" # Elixir only ;)
Other familiar things: • Similar data structures (the immutable version)
• Operations, comparisons... • Docstrings • Interactive interpreter • Exception handling (kind of...) • Comprehensions • Unicode support
def update_profile_from_api(url): response = requests.get(url) raw_profile = response.json() profile =
parse_profile(raw_profile) return store(profile) vs def update_profile_from_api(url) do response = HTTPoison.get!(url) raw_profile = Poison.decode!(response.body) profile = parse_profile(raw_profile) store(profile) end
✨ New stuff
Pipes
Pipes def update_profile_from_api(url) do response |> HTTPoison.get! |> Map.get(:body) |>
Poison.decode! |> parse_profile |> store end
Atoms # Standalone: :ok :error # Map keys responses =
%{ :ok => 200 } # instead of %{ "ok" => 200 } responses = %{ ok: 200 } IO.puts(responses.ok)
Many more shiny things • Processes as a core feature
• Macros (make your own DSLs!) • Increasingly evolving package ecosystem (Phoenix, Ecto, Nerves...) • Erlang's mature, battle tested, ecosystem
Is python not enough?
well...
Celery fatigue • Very mature but... • ...the hammer that
fixes everything • Opaque?
Real time? • I want to use all my cores
• Sockets please • The real world is concurrent • The real world has no GIL
Functional Python? • Limited toolset • lambdas are not enough
• second class citizen
Second class citizen? Preventing mutation... def update_a_thing(thing): new_thing = thing.copy()
new_thing.update("foo": "should I use deepcopy instead?") return new_thing
Impromptu pattern-matching-single-dispatch- thing... def render(response): return { 200: _render_succesful, 400:
_render_bad_request, 403: _render_forbidden, 404: _render_not_found, }[response.status](response) def _render_successful(response): return "OK" def _render_bad_request(response): return "Such and such things are wrong: " + response.errors
Elixir def render(%{status: 200}) do "OK" end def render(%{status: 400}
= response) do "Such and such things are wrong: " <> response.error_msg end def render(%{status: 403}) do "The FBI has been dispatched" end def render(%{status: 404}) do "Not Found" end
Python is still great ❤ • But maybe you are
curious about other tools • BONUS: You can use it with Elixir using Erlport
Thank you! • Questions • Read more: https://elixir-lang.org/ https://elixirschool.com/en/ Eleni
Lixourioti
[email protected]
@geekfish_
Credits Icons made by - Smashicons - Flat Icons and
- Freepik from www.flaticon.com, and are licensed CC 3.0 BY