https://github.com/progbits/spacebar
A C to Whitespace transpiler.
https://github.com/progbits/spacebar
c esolang menhi ocaml transpiler whitespace
Last synced: 26 days ago
JSON representation
A C to Whitespace transpiler.
- Host: GitHub
- URL: https://github.com/progbits/spacebar
- Owner: progbits
- License: mit
- Created: 2021-03-26T23:26:24.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-25T11:44:44.000Z (almost 3 years ago)
- Last Synced: 2024-11-14T20:39:07.975Z (7 months ago)
- Topics: c, esolang, menhi, ocaml, transpiler, whitespace
- Language: OCaml
- Homepage:
- Size: 73.2 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-esoasm - SpaceBar - A C to Whitespace transpiler. (High level imperative languages / Esoteric Subset C compilers)
README
# Spacebar
A [C](https://en.wikipedia.org/wiki/The_C_Programming_Language) to
[Whitespace](https://en.wikipedia.org/wiki/Whitespace_(programming_language))
transpiler.## Getting Started
Spacebar is written in [OCaml](https://ocaml.org/), instructions on how to install
OCaml for your operating system can be found in the [offical
documentation](https://ocaml.org/docs/install.html).Spacebar uses the [Dune](https://github.com/ocaml/dune) build
system. Instructions on installing Dune can be found in the [project
documentation](https://github.com/ocaml/dune#installation).Once you have installed OCaml and Dune, the project can be built by running
```shell
dune build
```Once built, the `spacebar.exe` build artifact can be found in the
`_build/default` directory.## Usage
Spacebar reads C code from stdin and outputs transpiled Whitespace code to
stdout. For example, to transpile one of the examples in the functional test
suite to a file called `out.ws`:```shell
cat test/basic_main.c | ./_build/default/spacebar.exe > out.ws
```## Testing
A [Bats](https://github.com/bats-core/bats-core) based functional test suite is
provided in the [`test`](https://github.com/progbits/spacebar/tree/main/test)
directory. By default the test suite expects an existing Whitespace interpreter
on the path with the name `wspace`. The Spacebar binary used for testing is
sourced from the default build directory (`_build/default/`).To run the test suite:
```shell
./test/functional.sh
```