sigil-json
JSON parsing and generation for Sigil.
Bidirectional conversion between JSON and native Scheme types (dicts, arrays, strings, numbers, booleans) with port-based I/O for reading and writing JSON streams.
This package was extracted from the sigil monorepo — the in-tree history under packages/sigil-json/ is preserved here as master.
Usage
(import (sigil json))
;; Encode
(json-encode #{ name: "Alice" age: 30 })
; => "{\"name\":\"Alice\",\"age\":30}"
;; Decode
(json-decode "{\"name\":\"Alice\",\"age\":30}")
; => #{ name: "Alice" age: 30 }
;; Path lookup
(json-get-in (json-decode "{\"a\":{\"b\":42}}") '(a b))
; => 42Type Mapping
| JSON | Scheme |
|---|---|
| object | dict: #{ name: "Alice" } |
| array | array: #[1 2 3] |
| string | string: "hello" |
| number | number: 42, 3.14 |
| true | #t |
| false | #f |
| null | 'null symbol |
JSON null decodes as the symbol 'null (not #f). When a field may be JSON null, normalize it explicitly — see docs/json.md for the pattern.
API
(sigil json)
| Procedure | Purpose |
|---|---|
json-encode | Scheme value → JSON string |
json-decode | JSON string → Scheme value |
json-read / json-write | Port-based streaming I/O |
json-get-in | Path lookup into a decoded value |
See docs/json.md for full details.
Dependencies
Read the rest
sigil-stdlib
Consumed here as a from-git ref pinned to ^0.13.1 against the sigil monorepo.
Build
sigil deps install
sigil buildTesting
sigil testLicense
BSD-3-Clause.
$ git clone https://codeberg.org/sigil/sigil-json
v0.16.0 — latest by version, released 6 May 2026
All releases — 3 tags in this repository.
One page per file, and every line has a permalink.
55c9e747
bf7d1324
b42d9790
34dd621f
f5084129
d0981cb2
460dbb0d
The last 20 commits keep a page here. Everything older lives in the clone.