Skip to content

Commit 67acb3d

Browse files
committed
generating dec-adv page
1 parent 2181d56 commit 67acb3d

File tree

4 files changed

+228
-15
lines changed

4 files changed

+228
-15
lines changed

content-org/garden/december-adventure.org

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#+date: <2025-12-08 Mon>
33
#+hugo_base_dir: ../..
44
#+hugo_section: garden
5-
#+hugo_tags: december-adventure code japanese chinese calligraphy photography
6-
#+hugo_custom_front_matter: :progress in-progress
5+
#+hugo_tags: december-adventure
6+
#+hugo_custom_front_matter: :progress finished
77

88
Found out about the December adventure on Mastodon (likely from folks over at
99
[[https://merveilles.town/][merveilles.town]]). It's already almost a good third of the way into December, but
@@ -814,7 +814,7 @@ Busy playing mahjong (both riichi and filipino) with family, no adventuring.
814814
* december 30
815815
Obtained a hand-me-down 35mm film camera! It's a 1969 Nikon F (apparently a
816816
legendary SLR) with a 55mm f/1.2 lens. Here's a picture of it, taken with my
817-
Fujifilm X-S10:
817+
Fujifilm X-S10 (it's so much less prettier after reducing the file size, alas):
818818

819819
#+ATTR_HTML: :alt a vintage film camera sits among scattered mahjong tiles
820820
[[file:images/december-adventure-2025/nikon-f.jpg]]

content-org/garden/emacs.org

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#+title: emacs
2+
#+date: <2025-12-31 Wed>
3+
#+hugo_base_dir: ../..
4+
#+hugo_section: garden
5+
#+hugo_tags: code
6+
#+hugo_custom_front_matter: :progress in-progress
7+
8+
* installation
9+
10+
** macos (apple silicon)
11+
I've recently been having trouble with [[https://github.com/railwaycat/homebrew-emacsmacport][emacs-mac]], so I've switched over to
12+
jimeh's [[https://github.com/jimeh/emacs-builds][emacs-builds]], which seems to be working alright. As an added bonus, I'm
13+
now on emacs 30, and my site seems to generate via =ox-hugo= without errors (in
14+
the past I could only get it to work on my linux desktop).

content/garden/december-adventure.md

Lines changed: 192 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
+++
22
title = "december adventure 2025"
33
author = ["Nilay Kumar"]
4-
date = 2025-12-08T00:00:00-05:00
5-
lastmod = 2025-12-21T21:44:29-05:00
6-
tags = ["december-adventure", "code", "japanese", "chinese", "calligraphy", "photography"]
4+
date = 2025-12-08T00:00:00-08:00
5+
lastmod = 2025-12-31T22:55:37-08:00
6+
tags = ["december-adventure"]
77
draft = false
8-
progress = "in-progress"
8+
progress = "finished"
99
+++
1010

1111
Found out about the December adventure on Mastodon (likely from folks over at
1212
[merveilles.town](https://merveilles.town/)). It's already almost a good third of the way into December, but
1313
better late than never. Here's a bit [about it](https://eli.li/december-adventure), but the idea is just to pick a
1414
project or a few, work on them, and log your progress.
1515

16-
I've taken the liberty of retroactively logging the days I missed.
16+
Now that December's over, I've written a short [retrospective](#retrospective) at the bottom of
17+
the page.
1718

1819
<div class="ox-hugo-table calendar-table">
1920

20-
| | | | | |||
21-
|----------------------|----------------------|----------------------|----------------------|----------------------|-------------------|-------------------|
22-
| | [01](#december-1) | [02](#december-2-3) | [03](#december-2-3) | [04](#december-4) | [05](#december-5) | [06](#december-6) |
23-
| [07](#december-7) | [08](#december-8) | [09](#december-9) | [10](#december-10) | [11](#december-11) | [12](#december-12) | [13](#december-13) |
24-
| [14](#december-14-18) | [15](#december-14-18) | [16](#december-14-18) | [17](#december-14-18) | [18](#december-14-18) | [19](#december-19) | [20](#december-20) |
25-
| [21](#december-21) | 22 | 23 | 24 | 25 | 26 | 27 |
26-
| 28 | 29 | 30 | 31 | | | |
21+
||||||||
22+
|-------------------|------------------|-------------------|-------------------|-------------------|-------------------|-------------------|
23+
| | 01 | 02 | 03 | [04](#december-4) | [05](#december-5) | [06](#december-6) |
24+
| [07](#december-7) | [08](#december-8) | [09](#december-9) | [10](#december-10) | [11](#december-11) | [12](#december-12) | [13](#december-13) |
25+
| 14 | 15 | 16 | 17 | 18 | [19](#december-19) | [20](#december-20) |
26+
| [21](#december-21) | 22 | 23 | 24 | 25 | 26 | 27 |
27+
| 28 | 29 | [30](#december-30) | [31](#december-31) | | | |
2728

2829
</div>
2930

@@ -890,6 +891,185 @@ Things are getting busy as the end of December approaches, so I don't know if
890891
I'll be able to get to it... but it would be great to learn enough about
891892
tree-sitter grammars to submit a patch.
892893

894+
895+
## december 22-29 {#december-22-29}
896+
897+
Busy playing mahjong (both riichi and filipino) with family, no adventuring.
898+
899+
900+
## december 30 {#december-30}
901+
902+
Obtained a hand-me-down 35mm film camera! It's a 1969 Nikon F (apparently a
903+
legendary SLR) with a 55mm f/1.2 lens. Here's a picture of it, taken with my
904+
Fujifilm X-S10 (it's so much less prettier after reducing the file size, alas):
905+
906+
{{< figure src="images/december-adventure-2025/nikon-f.jpg" alt="a vintage film camera sits among scattered mahjong tiles" >}}
907+
908+
I'm still very new to photography, so using a fully manual camera with no
909+
feedback until the films are developed is probably not a great idea. On the
910+
other hand, sometimes being thrown into the deep end can be a good way to learn
911+
a new hobby quickly. I picked up 2 rolls of Fujifilm 200 and I've been taking a
912+
few photos -- probably horribly underexposed. The viewfinder on the camera had a
913+
mercury-battery powered light meter but the batteries are of course long dead
914+
(I've read that these light meters tend to become inaccurate after so many
915+
years anyway), so I'm currently using a light meter app on my phone to estimate
916+
what my shutter speeds should be.
917+
918+
I hope the pictures I've been taking actually come out okay. The worst would be
919+
to for the film to be completely blank or something when I get it developed. I
920+
am fairly confident that the camera's functioning fine, though. The Nikon F is
921+
incredibly robust (full metal construction) to the point that there are stories
922+
of it deflecting bullets in war zones. Having grown up with digital cameras and
923+
rechargeable batteries, it's amazing that a bit of chemically treated paper
924+
together with a purely mechanical contraption of metal and mirrors can take such
925+
incredible photos.
926+
927+
If the first roll comes out alright, I'm hoping to use the Nikon F to learn the
928+
basics of film photography over the next few months. It's quite heavy
929+
(especially when you're used to a modern mirrorless with a small prime lens), so
930+
I probably won't be travelling with it. Instead, I might try to just document
931+
everyday life. Given how many photos I take while traveling, it's probably for
932+
the better anyway -- film is an expensive hobby...
933+
934+
To keep track of my photography learnings (be it digital or film), I've started
935+
a [Pixelfed account](https://pixelfed.social/knees). It's currently a bit bare, but I'll start working through my
936+
old RAWs and posting the ones I'm proud of.
937+
938+
939+
## december 31 {#december-31}
940+
941+
Let's take a look at the tree-sitter `grammar.js` for `uxntal`, which can be found at
942+
the top-level of the repository [here](https://github.com/tree-sitter-grammars/tree-sitter-uxntal). The structure is fairly straightforward
943+
(see also the [documentation](https://tree-sitter.github.io/tree-sitter/creating-parsers/2-the-grammar-dsl.html)). The snippet
944+
945+
```js
946+
rules: {
947+
program: $ => repeat(
948+
choice(
949+
$.macro,
950+
$.include,
951+
$.memory_execution,
952+
$.subroutine,
953+
),
954+
),
955+
```
956+
957+
specifies (using `repeat` and `choice`) that a program consists of
958+
arbitrary sequences of the four specified nodes. These nodes must in turn be
959+
defined. The memory execution node, for example, consists of an absolute pad
960+
operation followed by an arbitrary sequence of non-toplevel-statements (which
961+
must be defined as well):
962+
963+
```js
964+
memory_execution: $ => seq(
965+
$.absolute_pad_operation,
966+
repeat($._non_toplevel_statement),
967+
),
968+
```
969+
970+
The absolute pad operation, in turn, is just the symbol "|" followed by a
971+
number (which is described by regex as a 1- to 4-digit hexadecimal):
972+
973+
```js
974+
absolute_pad_operation: $ => seq('|', $.number),
975+
number: _ => /[\da-f]{1,4}\s/,
976+
```
977+
978+
In order to test out changes to the grammar we need to ensure that the tree-sitter
979+
command-line interface is installed. Then, in the project directory, we can run
980+
981+
```sh
982+
tree-sitter generate
983+
```
984+
985+
to generate the parser from the modified `grammar.js`, and
986+
987+
```sh
988+
tree-sitter parse source.tal
989+
```
990+
991+
to display the syntax tree for a file `source.tal`.
992+
993+
The `tree-sitter-uxntal` repository comes with a folder of `uxntal` code examples,
994+
but I think they're a bit old. I put together my own folder of examples
995+
consisting of the `projects/examples` from the `uxn` repository, together with the
996+
examples shown (via wasm?) on the `uxntal` [homepage](https://wiki.xxiivv.com/site/uxntal.html). These programs should be safe
997+
to assume as "valid" (I understand that there's no such thing as an invalid
998+
`uxntal` program, but there seems to be a fairly conventional coding style that
999+
`tree-sitter` should be able to understand). I then ran
1000+
1001+
```sh
1002+
tree-sitter parse examples/**/*.tal
1003+
```
1004+
1005+
to parse all the source files I'd collected. You can also add the `-q` flag if
1006+
you're only interested in parse errors.
1007+
1008+
I got a whole bunch of errors, mostly to do with the usage of angle brackets in
1009+
label names, but also the syntax of anonymous labels `{ }`. If we take a look at
1010+
the definition of `label` in our grammar, we'll see that it refers to `identifier`,
1011+
which is in turn defined by
1012+
1013+
```js
1014+
identifier: _ => token(prec(-1, /[0-9]?[a-zA-Z_:*/][/]*[a-zA-Z0-9_:#*\-]*/)),
1015+
```
1016+
1017+
which you'll notice does not permit angle brackets. I'm no regex expert but I
1018+
think we can fix this by throwing in `<>` both before and after a sublabel `/` as
1019+
1020+
```js
1021+
identifier: _ => token(prec(-1, /[0-9]?[a-zA-Z_:<>*/][/]*[a-zA-Z0-9_:#<>*\-]*/)),
1022+
```
1023+
1024+
For the anonymous labels we can introduce some new syntax
1025+
1026+
```js
1027+
anonymous_label: $ => seq(
1028+
'{',
1029+
repeat($._non_toplevel_statement),
1030+
'}',
1031+
),
1032+
```
1033+
1034+
and then add in the anonymous label into the list of non-toplevel-statements.
1035+
1036+
These two are not the only errors (and my solutions are probably not even 100%
1037+
correct), but this is roughly how I'm approaching modifying the grammar. I've
1038+
been playing with this in between end-of-year holiday busyness, so I hope
1039+
to get some time soon to sit down and attack this more seriously.
1040+
1041+
1042+
## retrospective {#retrospective}
1043+
1044+
I'm really glad I did the december adventure this year. It gave me a healthy bit
1045+
of motivation to work on or learn about things that I'm interested in but often
1046+
don't have the energy to get around to. One of the big takeaways is that I'm
1047+
easily nerd-sniped by all sorts of different cool things, which leads me to
1048+
starting a lot of projects. Here's a list of things I got interested enough in
1049+
to start (or at least write about) this month:
1050+
1051+
- photography and editing photos
1052+
- the kakuji script from the japanese edo period
1053+
- basic graphics programming with raylib in c
1054+
- writing my own static site generator to move away from the complexity of
1055+
hugo and org-mode
1056+
- learning the very basics of my first assembly/stack language uxntal
1057+
- learning about the tree-sitter parser generator library and its grammars
1058+
- an emacs tree-sitter major mode for uxntal
1059+
1060+
It's tough to focus on a single idea and actually complete a project with a
1061+
work-fried brain split among chores and errands.
1062+
1063+
With these observations in mind... in 2026 I'd like to:
1064+
1065+
- continue adding to this digital garden/memex. It's a bit of a different format
1066+
from the december adventure, but I'd like to continue recording small bits of
1067+
things I find interesting, daily if possible
1068+
- start more creative projects! Do more photography, learn the basics of
1069+
sketching/drawing, write a tiny game, ...
1070+
- try to focus on finishing projects. Not necessarily right away (breaks are
1071+
good), but eventually. Even if the project scopes are tiny!
1072+
8931073
---
8941074
8951075
Down here I'm collecting the little project ideas that tend to pop into

content/garden/emacs.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
+++
2+
title = "emacs"
3+
author = ["Nilay Kumar"]
4+
date = 2025-12-31T00:00:00-08:00
5+
lastmod = 2025-12-31T22:59:40-08:00
6+
tags = ["code"]
7+
draft = false
8+
progress = "in-progress"
9+
+++
10+
11+
## installation {#installation}
12+
13+
14+
### macos (apple silicon) {#macos--apple-silicon}
15+
16+
I've recently been having trouble with [emacs-mac](https://github.com/railwaycat/homebrew-emacsmacport), so I've switched over to
17+
jimeh's [emacs-builds](https://github.com/jimeh/emacs-builds), which seems to be working alright. As an added bonus, I'm
18+
now on emacs 30, and my site seems to generate via `ox-hugo` without errors (in
19+
the past I could only get it to work on my linux desktop).

0 commit comments

Comments
 (0)