Skip to content

Latest commit

Β 

History

1,911 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Zydeco πŸͺ—

DOI

Zydeco is a proof-of-concept programming language based on Call-by-push-value.

OOPSLA Artifact Evaluation

The instructions are located in lib/tests/oopsla/README.md.

Documentation

  • DESIGN.md: language model and implementation architecture
  • CONTRIBUTE.md: build, test, and development workflows

Running Zydeco

Create a file hello-world.zy in the repository root:

param (
  (/system) :
  @[import("lib/std/builtin.zy")] _
) in
  let (/stdio; /process) = system in
  ! (stdio/write_line) "hello, world!" { ! (process/exit) 0 }

Then run

cargo run -- run hello-world.zy
hello, world!

Alternatively, run

cargo build --release

to build the executable which will be stored at target/release/zydeco.

Then run

./target/release/zydeco run hello-world.zydeco

and see

hello, world!

Run zydeco --help for further usage information.

Interactive REPL

Start the full-screen terminal REPL with:

zydeco repl

Each submitted term receives an input number such as [1]. A later term can hygienically splice that source with @[import(1)] _; the integer is deliberately unquoted, because @[import("1")] _ denotes a file named 1. The REPL uses root metadata annotations for its commands:

@[type] ret 1
@[run] ret 1
@[help] _
@[quit] _

Press Enter to evaluate complete syntax or continue an incomplete term on a new line. Alt+Enter always inserts a newline, and Ctrl+Enter submits the current text for diagnostics. A type checking error leaves the editor and input number unchanged so the source can be corrected and retried.

Intro to Zydeco

For a complete source-level guide, see docs/tutorial/zydeco-guide.md.

We now have a toy "literate zydeco" written in zydeco! Try it out by running

cd docs/spell && make build

and the product will show up right in the folder - which is also a series of guide to programming in zydeco. Maybe we should call it "co-literate zydeco" because it turns commented zydeco into markdown.

A legacy version of the tutorial lies here. You might find the short tutorial easier to follow if the previous spell guide goes too fast.

We will develop more introductory material on zydeco when we have implemented more features. For now, you can also choose to browse lib/ for some example programs.

To run all tests

cargo test-all

Editor Support

The cajun binary is Zydeco's Language Server Protocol implementation. It provides live syntax and name-resolution diagnostics, document symbols, and go to definition across imported files:

cargo install --path editor/cajun

Client integrations live under editor/vscode and editor/zed.

Rust API Docs

To generate documentation for a package:

cargo doc --package zydeco-statics --no-deps

The output is written to target/doc/.

Repository Structure

.
β”œβ”€β”€ Cargo.toml
β”œβ”€β”€ lang
β”‚  β”œβ”€β”€ derive
β”‚  β”œβ”€β”€ syntax
β”‚  β”œβ”€β”€ surface
β”‚  β”œβ”€β”€ statics
β”‚  β”œβ”€β”€ session
β”‚  β”œβ”€β”€ dynamics
β”‚  β”œβ”€β”€ stackir
β”‚  β”œβ”€β”€ assembly
β”‚  β”œβ”€β”€ amd64
β”‚  β”œβ”€β”€ llvm
β”‚  β”œβ”€β”€ tests
β”‚  └── utils
β”œβ”€β”€ cli
β”œβ”€β”€ tui
β”œβ”€β”€ web
└── ...
  • lang/: the library implementing the parser, type checker and interpreter for the Zydeco language.
  • lib/: standard library, reusable examples, and lib/tests/ regression projects
  • cli/ Command-line interface
  • tui/ Ratatui frontend for the interactive REPL
  • web/ Web interface

Related Literature

Zydeco is based on the Call-by-push-value calculus introduced by Paul Blain Levy: https://dl.acm.org/doi/10.1145/3537668.3537670

Related Language Implementations

About

a proof-of-concept programming language based on call-by-push-value

Resources

Stars

68 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages