Skip to content

Commit c9a862d

Browse files
committed
dec 21
1 parent 0f1cfff commit c9a862d

File tree

2 files changed

+42
-3
lines changed

2 files changed

+42
-3
lines changed

content-org/garden/december-adventure.org

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ implementing other features that a =uxntal= major mode might have, so I hope to
758758
come back to this soon.
759759

760760
* december 21
761+
** sublabels and the return stack
761762
Let's return to the =uxntal= code snippet for printing hex that we were looking at
762763
on day 19:
763764
#+begin_src uxntal
@@ -786,10 +787,25 @@ Very very clever: thanks to =d_m= on =irc= for helping me understand some of thi
786787
was confused at first because I couldn't see how the print (=#18 DEO=) was getting
787788
called 4 times, which would be necessary for printing the nibbles of a short.
788789
What I hadn't understood is that the jumps to the sublabels here do more than
789-
just move the program counter -- they also modify the working stack. In other
790+
just move the program counter -- they also modify the return stack. In other
790791
words, =JMP2r= is not a simple =return=-from-=@subroutine=, the way I had been
791792
conceptualizing it.
792793

794+
** tree-sitter grammar for uxntal
795+
Small note here for myself: the tree-sitter grammar that I've been using (found
796+
[[https://github.com/tree-sitter-grammars/tree-sitter-uxntal][here]]) seems to be unfamiliar with the syntax of the anonymous label =?{ }=. The
797+
syntax tree for =?{ !print-hex-digit }=, for example, yields:
798+
#+begin_src
799+
(rune
800+
rune_start: (rune_char immediate: ?)
801+
(ERROR {)
802+
(rune_char immediate: !)
803+
(identifier))
804+
(ERROR })
805+
#+end_src
806+
Things are getting busy as the end of December approaches, so I don't know if
807+
I'll be able to get to it... but it would be great to learn enough about
808+
tree-sitter grammars to submit a patch.
793809

794810
-----
795811

content/garden/december-adventure.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title = "december adventure 2025"
33
author = ["Nilay Kumar"]
44
date = 2025-12-08T00:00:00-05:00
5-
lastmod = 2025-12-21T17:46:28-05:00
5+
lastmod = 2025-12-21T21:44:29-05:00
66
tags = ["december-adventure", "code", "japanese", "chinese", "calligraphy", "photography"]
77
draft = false
88
progress = "in-progress"
@@ -832,6 +832,9 @@ come back to this soon.
832832

833833
## december 21 {#december-21}
834834

835+
836+
### sublabels and the return stack {#sublabels-and-the-return-stack}
837+
835838
Let's return to the `uxntal` code snippet for printing hex that we were looking at
836839
on day 19:
837840

@@ -863,10 +866,30 @@ Very very clever: thanks to `d_m` on `irc` for helping me understand some of thi
863866
was confused at first because I couldn't see how the print (`#18 DEO`) was getting
864867
called 4 times, which would be necessary for printing the nibbles of a short.
865868
What I hadn't understood is that the jumps to the sublabels here do more than
866-
just move the program counter -- they also modify the working stack. In other
869+
just move the program counter -- they also modify the return stack. In other
867870
words, `JMP2r` is not a simple `return`-from-`@subroutine`, the way I had been
868871
conceptualizing it.
869872

873+
874+
### tree-sitter grammar for uxntal {#tree-sitter-grammar-for-uxntal}
875+
876+
Small note here for myself: the tree-sitter grammar that I've been using (found
877+
[here](https://github.com/tree-sitter-grammars/tree-sitter-uxntal)) seems to be unfamiliar with the syntax of the anonymous label `?{ }`. The
878+
syntax tree for `?{ !print-hex-digit }`, for example, yields:
879+
880+
```nil
881+
(rune
882+
rune_start: (rune_char immediate: ?)
883+
(ERROR {)
884+
(rune_char immediate: !)
885+
(identifier))
886+
(ERROR })
887+
```
888+
889+
Things are getting busy as the end of December approaches, so I don't know if
890+
I'll be able to get to it... but it would be great to learn enough about
891+
tree-sitter grammars to submit a patch.
892+
870893
---
871894

872895
Down here I'm collecting the little project ideas that tend to pop into

0 commit comments

Comments
 (0)