dive into elixir

27
Dive Into Elixir Alexei Sholik December 10, 2013 @ Build Stuff

Upload: pngobiro

Post on 04-Dec-2015

19 views

Category:

Documents


0 download

DESCRIPTION

Elixir introduction

TRANSCRIPT

Dive Into Elixir Alexei Sholik

December 10, 2013 @ Build Stuff

About me

Hi, I'm Alex

I do mainly C++ / Objective-C / game dev for aliving

I've been involved in Elixir development since2012 (occasionally)

About this talk

1. What is Elixir?2. Macros3. The future

What is Elixir?

Definition:"Elixir is a functional, meta-

programming aware language builton top of the Erlang VM."

What is Elixir?Opinions:

"Erlang with Ruby syntax?"

"Syntactic sugar for Erlang?"

"Erlang already has macros. Whyanother language?"

What Elixir is

Definition (redux):"Elixir is a functional, meta-

programming aware language builton top of the Erlang VM."

What Elixir is Nice, readable and writeable syntax

What Elixir isA friendly REPL

What Elixir isSmall and powerful stdlib

What Elixir isElixir is extensible (1)

github.com/dynamo/dynamo

What Elixir isElixir is extensible (2)

github.com/meh/jazz

What Elixir isTransparent access to all Erlang VM facilities

And finally

Elixir is fun

Macros

Did you know?

Macros

Meta-programming in Erlang:parse transforms

myfun({command, X}, Args) -> io:format("Command: ~p, Args: ~p", [X, Args]).

{function,4,myfun,2, [{clause,4, [{tuple,4,[{atom,4,command},{var,4,'X'}]},{var,4,'Args'}], [], [{call,5, {remote,5,{atom,5,io},{atom,5,format}}, [{string,5,"Command: ~p, Args: ~p"}, {cons,5,{var,5,'X'}, {cons,5,{var,5,'Args'},{nil,5}}}]}]}]}

See for examplesYurii Rashkovskyi's talk

MacrosMeta-programming in Erlang:

use at your own risk

Macros

Meta-programming in Elixir

is better studied in its natural habitat

Macros

In summary: quite a useful tool

Things I left outdetails about protocolsrecordsmix – project manager and build toolerror handling (stick to Erlang style)typespecs and Dyalizerdocumentation on quote

Useful links

(screencasts) (newsletter)

elixir-lang.orgreference docsthe wikielixirsips.comelixir-fountain.com

The future

Elixir is gradually approaching 1.0

The community and the ecosystem are growing atan increasing rate

Introductory learning material is plenty (tutorials,blogs, two books in early access)

The future

Advanced documentation is still lacking

Use in production is modest

I personally hope to see and develop into something real

ElixirWerkz BEAMcommunity

The futureThe vision:

more convenient

more productive

more fun experience

when building applications for the Erlang VM

Erlang VM

At run time, it's Erlang all the way down

Erlang VM

Elixir <X> are Erlang <X>

:erlang.binary_to_list("abc") # Erlang list|> String.from_char_list! # UTF-8 binary|> :erlang.is_binary # true

Erlang VMTherefore, Elixir lets you build

concurrent

fault-tolerant

scalable

highly available

applications

Thank you

Questions?

@true_droid

github.com/alco