Commit811b6392Recorded24 Apr 2026Repositorysigil-json

Extract sigil-json from sigil monorepo

Message

- Filter-repo'd history preserving original SHAs from packages/sigil-json/. - Rewrote package.sgl: version 0.13.1, standalone url, resolve sigil-stdlib via from-git against sigil monorepo v0.13.1. - Added .gitignore (build/, .sigil/), manifest.scm (guix dev env), dev-redirects.sgl (point sigil-stdlib at local ../sigil checkout), README.md.

Extraction per procedures/sigil-package-extraction. No behavior changes.

Changed
 .gitignore        |  2 ++
 README.md         | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 dev-redirects.sgl |  6 ++++++
 manifest.scm      | 10 ++++++++++
 package.sgl       |  5 +++--
 sigil.lock        |  8 ++++++++
 6 files changed, 109 insertions(+), 2 deletions(-)
Diff
.gitignoreadded
@@ -0,0 +1,2 @@
+1
build/
+2
.sigil/
README.mdadded
@@ -0,0 +1,80 @@
+1
# sigil-json
+2
+3
JSON parsing and generation for [Sigil](https://codeberg.org/sigil/sigil).
+4
+5
Bidirectional conversion between JSON and native Scheme types (dicts,
+6
arrays, strings, numbers, booleans) with port-based I/O for reading and
+7
writing JSON streams.
+8
+9
This package was extracted from the sigil monorepo — the in-tree history
+10
under `packages/sigil-json/` is preserved here as `master`.
+11
+12
## Usage
+13
+14
```scheme
+15
(import (sigil json))
+16
+17
;; Encode
+18
(json-encode #{ name: "Alice" age: 30 })
+19
; => "{\"name\":\"Alice\",\"age\":30}"
+20
+21
;; Decode
+22
(json-decode "{\"name\":\"Alice\",\"age\":30}")
+23
; => #{ name: "Alice" age: 30 }
+24
+25
;; Path lookup
+26
(json-get-in (json-decode "{\"a\":{\"b\":42}}") '(a b))
+27
; => 42
+28
```
+29
+30
## Type Mapping
+31
+32
| JSON | Scheme |
+33
|--------|----------------------------|
+34
| object | dict: `#{ name: "Alice" }` |
+35
| array | array: `#[1 2 3]` |
+36
| string | string: `"hello"` |
+37
| number | number: `42`, `3.14` |
+38
| true | `#t` |
+39
| false | `#f` |
+40
| null | `'null` symbol |
+41
+42
JSON `null` decodes as the symbol `'null` (not `#f`). When a field may be
+43
JSON null, normalize it explicitly — see `docs/json.md` for the pattern.
+44
+45
## API
+46
+47
### `(sigil json)`
+48
+49
| Procedure | Purpose |
+50
|-----------|---------|
+51
| `json-encode` | Scheme value → JSON string |
+52
| `json-decode` | JSON string → Scheme value |
+53
| `json-read` / `json-write` | Port-based streaming I/O |
+54
| `json-get-in` | Path lookup into a decoded value |
+55
+56
See `docs/json.md` for full details.
+57
+58
## Dependencies
+59
+60
- `sigil-stdlib`
+61
+62
Consumed here as a `from-git` ref pinned to `^0.13.1` against the sigil
+63
monorepo.
+64
+65
## Build
+66
+67
```sh
+68
sigil deps install
+69
sigil build
+70
```
+71
+72
## Testing
+73
+74
```sh
+75
sigil test
+76
```
+77
+78
## License
+79
+80
BSD-3-Clause.
dev-redirects.sgladded
@@ -0,0 +1,6 @@
+1
;; Development redirects — point dependencies at local Sigil checkout
+2
(redirects
+3
repos: (list
+4
(for-repo
+5
url: "codeberg:sigil/sigil"
+6
use: (from-path dir: "../sigil"))))
manifest.scmadded
@@ -0,0 +1,10 @@
+1
;; sigil-json Development Environment
+2
;; Use with: guix shell -m manifest.scm
+3
;;
+4
;; sigil-json is pure Scheme with no vendored C, so the environment
+5
;; only needs the common Sigil build toolchain.
+6
+7
(specifications->manifest
+8
'("gcc-toolchain"
+9
"make"
+10
"pkg-config"))
package.sglmodified
@@ -4,10 +4,11 @@
4
5
(package
6
name: "sigil-json"
+7
version: "0.13.1"
8
description: "JSON parsing and generation for Sigil"
8
url: "https://codeberg.org/sigil/sigil"
+9
url: "https://codeberg.org/sigil/sigil-json"
10
license: "BSD-3-Clause"
11
authors: (list "David Wilson <[email protected]>")
12
13
dependencies: (list
13
(from-workspace name: "sigil-stdlib")))
+14
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.13.1")))
sigil.lockadded
@@ -0,0 +1,8 @@
+1
;; Auto-generated by sigil deps install. Do not edit.
+2
(lock
+3
(package name: "sigil-stdlib"
+4
url: "codeberg:sigil/sigil"
+5
ref: "^0.13.1"
+6
sha: "1aea1cecd3487bf07d071da2c1e7eb3cf4bbdb21"
+7
package-selector: "sigil-stdlib")
+8
)