Skip to main content

A geometric esoteric language interpreter.

Project description

Geobe

Geobe is a geometric esoteric programming language interpreter written in Python. Programs are 2D grids of Unicode symbols where arrows control flow and shapes carry semantics.

Overview

Geobe programs are rectangular text grids. The interpreter finds every source node and follows directional flow through the grid until a path ends. The current MVP supports a single deterministic memory cell, input buffering, output collection, and pluggable transforms.

Core symbols:

  • read the next input value
  • store the current value in memory
  • transform the current value
  • change/delta transform the current value
  • append the current value to output
  • append the current value to output
  • traverse the current array by one index
  • ▶▶ continue the current array loop, or finish when exhausted
  • , , , move execution through the grid
  • «... » read a literal string into the current value
  • spell ... decode triangle alphabet symbols into lowercase text output

Spaces are treated as empty cells for traversal. Other non-traversable characters stop a path.

Installation

The project targets Python 3.11+.

#cd into project root:
python3 -m pip install .

Running Programs

Run a .geo file:

geobe examples/input_store_transform_output.geo --input hello

Run inline source:

geobe --code "○→▽" --input hello

Run a literal string program:

geobe --code "«hello, Geobe!»→▽"

Read additional input values from standard input:

printf 'first\nsecond\n' | geobe --code "○→▽\n○→▽" --stdin-input

Start the interactive spelling console:

geobe --console

In console mode, lowercase letters are echoed as Geobe's mapped alphabet symbols. Pressing Enter prints the English equivalent of the current line. For example, typing hello! displays ▹▶▿▿◂!, then Enter prints hello!.

Trace execution as JSON:

geobe --code "○→□→▽" --input hello --trace

Trace execution in readable text:

geobe --code "○→□→▽" --input hello --trace --trace-format text

Running the package module directly executes the built-in demo program:

python3 -m geobe

Example Program

examples/input_store_transform_output.geo

○→□→△→▽

With input hello, the program stores the value, applies the default identity transform, and outputs hello.

Array loop:

○→▶→◀→▶▶

With Python input [1, 2, 3], the program traverses the array and outputs [1, 2, 3].

Spelled text:

spell ▹▶▿▿◂ ◮◂ ◣▿▵!

This decodes to hello world! and outputs it.

Python code can also encode English into the triangle alphabet:

from geobe.parser import encode_spell_text

encoded = encode_spell_text("Hello world!")

Custom Transforms

The symbol is backed by a transform registry. The default transform is identity, and you can register your own behavior in Python code.

See examples/custom_transform.py for a minimal example that returns a custom formatted value.

Development

Run the test suite:

pytest

Run linting and type checks:

ruff check .
mypy src tests

Project Layout

  • src/geobe/ interpreter, parser, runtime state, and CLI
  • examples/ documented sample programs
  • tests/ coverage for the CLI, parser, interpreter, and examples

Package Entry Points

  • geobe CLI: geobe.cli:main
  • Module entry point: python3 -m geobe

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geobe-0.1.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geobe-0.1.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file geobe-0.1.1.tar.gz.

File metadata

  • Download URL: geobe-0.1.1.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for geobe-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4a8af3c445367e3f53ed980c7a2cee934e7f4eb926d04f45f8f1fa258c66c937
MD5 0b10ae7a7509b2632f6197a906cf7b17
BLAKE2b-256 d201ad718df92467ed7cde2301a7fd8e207c7e3ba5c2248aa8bbddc66522452c

See more details on using hashes here.

File details

Details for the file geobe-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: geobe-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for geobe-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7c41e656230e4849bafb6adc2cfccdb2d34efb5448365a5bbec6dc38652d4355
MD5 c40692173f754a2792d96169fe7bb94c
BLAKE2b-256 432578b4eb27daf114fa23a1f7122abf62757d01035044ad5a1640beabaaf433

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page