diff options
Diffstat (limited to 'posts')
-rw-r--r-- | posts/2024-02-25-optimizing-guile.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/posts/2024-02-25-optimizing-guile.md b/posts/2024-02-25-optimizing-guile.md index 641fe8d..cf22c9e 100644 --- a/posts/2024-02-25-optimizing-guile.md +++ b/posts/2024-02-25-optimizing-guile.md @@ -17,7 +17,7 @@ simple and apply to optimizing any dynamic language. The only difference is that there isn’t much in the way of helpful examples specifically for Guile… until now. -Scheme is a dynamic language, which means that there is a limited +Scheme is a dynamic language which means that there is a limited amount of compile-time information that can be used by Guile to optimize the resulting bytecode. When we put on our optimizer hat, our job is to give the compiler a hand so the optimization passes can @@ -38,8 +38,8 @@ implicit; `(+ x 1)` may or may not allocate depending on the value of `x`. If `x` is `42` then there is no allocation because the result, `43`, -is in the fixnum range (which is `[-2^63, 2^63)` on 64-bit machines) -which Guile stores as an “immediate” value which is not heap +is in the fixnum range (`[-2^63, 2^63)` on 64-bit machines.) Guile +stores fixnums as “immediate” values; values which are not heap allocated. However, if `x` is `42.0` then Guile will allocate a float on the heap to store the result `43.0`. Did you know that floats were heap allocated in Guile? I didn’t when I was getting started! All |