Mistakes were made
[Talks that present] new ways of thinking [...] and talk deeply about lessons learned [...].
We want to hear about [...] the very strange.
Aldric Giacomoni
@trevoke
Director of Engineering at Stash
You got to lose to know
How to win
― Dream On, Aerosmith
With every mistake we must surely be learning
Still my guitar gently weeps
― While My Guitar Gently Weeps, The Beatles
Why?!
Why this side project?
A mix of a MUD and Dwarf Fortress
I am not a game designer.
Nothing here constitutes good advice.
Seriously.
[0/6]
[ ]
algorithm improvement[ ]
extreme local state[ ]
distributed state[ ]
schedulers and the "tick"[ ]
flooding processes[ ]
linux oom killerA list is like an array
AKA "what's the deal with immutability anyway?"
World: Graph → Edges and nodes
def traverse(node, _, visited) when node in visited, do: visited
def traverse(node, edge_list, visited) do
visited = [node | visited]
edges_from_node = direct_edges(node, edge_list)
Enum.flat_map(
edges_from_node,
fn({_s, dest}) -> traverse(dest, edge_list, visited) end
)
end
Lots of data structures initialized recursively
Lots of data being copied when flattening
VERY SLOW
def traverse(node, _, visited) when node in visited, do: visited
def traverse(node1, edge_list, visited) do
visited = [node1 | visited]
edges_from_node = direct_edges(node1, edge_list)
Enum.reduce(
edges_from_node,
visited,
fn({_a, b}, acc) -> traverse(b, edge_list, acc) end)
end
[1/6]
[X]
algorithm improvement[ ]
extreme local state[ ]
distributed state[ ]
schedulers and the "tick"[ ]
flooding processes[ ]
linux oom killerlocal state has got to be better than global state
"Actor model?" Moar like extreme object-oriented, amirite?
A → B
B → A
A → ☺
Alice asks Bob (and waits)
Bob asks Charlie (and waits)
Charlie asks Alice (and waits)
The classic concurrency problem.
Check it out.
Tell, don't ask.
[2/6]
[X]
algorithm improvement[X]
extreme local state[ ]
distributed state[ ]
schedulers and the "tick"[ ]
flooding processes[ ]
linux oom killerFewer synchronous calls will reduce the opportunity of deadlocks
Moar local state in moar local places
Accidentally multiple sources of truths
Some state is global
[3/6]
[X]
algorithm improvement[X]
extreme local state[X]
distributed state[ ]
schedulers and the "tick"[ ]
flooding processes[ ]
linux oom killerThere won't be a noticeable impact to sending all my creatures a message at the same time
The tick (not the blue one)
All schedulers triggered at same time - literally a heartbeat of intense CPU usage on the box
More or less "any other way"
I opted for "all manage their own ticks"
Never mind how untestable that makes the system
Smarter fix is probably "bounded global ticks" so that some control can be exerted more easily
[4/6]
[X]
algorithm improvement[X]
extreme local state[X]
distributed state[X]
schedulers and the "tick"[ ]
flooding processes[ ]
linux oom killerIt's hard to send a single process too many messages
Every action is an event
Dwarlixir is decentralized
[5/6]
[X]
algorithm improvement[X]
extreme local state[X]
distributed state[X]
schedulers and the "tick"[X]
flooding processes[ ]
linux oom killerMy world simulation won't grow unbounded in RAM usage
"Emergent Behavior"
The operating system does what it needs to do to stay up
Ecosystem
[6/6]
[X]
algorithm improvement[X]
extreme local state[X]
distributed state[X]
schedulers and the "tick"[X]
flooding processes[X]
linux oom killerIt's yaks all the way down
One server
One plugin per text editor
I use emacs
primary plugin: alchemist.el
elixir_sense
elixir-ls
https://github.com/elixir-lsp forked the projects, opened issues on original projects to explain why
elixir-lang.slack.com
#language-server
Woot!
WOOT!
Still haven't established communication with Jake Becker
If I don't know the answer, I'll make up a good one