• R/O
  • HTTP
  • SSH
  • HTTPS

标签
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


File Info

Rev. 8b60dc0d6200a93008d69c118732d46bdc7a72d3
大小 1,548 字节
时间 2024-04-25 10:34:53
作者 Corbin
Log Message

Get 2to3.py to build a v3 hive.

I haven't verified that the contents of the hive are correct, and
git-fsck is (unsurprisingly) very unhappy with me. I used a monkey patch
on dulwich to allow creation of refs with question marks in their names,
because I know it's legal on Linux and I don't care about other kernels.

Content

## Cammy

"[Cammy is] really not a good language for anything." ~ [Me](https://lobste.rs/s/ftqp21/whatever_happened_elm_anyway#c_8fnjr6)

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