https://github.com/firobe/boblang
Test implementation of FPC with computation/value modality
https://github.com/firobe/boblang
Last synced: 4 months ago
JSON representation
Test implementation of FPC with computation/value modality
- Host: GitHub
- URL: https://github.com/firobe/boblang
- Owner: Firobe
- Created: 2019-06-25T00:27:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-28T22:23:14.000Z (over 4 years ago)
- Last Synced: 2025-07-24T03:52:47.417Z (11 months ago)
- Language: OCaml
- Size: 66.4 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Boblang
An implementation of FPC (PCF + recursive types) by value, with a encoding of by
name thanks to a computation/value modality.
Written after following a lecture of Robert "Bob" Harper in OPLSS 2019.
## Language features
Boblang comes with:
- support for modern state-of-the-art technology such as pairs and binary sum
types
- recursive functions (fixpoint operator not included)
- a messy grammar which is a mix of Coq, OCaml and lambda-calculus
- a wonky parser with terrible error messages
- a mean typechecker and an unbounded interpreter
- source files ending in .bob
- a glorious standard library called libob
See also `examples/example.bob` for a a basic introduction.
## Usage
Compile with `dune build boblang.exe`
Execute with `dune exec ./boblang.exe source.bob`
## Usefulness
As a proof that this language is very useful to do things,
`examples/brainfuck.bob` contains a Brainfuck interpreter written in Boblang.
With it, you can run the Brainfuck program contained in `examples/hello.fuck`
`dune exec ./boblang.exe examples/brainfuck.bob < examples/hello.fuck`
After consuming 100% of one of your CPUS for approximately one minute, it should
eventually manage to print "Hello world!".