stck
playgroundspecgithub

Stck Programming Language

Stck is a minimal stack based esoteric programming language. Data is stored on an unlimited number of stacks. Stacks can be pushed to, popped from, or manipulated with operators.

"Hello, World!">o
Playground

Getting Started

You can use Stck via the online playground, install it with NPM, or try it out with NPX.

npm i -g stck

For information on the syntax, read the spec.

Usage

The stck command accepts a single filename as a parameter.

The following command will run the file example.stck.

stck example.stck
# OR
npx stck example.stck

You can pass input to your program via stdin.

echo "1\n2\nworld" | yarn start examples/hello.stck

stdin is parsed and each line is pushed as a value onto the input stack (i). Numbers are parsed as number and everything else is a string.

Stck can also be used programmatically with the run function. The second parameter is optional and is the value of the input stack. The contents of the output stack are returned.

import { run } from "stck";
run("i>o", [1]);
// => [1]

Example

If the you have the following program in example.stck.

"hello ">o i>o "
">o
i>a i>a a+a a>o

when run with the command

echo "1\n2\nworld" | yarn start examples/hello.stck

The output will be

hello world
3

Source

Find the source on Github.

Acknowledgements

Stck is heavily inspired by Kipple. It also takes inspiration from many languages on the esolang wiki.