]> Untitled Git - monorepo.git/commitdiff
edit recursion article mindmap
authorPreston Pan <preston@nullring.xyz>
Fri, 26 Jan 2024 01:21:59 +0000 (17:21 -0800)
committerPreston Pan <preston@nullring.xyz>
Fri, 26 Jan 2024 01:21:59 +0000 (17:21 -0800)
index.org
mindmap/recursion.org

index 9e9685dfac2c69adcfc5fb3d5438602cad4ec33d..49a4049d4ba4f01bdc9890604bb201fb21657d74 100644 (file)
--- a/index.org
+++ b/index.org
@@ -62,19 +62,10 @@ website:
 #+begin_src shell :exports code :results silent
 cd ~/org/website
 git add .
-git commit -m "add more information for about site"
+git commit -m "edit recursion article mindmap"
 git push github main
 rsync -azvP ~/website_html/ root@nullring.xyz:/var/www/ret2pop/
 #+end_src
-#+RESULTS:
-| [main      | 3f83226]    | is       | my        | website        | fixed? |              |           |           |         |         |                |
-| 1          | file        | changed, | 4         | insertions(+), | 4      | deletions(-) |           |           |         |         |                |
-| sending    | incremental | file     | list      |                |        |              |           |           |         |         |                |
-| index.html |             |          |           |                |        |              |           |           |         |         |                |
-| \r         | 1,400       | 10%      | 0.00kB/s  | 0:00:00        | \r     | 13,211       |      100% | 11.26MB/s | 0:00:00 | (xfr#1, | to-chk=91/102) |
-|            |             |          |           |                |        |              |           |           |         |         |                |
-| sent       | 3,964       | bytes    | received  | 154            | bytes  | 1,647.20     | bytes/sec |           |         |         |                |
-| total      | size        | is       | 1,868,773 | speedup        | is     | 453.81       |           |           |         |         |                |
 
 No, seriously, this is how I update my website. This code block right here. That's right, this website will be filled
 with code blocks that both act as /examples/ of how the website might be maintained, but also run the commands themselves.
index bfedaca63ad6140a20e1d8b9d5df12132756af75..3cc2a125aac5f65cd8bb78820bb863525a20f9cf 100644 (file)
@@ -102,32 +102,12 @@ results block of this one, and you can see an exact mirroring of the first block
 
 So, the "going down" procedure is the same thing as pushing values onto some sort of stack, and the "going back up"
 procedure is exactly the same as popping those values off a stack!
-** Computer Hardware Describes Recursion
-Even though we can analogize pushing and popping off the stack to this recursion, there still isn't a clear definite
-link to the two ideas in hardware. Therefore, I will do a demonstration using assembly.
-
-To start with, we will be comparing an assembly function that takes the factorial to this one in C:
-#+begin_src C :results output :exports both
-#include <stdio.h>
-
-int factorial(int x) {
-    if (x < 0) return -1;
-    else if (x == 0) return 1;
-    return x * factorial(x - 1);
-}
-int main(int argc, char **argv) {
-    printf("factorial of five: %d\n", factorial(5));
-    return 0;
-}
+** Stacks Describe Recursion
+To see more transparently how stacks relate to recursion, we use my programming language stem, which is a
+concatenative programming language, as a more transparent example.
+#+begin_src stem
+factorial [ dup 0 <= [ 1 + ] [ dup 1 - factorial * ] ] def
 #+end_src
-
-#+RESULTS:
-: factorial of five: 120
-
-Because C is a compiled language, it is easier to see what is actually happening human-wise. However,
-we will need to write and analyze some assembly in order to figure out what is actually going on.
-
-Assembly language section coming soon! We will be using NASM due to its readability.
 * TODO Recursion Describes…?
 
 * TODO Recursion is not Recursive