Elixir Flashcards
terminal line for the console?
iex
Framework used with Elixir?
Phoenix
Which virtual machine do Elixir programs compile to?
Erlang
How do Erlang and Elixir work together?
The Erlang VM runs as one operating system process, and by default runs one OS thread per core. Elixir programs use all CPU cores.
Why is Erlang faster than other platforms?
Erlang is faster than other platforms because it doesn’t allow mutability or shared memory by default.
Erlang is a _____ programming language.
functional
How does functional programming treat computation?
As the evaluation of functions, and avoids mutable state and data. immutable data structures and single assignment variables
Main difference between Obeject & Functional Programming?
Object doesn’t enforce isolated state. Values can be mutated in place. Functional has immutable data structures and single assignment variables
What is the Elixir match operator?
the = operator is the match operator. It enables us to assign and then match values
iex> {a, b, 42} = {:hello, “world”, 42}
What is Mix and what does it do?
it’s an Elixir development tool
Creates projects
Compiles projects
Runs ‘tasks’ (i.e running tests or generating documentation)
Manages dependencies
What is the CL for generating new Elixir project?
mix new name-of-project
How is code organized in Elixir?
In modules. A collection of different methods or functions.
CL to compile and run your project in the Elixir console?
iex -S mix
What is CL to access the Elixir console?
iex = interactive Elixir shell
How do you call a method on a module?
with .
you can use or leave out the parentheses
Cards.hello
Cards.hello()