Metadata-Version: 2.4
Name: chlang
Version: 3.29.0
Summary: φ-lang v6 + φC engine + CR38 notebook renderer: chessboard-coordinate handwriting notebooks (.ram/.gθ), Rot24 fold geometry, point-blob codec, street/map rendering, chlang Board/HyperBoard binding
Author: Cerie Raman
License: MIT
Keywords: phi-lang,chess,capability,engine,philang,cr38,notebook,handwriting
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: C
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: python-chess>=1.999
Provides-Extra: cr38-render
Requires-Dist: Pillow>=9.0; extra == "cr38-render"

# chlang — φ-lang v6 + φC engine + CR38 notebook renderer

`chlang` is the φ-lang v6 execution stack: 15,275 scripts, 4,768 Raman
skills, 44 language builders, the hypergeometry chain (block cube →
board cube → 4D membrane cube → lattice → brick), and the φC C
compiler.

## CR38 — notebook format renderer (v3.28.0)

CR38 is a handwriting notebook format whose geometry is a chessboard:

- 1 line = 1024 units, 1 block = 10,240 units square, 1 board = 8×8 blocks = 81,920 units
- `.ram` = one board (SQLite, 64 cells), `.gθ` = one free block, `.md` = world index
- Identity across files is **UUIDv7**; orientation is an **integer index into the 24 cube rotations** (Rot24) — exact, no drift over fold chains
- Strokes are always 2D in block-local coordinates; all 3D structure lives in the reference graph. **World position is never stored** — it is derived by composing transforms from the root

```python
import chlang

nb = chlang.cr38_load("/path/to/notebook")        # in-memory graph
pos, rot = chlang.cr38_world_transform(node_id)   # derived, memoized
chlang.cr38_render("/path/to/notebook")           # street mode (SVG)
chlang.cr38_render("/path/to/notebook", mode="map")  # 3D fold graph
b = chlang.cr38_to_board("board_a.ram")           # cell N -> Board slot N
hb = chlang.cr38_to_hyperboard(folder)            # fold graph -> geometry + path
```

CLI:

```
python -m chlang.cr38 render <folder> [--mode street|map] [--board UUID] [--zoom N] [--out path]
python -m chlang.cr38 info   <folder>
python -m chlang.cr38 export <folder>             # ram-export/1 JSON
```

## Hypergeometry

```
BLOCK CUBE   : 6 blocks = the 6 faces of a cube
BOARD CUBE   : 8×8×8 = 512 block cubes = 3072 blocks = 48 standard boards
MEMBRANE CUBE: a board cube per membrane face; 8 membranes = 4D hypercube
LATTICE      : 20,833 membrane-cubes (1M boards)
BRICK        : 166,667 membrane-cubes (8M boards)
```

## Install

```bash
pip install chlang
pip install "chlang[cr38-render]"   # + Pillow for raster (PNG) tiles
```

## License

MIT
