From 74d4e679f07ed2f52ddac23a1ca7a5db98017d27 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sat, 3 Jun 2023 14:50:01 +0200 Subject: Add a slide with motivation why this is useful --- weak-refs.org | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/weak-refs.org b/weak-refs.org index fb97694..98cf5a7 100644 --- a/weak-refs.org +++ b/weak-refs.org @@ -13,6 +13,23 @@ June 3rd, 2023 +* Why weak references? + +** User "kluk" on IRC mentioned not having line numbers in the interpreter +** was a nonstarter. + +** Discussion followed. Why don't we have it? + +*** Interpreter can read/eval an unbounded number of expressions +*** So, line number database would keep growing +*** Not great for memory usage - programs would get slower/crash over time + +** How could this be fixed? + +*** Have the line number db use weak pairs, with the input form collectable + +** We already "kind of" have weak pairs, but not user-visible + * Quick refresher on data types All data is represented by a machine word: -- cgit v1.2.3