summaryrefslogtreecommitdiff
path: root/2019/readme.org
diff options
context:
space:
mode:
Diffstat (limited to '2019/readme.org')
-rw-r--r--2019/readme.org26
1 files changed, 26 insertions, 0 deletions
diff --git a/2019/readme.org b/2019/readme.org
new file mode 100644
index 0000000..c674de4
--- /dev/null
+++ b/2019/readme.org
@@ -0,0 +1,26 @@
+* Advent of Code 2019
+
+** Personal challenge
+
+Try to keep the solution pure. Only main can do IO things, like return
+different results when it's called differently. The rest of the
+program should only be pure expressions.
+
+** Optimizations
+
+- Limit the use of statements. Try to use expressions instead, or move
+ the statement out to a function.
+
+** Findings
+
+- Having iterators that you can't clone (like stdin) makes certain
+ things difficult. Eg, doing part 1 and 2 together.
+- Using "new type" structs can be a pain. derive_more crate made most
+ of that pain go away.
+- With immutable types, 'reset the machine to try again' type
+ constraints were handled for free. This made many later puzzles easier.
+- The 'no statement' constraint meant that some functions ended up
+ nested in a way that makes it harder to name and read.
+- The persistent data structures don't integrate with Rayon iterators.
+- Easier to test subsets, but harder to inspect and audit runtime behaviour.
+- Although it isn't frequently used, Rust supports functions inside functions.