Skip to main content

Aca, a functional programming language, and shitty toy

Project description

Aca

Aca, a functional programming language, and shitty toy.

Aca is a toy functional programming language initially inspired by ISWIM. The interpreter is currently written in Python.

Install

$ pip install acalang

Example

  1. Command line usage
$ cat foo.aca
let main =
    dechurch 3

$ aca foo.aca
3

$ aca foo.aca -S    # `noeval' mode
(lambda x: dechurch(x))((lambda x: x)((lambda f: lambda x: (f(f(f(x)))))))

$ aca       # REPL
$ aca -S    # REPL with `noeval'
  1. Lambda calculus
let main =
    (\x y f. f x y)
  1. Standard library for basic datatypes
let a = zero
let b = succ zero
let main = dechurch b
-- 1
  1. Sugar for Church numerals
let main = 0

-- This is identical to
{-
let main =
    (\x . x)
-}
  1. Special builtin functions for debugging (decoded into Python value)
let main =
    dechurch 42
-- Output: 42

let main =
    debool true
-- Output: True

let main =
    dereal (neg (u2i 42))
-- Output: -42
  1. Simple module import with use
$ foo.aca
let foo = 42

$ bar.aca
use foo

let main =
    dechurch foo

$ aca bar.aca
42

Goals

  • Before v1.0.0:
    • Untyped lambda calculus
  • v1.0.0:
    • Simply typed lambda calculus
  • v2.0.0:
    • System F

License

MIT

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

acalang-0.5.0.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file acalang-0.5.0.tar.gz.

File metadata

  • Download URL: acalang-0.5.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for acalang-0.5.0.tar.gz
Algorithm Hash digest
SHA256 22be4fa7a0db8c84edfee5f19fd325689a1542af768fa14230d9728d45dd8194
MD5 469ce64cfac747492dc58c22b00283be
BLAKE2b-256 5aa9c1088267696e94eecc9168d8a56b864817e71f0a290905253046215c02f9

See more details on using hashes here.

Supported by

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