Skip to content

Instantly share code, notes, and snippets.

@sogaiu
sogaiu / gist:aa1ad614ed9b8a29b5a29e558e305682
Last active June 27, 2025 09:29
playground test with tree-sitter a9818e4b171000eded8944bb2b49f1c68dbac7e3
cd /tmp
git clone https://github.com/tree-sitter/tree-sitter
cd tree-sitter
cargo build --release
cd ..
git clone https://github.com/sogaiu/tree-sitter-janet-simple
cd tree-sitter-janet-simple
../tree-sitter/target/release/tree-sitter generate --abi 14
../tree-sitter/target/release/tree-sitter build --wasm
# works when there is a network connection
@sogaiu
sogaiu / notes.md
Last active June 27, 2025 05:11
tree-sitter bindings notes

note: afaict, "grammar files" appears to be a phrase used by at least one of the main developers to refer to the files related to bindings for various languages (e.g. c, go, java, kotlin, node, python, rust, swift)

@sogaiu
sogaiu / 0.setup.txt
Last active June 24, 2025 11:15
building racket v8.17 from source on android termux (`in-place`)
# prerequisites: git, make, cc, ar, etc.
pkg install git make clang binutils fontconfig libcairo pango
# choose an appropriate parent directory
cd ~/src
# fetch repository
git clone https://github.com/racket/racket
# orient oneself
[nREPL] Starting server via /home/user/.local/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.3.1\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.55.7\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[cider.nrepl/cider-middleware\]\"\]\}\}\} -M:cider/nrepl
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: requiring-resolve in this context, compiling:(orchard/misc.clj:150:8)
at clojure.lang.Compiler.analyze(Compiler.java:6688)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3766)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
@sogaiu
sogaiu / getting-syntactically-valid-clojure-code.md
Created June 21, 2025 09:49
how to get syntactically valid clojure code for testing (e.g. tree-sitter-clojure)

overview of going from zero to having files to scan on local system

  1. fetch feed.clj from clojars - this file contains a description of essentially what jars exist on clojars

  2. scan feed.clj to determine which .jar files to fetch. creating a single file that contains urls (as compared to just holding the info in memory) has some advantages (e.g. resuming, having a record of what might have been fetched, using another tool to fetch, etc.) constraints / criteria for what to fetch might include:

@sogaiu
sogaiu / misc-clojure-tidbits.md
Last active June 21, 2025 13:58
misc clojure tidbits
  • cider questions
    • toggle tooltips, often they seem to unnecessarily block one's view of the code
    • determine duration of last evaluation?
    • is project-specific configuration possible?
    • can cider be configured to use a particular version of clojure when starting an nrepl server?
      • yes, e.g. (setq cider-jack-in-auto-inject-clojure "1.12.0")
      • adapt that to work with .dir-locals.el (see above) for per-project setting (e.g. for rewrite-clj)
    • insert last evaluation results into buffer?
      • current work-around is to visit *Messages* buffer, find the result and copy
@sogaiu
sogaiu / linux-mint-22.1-xfce-installation-notes-qemu-vm.md
Last active June 16, 2025 11:35
linux mint 22.1 xfce installation notes (qemu vm)
@sogaiu
sogaiu / unicode-notes.md
Last active June 16, 2025 11:29
unicode notes

code unit

Code Unit. The minimal bit combination that can represent a unit of encoded text for processing or interchange. The Unicode Standard uses 8-bit code units in the UTF-8 encoding form, 16-bit code units in the UTF-16 encoding form, and 32-bit code units in the UTF-32 encoding form. (See definition D77 in Section 3.9, Unicode Encoding Forms.)

via: https://www.unicode.org/glossary/#code_unit

A code unit is the unit of storage of a part of an encoded code point. In UTF-8 this means 8 bits, in UTF-16 this means 16 bits. A single code unit may represent a full code point, or part of a code point. For example, the snowman glyph (☃) is a single code point but 3 UTF-8 code units, and 1 UTF-16 code unit.