-
Notifications
You must be signed in to change notification settings - Fork 15
7ML7W Elixir Day 2 Controlling Mutations
Intros are made. Bread is dipped. Pringles are stacked. Drinks are drunk.
Time to get into Elixir Day 2 and learn all about macros.
@adzz is our resident Elixir expert (in that unlike the rest of us he does Elixir at work) so he volunteers to lead us through the material both physically and spiritually.
The chapter is mostly about how Elixir is a bit like LISP, and so it leads us towards writing Macros, which is a strange choice as @adzz tells us that the community preference is not to use macros unless you really need them. We wonder if, like the Elm chapter, the material in the book was written before the community had properly coalesced on this opinion.
We explore mix, as we're mostly rubyists we compare it to a combination of
bundler
, gem
and
rake
all in one.
@h-lame: do all modern langs have a mix?
All: yes!! (mostly)
We agree that this seems good.
Go doesn't have one yet, but they're getting close to coming up with one. What
it does have is gofmt
. We noted that Elixir
seems to complain about whitespace during compilation time so it has a gofmt
baked in. @adzz shows us that there is a command in mix to format it which
will fix compilation errors that might occur, but it will also fix formatting
that wouldn't cause compliation errors. It's a mix of preferntial vs.
compilation-breaking rules.
@adzz: It's not community led like rubocop, but you can raise issues to change it. Our team is happy with it.
@marksweston: I found Elm's style weird, it seems it was optimised to minimise the git diff, like putting commas first on newlines. It wasn't optimised for human readability!
All: murmurs of agreement that this seemed bad.
@charlieegan3: In ruby you ship gems so you can run their rake tasks in protuction and in rust you do similar by shipping crates. Is that the same with elixir and mix?
@adzz: I'm not sure!
Adam shows us a library of his called maybex
so we can explore the mix stuff that a library would provide. We explore it
for a bit but are sidetracked by his chrome extension for github,
octotree, which is very shiny.
@h-lame: What's the difference between .ex
files and .exs
files?
@adzz: I don't know really. I think it's something like ex
files are
library code and exs
files are scripts, but both contain the same kind of
code.
[@@dkandalov]: I think exs
are compiled on the fly, but ex
are compiled
once?
@adzz: Yes, maybe. One thing I know is that you pretty much only use exs
for test files, and ex
for everything else.
to be continued
Many: It's been great having someone who knows the language quite a bit to drive and prod us in the right direction.
@tuzz: It's been a good format to jump between repl, book, examples, etc.
@dkandalov: Exploring tangents that were not really covered in the book was good too. We shouldn't be stuck on just the book as what to explore.
@h-lame: We didn't cover everything in the chapter tonight, but I got lots out of what we did cover. Not charging ahead is good.
@tuzz: I'll organise next time!
fin
Thanks to @elenatanasoiu, @h-lame and Unboxed for hosting and providing beverages, to @h-lame, @charlieegan3 and @dkandalov for bread, dips and snacks and to @adzz for shepherding as our resident elixir expert.
- Home
- Documentation
- Choosing a Topic
- Shows & Tells
- Miscellaneous
- Opt Art
- Reinforcement Learning: An Introduction
- 10 Technical Papers Every Programmer Should Read (At Least Twice)
- 7 More Languages in 7 Weeks
- Lua, Day 1: The Call to Adventure
- Lua, Day 2: Tables All the Way Down
- Lua, Day 3
- Factor, Day 1: Stack On, Stack Off
- Factor, Day 2: Painting the Fence
- Factor, Day 3: Balancing on a Boat
- Elm, Day 1: Handling the Basics
- Elm, Day 2: The Elm Architecture
- Elm, Day 3: The Elm Architecture
- Elixir, Day 1: Laying a Great Foundation
- Elixir, Day 2: Controlling Mutations
- Elixir, Day 3: Spawning and Respawning
- Julia, Day 1: Resistance Is Futile
- Julia, Day 2: Getting Assimilated
- Julia, Day 3: Become One With Julia
- Minikanren, Days 1-3
- Minikanren, Einstein's Puzzle
- Idris Days 1-2
- Types and Programming Languages
- Chapter 1: Introduction
- Chapter 2: Mathematical Preliminaries
- Chapter 3: Untyped Arithmetic Expressions
- Chapter 4: An ML Implementation of Arithmetic Expressions
- Chapter 5: The Untyped Lambda-Calculus
- Chapters 6 & 7: De Bruijn Indices and an ML Implementation of the Lambda-Calculus
- Chapter 8: Typed Arithmetic Expressions
- Chapter 9: The Simply-Typed Lambda Calculus
- Chapter 10: An ML Implementation of Simple Types
- Chapter 11: Simple Extensions
- Chapter 11 Redux: Simple Extensions
- Chapter 13: References
- Chapter 14: Exceptions
- Chapter 15: Subtyping – Part 1
- Chapter 15: Subtyping – Part 2
- Chapter 16: The Metatheory of Subtyping
- Chapter 16: Implementation
- Chapter 18: Case Study: Imperative Objects
- Chapter 19: Case Study: Featherweight Java
- The New Turing Omnibus
- Errata
- Chapter 11: Search Trees
- Chapter 8: Random Numbers
- Chapter 35: Sequential Sorting
- Chapter 58: Predicate Calculus
- Chapter 27: Perceptrons
- Chapter 9: Mathematical Research
- Chapter 16: Genetic Algorithms
- Chapter 37: Public Key Cryptography
- Chapter 6: Game Trees
- Chapter 5: Gödel's Theorem
- Chapter 34: Satisfiability (also featuring: Sentient)
- Chapter 44: Cellular Automata
- Chapter 47: Storing Images
- Chapter 12: Error-Correcting Codes
- Chapter 32: The Fast Fourier Transform
- Chapter 36: Neural Networks That Learn
- Chapter 41: NP-Completeness
- Chapter 55: Iteration and Recursion
- Chapter 19: Computer Vision
- Chapter 61: Searching Strings
- Chapter 66: Church's Thesis
- Chapter 52: Text Compression
- Chapter 22: Minimum spanning tree
- Chapter 64: Logic Programming
- Chapter 60: Computer Viruses
- Show & Tell
- Elements of Computing Systems
- Archived pages