Skip to main content

A pure lambda-calculus interpreter that applies tabling to weak-head reduction, folding self-referential terms into finite cyclic graphs

Project description

co_lambda

CI PyPI Python versions License: MIT

A pure lambda-calculus interpreter and compiler, realizing the semantics of the paper paper/co-lambda.tex and depending on fixpoints.

pip install co-lambda

You write ordinary pure lambda terms, and the interpreter gives them powers a pure language normally lacks:

  • Cyclic and infinite data structures, built and transformed directly, with no letrec, no added recursion construct, and no mutable references.
  • Automatic memoization and dynamic programming: repeated subproblems are shared for you, with no cache written by hand.
  • A diverging loop is detected and returns a meaningless value in finite time instead of hanging.

The companion compiler turns a term into a standalone Python module, so a program written once as a lambda term can also run as compiled code.

No parser is provided: terms are built directly in Python, with a small prelude of the usual combinators, Church numerals, and Scott-encoded lists.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

co_lambda-0.6.0.post25.dev0.tar.gz (134.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

co_lambda-0.6.0.post25.dev0-py3-none-any.whl (138.3 kB view details)

Uploaded Python 3

File details

Details for the file co_lambda-0.6.0.post25.dev0.tar.gz.

File metadata

  • Download URL: co_lambda-0.6.0.post25.dev0.tar.gz
  • Upload date:
  • Size: 134.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for co_lambda-0.6.0.post25.dev0.tar.gz
Algorithm Hash digest
SHA256 3551626bce29080786a473780393594dac607ae59a257f56519359e8727f8bd2
MD5 79c04c45358241339f691ea2822778e6
BLAKE2b-256 a5549016a7aaa6e68b298dd3f02c4094e1b193696de467b9992b5dc1abd9ef27

See more details on using hashes here.

Provenance

The following attestation bundles were made for co_lambda-0.6.0.post25.dev0.tar.gz:

Publisher: ci.yml on Atry/co-lambda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file co_lambda-0.6.0.post25.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for co_lambda-0.6.0.post25.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 631d66718362d9848b0d44524d2d5ea6f1f61a1bc9fc4ef4c88ec3a29412d25e
MD5 75b8bc8dcfc3892ca2078cc825e458cf
BLAKE2b-256 6ebe5ad50bb257c8e4d44110467db820e28ee1267862a6828ea52ed90e7e7c2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for co_lambda-0.6.0.post25.dev0-py3-none-any.whl:

Publisher: ci.yml on Atry/co-lambda

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page