Skip to main content

SKIio

This repository implements an interpreter for SKIio and a compiler from a higher level language Purr to SKIio. A description of Purr can be found below.

SKIio is an extremely minimal programming language that's an extension of SKI Combinator Calculus for I/O. Here's what it looks like:

; Repeat forever: Read and print a byte of user input
S(K(S(S(S)(K(S(K(S(K(S(S(K(o))(i))))))(S(K(S(S)(K(K))))
(S(K(K))(S(K(S(S)))(K)))))))(K(S(S(K(S))(K))))))(S(K(K)
)(S(S)(K(K(K(I))))))(S(S(K(S(S)(K(S(I)(I)))))(K))(S(K(S
(S)(K(S(I)(I)))))(K)))

SKIio consists of 5 combinators: S, K, I, as defined in the original SKI Combinator Calculus, and i and o, which does input and output.

  • i(x): Reads a byte of input at index x
    • x is a church encoded integer
    • Returns a church encoded integer
  • o(x): Prints the byte x
    • x is a church encoded integer
    • Returns I.

E.g. The program o(i(K(I))) reads a byte of user input and prints it.

To see the Purr spec read PURR.md.

To see the SKIio spec read SKIIO.md

For more information about how SKIio and Purr is implemented, see DETAILS.md

Quickstart

Installation

pip install skiio

Running

You could write an SKIio program in a file, say test.ski, and run it with:

python -m skiio run -i test.ski

You could also write a Purr program in a file, say test.purr, and compile it:

python -m skiio compile -i test.purr -o test
python -m skiio run -i test.ski

More options (e.g. optimizations, debugging) can be found with

python -m skiio -h

Full usage:

usage: SKIio [-h] {compile,c,run,r} ...

SKIio interpreter and compiler, command-line interface

positional arguments:
  {compile,c,run,r}  Action
    compile (c)      Compile Purr code
    run (r)          Run SKIio code

optional arguments:
  -h, --help         show this help message and exit  


usage: SKIio {compile, c} [-h] -i INFILE -o OUTFILE [-opt OPTIMIZE] [-m INTERMEDIATE]

optional arguments:
  -h, --help            show this help message and exit
  -i INFILE, --infile INFILE
                        Input filename with Purr code
  -o OUTFILE, --outfile OUTFILE
                        Output filename (without extension)
  -opt OPTIMIZE, --optimize OPTIMIZE
                        Toggle off optimization (default: True)
  -m INTERMEDIATE, --intermediate INTERMEDIATE
                        Output intermediate representation (default: False)     

usage: SKIio {run, r} [-h] -i INFILE [-v] [-vv]

optional arguments:
  -h, --help            show this help message and exit
  -i INFILE, --infile INFILE
                        Input filename with SKIio code
  -v, --verbose         Prints debugging info (default: None)
  -vv, --veryverbose    Steps through execution (default: None)

Examples

Examples can be found in the examples folder

Purr:

SKIio:

Metadata

Release files for skiio 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for skiio 1.0.2
File Interpreter ABI Platform
skiio-1.0.2-py3-none-any.whl Python 3 none any Details

Release files / skiio-1.0.2-py3-none-any.whl

Download URL skiio-1.0.2-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbe0fafa362d3c3cfb77cadccc3d1128117d8b8f3feb0112b7bc7876ff5fdf69
BLAKE2b-256 checksum
How to use checksums
13b9caf612a4eafa7a4e95529b3e501a7eff5f4dd0caad956a061aed3012726d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.3 Windows/10

Release history Release notifications | RSS feed

This release

1.0.2 This release

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page