Pool is a befunge inspired, two-dimensional esolang

Overview

pool

An ergonomic, befunge and <>< inspired language.

1. The Language

pool is a two-dimensional language. Unlike boring and limited languages, pool can escape the boring realm of linearity and enter planar space. Whilst pool is mainly stack-based, it provides other modern features such as memory allocation on a heap(? i guess, idk). pool targets advanced programmers who strive both speed of execution as well as ease of use. We at pool team ™️ ® have not yet proven that pool is turing complete but it probably is.

2. The Instructions

instruction meaning
v change the instruction pointer's direction downwards, if it is moving horizontally
^ change the instruction pointer's direction upwards, if it is moving horizontally
< change the instruction pointer's direction to go left, if it is moving vertically
> change the instruction pointer's direction to go right, if it is moving vertically
+ pop two values off the stack and push their sum
- pop two values a,b off the stack and push their difference b-a
* pop two values off the stack and push their product
/ pop two values a,b off the stack and push their quotient b/a
% pop two values a,b off the stack and push their quotient b%a
0-9 and a-f push the value of the literal in hex to the stack
, pop the top value of the stack and print it (all 8 bytes)
" enter string mode, in where " will end string mode. In string mode, a backslash \ encodes a newline when followed by n , tab when followed by t, carriage return when followed by r, " when followed by "
; pop the top value of the stack and exit with it as exit code
$ drop the top value on the stack
! pop the top value on the stack and if it is 0 push 0 else push 1
` pop two values a,b off the stack and push 1 if b>a else push 0
& swap the top two values of the stack
| if moving horizontally, pop the top value on the stack. If it is unequal to zero, the pointer is mirrored and now will be going in the other direction
_ if moving vertically, pop the top value on the stack. If it is unequal to zero, the pointer is mirrored and now will be going in the other direction
s pop two values address,value off the stack and set the heap at address to value
r pop a single word address off the stack and push the value of the heap at address to the stack
n or pop a single value off the stack and push the square root of it (yeah) (n because √ didnt work in c++, v is already used, b too so n it is)

3. Getting Started

3.1 Installation

Build from source: make sure rust is installed, then run

cargo build --release

the binary will be in ./target/release/pool-lang

3.2 Tutorial

create a new file called tutorial.2d or clone tutorial.2d

every program should start with this. The instruction pointer will start at . and move in > direction. In fact, . alone is equivalent to this but I think .> is more idiomatic

.> 

Let's write a first Hello Pool program. It is very easy actually

.> "Hello Pool!\n",,,,,,,,,,,,0;

but this a) is ugly and b) prints out


!looP olleH

that is because pool is stack based, which is an LIFO (last in first out) data structure. To mend this, we can change the program to read

.> "\n!looP olleH" ,,,,,,,,,,,,0;

Now with that knowledge we can do loops. A basic loop looks like this.

.>  ff*0 > 1+ oo &` v

         ^ ,"!"   | < "\n",0;

Here, first a maximum value is pushed (ff* = 15 * 15 = 225). On the stack, we also need the counter which we initialize with 0. It is then incremented by 1. Then the maximum and the counter are duplicated, swapped and compared, such that if the counter is greater than the maximum it pushes 1 to the stack, leading the pointer to be reflected by |.

You might also like...
Matrix bot inspired by Shirt Bot.

matrix-openai-bot Matrix bot inspired by Shirt Bot. Usage Run the bot after building it or grabbing the latest release $ matrix-openai-bot Edit the ge

Programming language from down under, inspired by this Reddit post.
Programming language from down under, inspired by this Reddit post.

aussie++ Programming language from down under, inspired by this Reddit post. View live demo here. Special thanks to MarkWhyBird, louis100, and others

Programming Language Inspired by Brainfuck
Programming Language Inspired by Brainfuck

Brainsuck Brainfuck but not really... like... a better version of it. Installation Requirements: Rust version 1.50 or higher Linux curl https://raw.gi

A Star Wars inspired by programming language

The Force The Force is a gateway to abilities many believe are unnatural... Getting Started Install Rust. We also provide a Dev Container if you would

A Litecord compatible/inspired OSS implementation of Discord's backend for fun and profit.

A Litecord compatible/inspired OSS implementation of Discord's backend for fun and profit.

Expression transformation language. An esolang.

Etl Etl (pronounced like "nettle" without the n) is an esoteric programming language for transforming expressions. There are three data types in Etl:

This code generate coinjoin transaction whici has two inputs and two outputs

How to create coinjoin transaction This code generate coinjoin transaction whici has two inputs and two outputs. First, we create two trasactions. The

Lagoon is a thread pool crate that aims to address many of the problems with existing thread pool crates.

Lagoon is a thread pool crate that aims to address many of the problems with existing thread pool crates. Example Lagoon's scoped jobs can be u

Android Device Pool - A tool to run device tests against a pool of devices.

adp (Android Device Pool) What is this? A tool to run device tests against a pool of devices. It will 'checkout' a device to run your tests against an

Quick Pool: High Performance Rust Async Resource Pool

Quick Pool High Performance Rust Async Resource Pool Usage DBCP Database Backend Adapter Version PostgreSQL tokio-postgres qp-postgres Example use asy

A higher dimensional raytracing prototype with non-euclidean-like features
A higher dimensional raytracing prototype with non-euclidean-like features

euclider A higher-dimensional "non-euclidean" ray tracing prototype written in Rust. Dual-licensed under MIT or the UNLICENSE. Installation Install th

ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations

ndarray The ndarray crate provides an n-dimensional container for general elements and for numerics. Please read the API documentation on docs.rs or t

K-dimensional tree in Rust for fast geospatial indexing and lookup

kdtree K-dimensional tree in Rust for fast geospatial indexing and nearest neighbors lookup Crate Documentation Usage Benchmark License Usage Add kdtr

K-dimensional tree in Rust for fast geospatial indexing and lookup

kdtree K-dimensional tree in Rust for fast geospatial indexing and nearest neighbors lookup Crate Documentation Usage Benchmark License Usage Add kdtr

2 and 3-dimensional collision detection library in Rust.

2D Documentation | 3D Documentation | User Guide | Forum ⚠️ **This crate is now passively-maintained. It is being superseded by the Parry project.** ⚠

2 and 3-dimensional rigid body physics engine for Rust.

Users guide | 2D Documentation | 3D Documentation | Forum ⚠️ **This crate is now passively-maintained. It is being superseded by the Rapier project.**

k-dimensional tree

kd-tree k-dimensional tree in Rust. Fast, simple, and easy to use. Usage // construct kd-tree let kdtree = kd_tree::KdTree::build_by_ordered_float(vec

a super fast scientific calculator with dimensional analysis support written in Rust 🦀

larvae a super fast scientific calculator with dimensional analysis support written in Rust 🦀 🐛 heavily inspired from insect Usage: Command mode: $

Releases(mac)
Owner
null
Provides two APIs for easily cancelling futures, with the option to fallback to a timeout cancellation

tokio-context Provides two different methods for cancelling futures with a provided handle for cancelling all related futures, with a fallback timeout

Peter Farr 18 Dec 27, 2022
Explore the WWW and find the shortest path between two HTML documents

explore Find shortest path between two web resources. About I decided to create this project because some day I started to wonder: In how many clicks

Eryk Andrzejewski 1 Apr 10, 2022
This repository simulates and renders fluid particles in two dimensions, in Rust.

mlsmpm-particles-rs This repository simulates and renders fluid particles in two dimensions, in Rust. My matching implementation in Go is mlsmpm-parti

null 6 Oct 31, 2022
Insert a new named workspace between two other named workspaces

Insert a new named workspace between two other named workspaces

null 2 Mar 13, 2022
Private swaps for Secret Network using a private entropy pool & differential privacy.

WIP SecretSwap: Anon Edition Private swaps for Secret Network! Uses private entropy pool for differential privacy when reporting pools sizes. Swap amo

Enigma 5 Apr 5, 2022
A thread pool for running multiple tasks on a configurable group of threads.

Threadfin A thread pool for running multiple tasks on a configurable group of threads. Extra features: Dynamic pool size based on load Support for asy

Stephen M. Coakley 46 Dec 5, 2022
Asset-Pool is a decentralized lending protocol and enables users to lend through their social networks

Run If you need to, set up your Substrate development environment . Then, build and run a development chain: $ cargo run -- --dev --tmp Once the node

antimatter-repo 11 Oct 22, 2022
Opensource diagnostic software for Daimler vehicles, inspired by Xentry and DAS, written in Rust

OPENSTAR An opensource diagnostic application for Daimler vehicles inspired by DAS and Xentry. Some of the work here is based on OpenVehicleDiag If yo

Ashcon Mohseninia 21 Nov 20, 2022
A library and tool for automata and formal languages, inspired by JFLAP

Sugarcubes is a library and application for automata and formal languages. It is inspired by JFLAP, and is intended to eventually to be an alternative to JFLAP.

Henry Sloan 22 Nov 2, 2022
Wally is a modern package manager for Roblox projects inspired by Cargo

Wally is a package manager for Roblox inspired by Cargo (Rust) and npm (JavaScript). It brings the familiar, community-oriented world of sharing code from other communities into the Roblox ecosystem.

Uplift Games 194 Jan 3, 2023