Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Writing Command Line Applications in Elixir
Search
James Smith
July 25, 2014
Programming
7
1.5k
Writing Command Line Applications in Elixir
Using Elixir to solve small problems.
James Smith
July 25, 2014
Tweet
Share
Other Decks in Programming
See All in Programming
メモリ最適化を究める!iOSアプリ開発における5つの重要なポイント
yhirakawa333
0
420
Kotlin 2.0 and Beyond
antonarhipov
2
150
長期運用プロダクトの開発速度を維持し続けるためのリファクタリング実践例
wataruss
8
2.7k
GraphQLの魅力を引き出すAndroidクライアント実装
morux2
3
770
はじめてみよう量子プログラミング
itokoichi01
0
220
Modular Monolith Go Server with GraphQL Federation + gRPC
110y
1
590
Crafting Cross-Platform Adventures: Building a Game Engine with Kotlin Multiplatform
dwursteisen
0
120
The Shape of a Service Object
inem
0
520
状態管理ライブラリZustandの導入から運用まで
k1tikurisu
3
470
サーバーレスで負荷試験!Step Functions + Lambdaを使ったk6の分散実行
shuntakahashi
6
1.6k
LangChainの現在とv0.3にむけて
os1ma
4
930
Pythonで改めて考える「クラス(class)」の使いどころ
os1ma
3
790
Featured
See All Featured
The Cult of Friendly URLs
andyhume
76
6k
Building Your Own Lightsaber
phodgson
101
6k
Building Flexible Design Systems
yeseniaperezcruz
325
38k
Music & Morning Musume
bryan
46
6k
Infographics Made Easy
chrislema
239
18k
The Power of CSS Pseudo Elements
geoffreycrofte
71
5.3k
Ruby is Unlike a Banana
tanoku
96
11k
Building an army of robots
kneath
302
42k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
36
1.7k
Build your cross-platform service in a week with App Engine
jlugia
228
18k
Testing 201, or: Great Expectations
jmmastey
36
7k
Embracing the Ebb and Flow
colly
83
4.4k
Transcript
HELLO SEND(AUDIENCE, {:GREETING, “HELLO!”})
None
None
–interested programmer “I'd love to check out Elixir but I
don't really have a problem that is big enough that Elixir is well suited for.”
None
MASSIVELY CONCURRENT DISTRIBUTED FAULT TOLERANT WEB SCALE FUNCTIONAL
PIPES |> PATTERN MATCHING |> MESSAGE PASSING |> IMMUTABILITY |>
=> {:OK, “ ☺”} ELIXIR OFFERS A DIFFERENT WAY TO THINK ABOUT AND SOLVE PROBLEMS OF ANY SIZE. !
None
WRITING COMMANDLINE APPS WITH ELIXIR
None
None
MIX
DEPENDENCIES Hex package Git/SCM Path Dependency tasks mix deps: “lists
all deps and their status” mix deps.get “Get non installed dependencies” mix deps.compile mix deps.update mix deps.clean “Remove all dependency files” mix deps.unlock “Unlock dependencies”
None
UMBRELLA PROJECTS • Run tasks across apps • Run all
your tests for apps in app_path • Run Applications in dependent order…
MIX TASKS
RUNNING OUR APPS MIX ESCRIPT.BUILD
None
None
None
BASIC IO
TESTING IO
IO.ANSI • escape_fragment(string, emit \\ terminal()) • “%{clear, home, green,
bright} Welcome” • IO.red() IO.green() etc… • home() send the cursor home
FILES AND PATHS • File.open • File.close • File.read •
binread/write utf8 and IO module • File.read vs File.read! • Path.join and Path.expand • Path.wildcard
PORT
BASIC USAGE
DEMO
SCALING UP COMMAND LINE APPS WITH TASKS & AGENTS
TASKS
AGENTS a simple abstraction around state
DEMO DEMO
THANK YOU