• R/O
  • HTTP
  • SSH
  • HTTPS

Source Tree

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A categorical programming language


Nome Tamanho Rev. Hora Autor Mensagem de Log
afl-inputs
bk
cammy
extra
wallpapers
.envrc 55 c761066 2024-09-29 02:25:18 Corbin Try to evict some ghosts from the rep...
LICENSE 33.71 k 7e1613d 2023-02-16 16:12:46 Corbin Add more floating-point operations. ...
README.txt 1.86 k 973b48e 2024-10-01 01:23:47 Corbin Remove v2 hive and movelist. Gotta c...
flake.lock 2.58 k 647dff3 2024-10-01 02:24:20 Corbin Use rpypkgs.
flake.nix 2.42 k d018872 2024-10-27 07:19:18 Corbin Use afl to harden the parser and disa...
make-demos.sh 535 7e1613d 2023-02-16 16:12:46 Corbin Add more floating-point operations. ...
todo.txt 25.76 k 8fa9e07 2024-10-25 15:03:35 Corbin Use regexes to parse inject/project/n...

README.txt

# 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

### 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.