A categorical programming language
Name | Size | Rev. | Time | Author | Log Message |
---|---|---|---|---|---|
bk | |||||
hive | |||||
jelly | |||||
movelist | |||||
sampler | |||||
schemata | |||||
wallpapers | |||||
.envrc | 86 | b659b9c | 2024-05-12 14:05:05 | Corbin | bk: Extract trees from v3 hives. I'm... |
.gitignore | 807 | 1793513 | 2023-01-25 07:28:58 | Corbin | Add a djinn to the new REPL. So much... |
.ocamlformat | 16 | 1793513 | 2023-01-25 07:28:58 | Corbin | Add a djinn to the new REPL. So much... |
LICENSE | 33.71 k | 1793513 | 2023-01-25 07:28:58 | Corbin | Add a djinn to the new REPL. So much... |
README.txt | 2.17 k | eaf6455 | 2024-05-23 06:55:10 | Corbin | Remove a couple old scripts. |
bench.py | 940 | 1793513 | 2023-01-25 07:28:58 | Corbin | Add a djinn to the new REPL. So much... |
bench.sh | 253 | 1793513 | 2023-01-25 07:28:58 | Corbin | Add a djinn to the new REPL. So much... |
cammy-in-scheme.scm | 739 | 9431641 | 2024-06-30 10:09:30 | Corbin | Add a sort of Maxwell's-laws presenta... |
checklist.txt | 5.46 k | 530f14a | 2024-03-12 06:21:52 | Corbin | Include zaha. |
flake.lock | 2.67 k | 4c3ba20 | 2024-04-27 10:18:15 | Corbin | Add rpypkgs; bump zaha. Didn't mean ... |
flake.nix | 2.98 k | 1fd0c73 | 2024-05-12 14:49:36 | Corbin | Move 2to3 to subcommand of bk. This ... |
hive.json | 97.12 k | 34b5bd0 | 2023-06-05 03:05:20 | Corbin | cammyo: Fix a typo. |
make-demos.sh | 535 | 1793513 | 2023-01-25 07:28:58 | Corbin | Add a djinn to the new REPL. So much... |
make-kleisli-cat.sh | 656 | 1793513 | 2023-01-25 07:28:58 | Corbin | Add a djinn to the new REPL. So much... |
proof.txt | 680 | 1793513 | 2023-01-25 07:28:58 | Corbin | Add a djinn to the new REPL. So much... |
ski2cammy.py | 1.01 k | 1793513 | 2023-01-25 07:28:58 | Corbin | Add a djinn to the new REPL. So much... |
todo.txt | 26.81 k | b0644bd | 2024-05-30 11:14:08 | Corbin | Clarify some notes. |
tools.dot | 205 | 1793513 | 2023-01-25 07:28:58 | Corbin | Add a djinn to the new REPL. So much... |
update-jelly.sh | 131 | 3b77fb5 | 2023-03-24 16:24:46 | Corbin | Update jelly and prepare for future j... |
update-openapi.sh | 122 | 1793513 | 2023-01-25 07:28:58 | Corbin | Add a djinn to the new REPL. So much... |
# Cammy "[Cammy is] really not a good language for anything." ~ [Me](https://lobste.rs/s/ftqp21/whatever_happened_elm_anyway#c_8fnjr6) ## Introduction Cammy is a simple syntax for bicartesian closed categories with natural numbers objects. It directly represents arrows with S-expressions. This toolchain also includes support for IEEE 754 floating-point numbers. ### jelly The `jelly` tool reads Cammy expressions and emits equivalent Cammy expressions which are usually smaller, sometimes more accurate if using floating-point maths, and sometimes more generic. ### bk The `bk` tool encodes Cammy expressions into git repositories. When we use git in this fashion, we obtain Cammy hives, a content-addressable and scalable system for managing Cammy expressions. ## Toolchain maintenance ### How to add new primitives/jets * Jet definitions in jets.json * New primitive arrows in prims.json * CAM operations in cammylib/cam.py * Parser/compiler to CAM in cammylib/arrows.py * Typechecker in cammyo.scm * Interpreters in cammyo.scm and cammy.scm * Algebraic laws (optimizations, jet introduction) in jelly/src/main.rs ### Jelly The jelly optimizer is a Cammy-to-Cammy optimizer which uses e-graphs to search for the smallest equivalent expression. The rule engine is from the `egg` library. The rules are written in a DSL embedded in Rust, along with comments explaining their provenance and correctness. To update Cargo dependencies for jelly: $ ./update-jelly.sh ### Movelist The movelist is a relational typechecker written in CHICKEN Scheme's dialect of miniKanren. It can typecheck a Cammy expression, or take a type representation and synthesize Cammy expressions with the given type. To update eggs for movelist: $ egg2nix movelist/eggs.scm > movelist/eggs.nix ### Shell Environment The environment for developing the Cammy toolchain is contained within `shell.nix`. To update eggs for the shell environment: $ egg2nix eggs.scm > eggs.nix ### Compiling to Categories The second argument to cammy-frame applies a list of functors. Each functor corresponds to a path in the hive; functor `foo` corresponds to `cats/foo/`. The list is comma-separated and applied left-to-right.