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
100
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
88
Rails vs. Phoenix vs. Hanami
wintermeyer
0
1k
RubyConfBy 2018 talk about WebPerformance with Rails 5.2
wintermeyer
3
180
WebPerformance für Reiseblogger
wintermeyer
0
95
WebPerformance with Rails 5.2
wintermeyer
5
700
FrOSCon 2017 talk about vutuv
wintermeyer
0
290
Lonestar ElixirConf 2017 talk about vutuv and Phoenix
wintermeyer
1
300
WebPerformance Meetup in Cologne (Feb. 2017)
wintermeyer
1
140
WebPerformance - Autobahn oder Fussgängerzone
wintermeyer
1
420
Other Decks in Technology
See All in Technology
“Do you have a virtual router?” Discuss how to use virtual routers
line_developers
PRO
0
470
Oktaの管理者権限を適切に移譲してみた
shimosyan
2
240
ついに来る!TypeScript5.0の新機能
uhyo
16
8.8k
エアドロップ for オープンソースプロジェクト
epicsdao
0
190
2022年に起きたフロントエンドの変化
sakito
28
16k
日経電子版だけじゃない! 日経の新規Webメディアの開発 - NIKKEI Tech Talk #3
sztm
0
110
OpenShift.Run2023_create-aro-with-terraform
ishiitaiki20fixer
1
100
Deep dive in Reserved Instance ~脳死推奨量購入からの脱却~
kzkmaeda
0
280
- Rでオブジェクト指向プログラミング- クラス設計入門の入門
kotatyamtema
1
660
CUEとKubernetesカスタムオペレータを用いた新しいネットワークコントローラをつくってみた
hrk091
0
220
アムロは成長しているのか AIから分析する
miyakemito
1
330
PCL (Point Cloud Library)の基本となぜ点群処理か_2023年_第2版.pdf
cvmlexpertguide
0
130
Featured
See All Featured
The Invisible Customer
myddelton
113
12k
Raft: Consensus for Rubyists
vanstee
130
5.7k
Done Done
chrislema
178
14k
Clear Off the Table
cherdarchuk
79
290k
Building a Scalable Design System with Sketch
lauravandoore
451
31k
Support Driven Design
roundedbygravity
88
8.9k
Thoughts on Productivity
jonyablonski
49
2.7k
Streamline your AJAX requests with AmplifyJS and jQuery
dougneiner
128
8.8k
Code Reviewing Like a Champion
maltzj
508
38k
GraphQLとの向き合い方2022年版
quramy
20
9.8k
Agile that works and the tools we love
rasmusluckow
320
20k
Building an army of robots
kneath
301
40k
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