Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Elixir Mini Introduction for Zürich Meetup
Stefan Wintermeyer
February 20, 2017
Technology
0
97
Elixir Mini Introduction for Zürich Meetup
Stefan Wintermeyer
February 20, 2017
Tweet
Share
More Decks by Stefan Wintermeyer
See All by Stefan Wintermeyer
The Greener Gras
wintermeyer
0
60
Rails vs. Phoenix vs. Hanami
wintermeyer
0
970
RubyConfBy 2018 talk about WebPerformance with Rails 5.2
wintermeyer
3
180
WebPerformance für Reiseblogger
wintermeyer
0
84
WebPerformance with Rails 5.2
wintermeyer
5
660
FrOSCon 2017 talk about vutuv
wintermeyer
0
280
Lonestar ElixirConf 2017 talk about vutuv and Phoenix
wintermeyer
1
270
WebPerformance Meetup in Cologne (Feb. 2017)
wintermeyer
1
130
WebPerformance - Autobahn oder Fussgängerzone
wintermeyer
1
390
Other Decks in Technology
See All in Technology
開発環境のセキュリティおよびCI/CDパイプラインのセキュア化
rung
PRO
12
5.2k
ここが好きだよAWS管理ポリシー_devio2022/i_am_iam_lover
yukihirochiba
0
3.3k
Azure DevOps Online Vol.6 - 業務で必要なCIをみんなで考えよう
kkamegawa
0
290
合同IT企業説明会から学ぶエンジニア向けの広報戦略
nagutabby
1
250
Dangerous attack paths: Modern Development Environment Security - Devices and CI/CD pipelines
rung
PRO
0
180
Step-by-Step MLOps and Microsoft Products
shisyu_gaku
2
610
CityGMLとFBXの連携で地理空間のエンタメ化
soh_mitian
0
770
漫画で使えそうな背景画像をblenderを使って作ってみた!
nokonoko1203
1
340
サイバー攻撃を想定したクラウドネイティブセキュリティガイドラインとCNAPP及びSecurity Observabilityの未来
syoshie
2
1.5k
GCCP Creator @ COSCUP 2022
line_developers_tw
PRO
0
1.4k
ログ集約基盤をCloudWatchからOpenSearchに変えてみた
yuhta28
0
140
Power BI のうらがわ
hanaseleb
1
170
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
499
110k
How New CSS Is Changing Everything About Graphic Design on the Web
jensimmons
213
11k
How GitHub (no longer) Works
holman
297
140k
Code Review Best Practice
trishagee
44
9.7k
JazzCon 2018 Closing Keynote - Leadership for the Reluctant Leader
reverentgeek
173
8.6k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
11
4.9k
Navigating Team Friction
lara
175
11k
The MySQL Ecosystem @ GitHub 2015
samlambert
239
11k
10 Git Anti Patterns You Should be Aware of
lemiorhan
638
53k
Fontdeck: Realign not Redesign
paulrobertlloyd
73
4.1k
From Idea to $5000 a Month in 5 Months
shpigford
373
44k
Building Applications with DynamoDB
mza
84
4.8k
Transcript
Elixir Stefan Wintermeyer @wintermeyer
Elixir is a functional, concurrent, general-purpose programming language that runs
on the Erlang virtual machine (BEAM). https://en.wikipedia.org/wiki/Elixir_(programming_language)
defmodule ModuleName do def hello do IO.puts "Hello World" end
end http://elixir-lang.org/crash-course.html
IEx Elixir’s interactive shell
None
Why would I want to learn Elixir? Why invest the
time and effort? I’m happy with Ruby and OO.
Three Main Reasons Spoiler Alert: Concurrency is not one of
them.
1. Speed Elixir runs circles around Ruby and Python.
2. Stability Speed is nothing without stability.
3. Hot-Code Upgrades Zero Downtime!
Some Code Examples
Assigning Values to Variables
iex(1)> a = 1 1 iex(2)>
iex(1)> a = 1 1 iex(2)> a = 2 2
iex(3)>
iex(1)> a = 1 1 iex(2)> a = 2 2
iex(3)> ^a = 3 ** (MatchError) no match of right hand side value: 3
Tuples
iex(1)> {a, b, c} = {10, 20, 30} {10, 20,
30} iex(2)>
iex(1)> {a, b, c} = {10, 20, 30} {10, 20,
30} iex(2)> a 10 iex(3)>
Pattern Matching
iex(1)> {a, b, c} = {10, 20, 30} {10, 20,
30} iex(2)>
iex(1)> {a, b, c} = {10, 20, 30} {10, 20,
30} iex(2)> {a, 20, c} = {10, 20, 30} {10, 20, 30} iex(3)>
iex(1)> {a, b, c} = {10, 20, 30} {10, 20,
30} iex(2)> {a, 20, c} = {10, 20, 30} {10, 20, 30} iex(3)> {a, 1, c} = {10, 20, 30} ** (MatchError) no match of right hand side value: {10, 20, 30}
If you want to get your feed wet with Elixir
I recommend two projects.
If you like hardware try http://nerves-project.org
None
If you like the web try www.phoenixframework.org
None
Phoenix Framework Productive. Reliable. Fast. Phoenix != Rails
None
mix phoenix.new blog Y cd blog vim config/dev.exs brew install
postgres brew services start postgres createuser -W --createdb blog demo mix ecto.create mix phoenix.gen.html Post posts subject body vim web/router.ex resources "/posts", PostController mix ecto.migrate mix phoenix.server Blog Example
Thank you! @wintermeyer