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+.

python3 -m pip install geobe==0.1.2

To install from a local checkout for development:

python3 -m pip install -e ".[dev]"

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.2.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.2-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geobe-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 7b2846ea192bcbf4b0f5b6e242f53de08a7c4e7f0cb7415d3e702333bff83fb7
MD5 8fb5c007455e58b8ab12b2878fdf9f1e
BLAKE2b-256 115db0a6e7a151e3964fa179f26785108e3997d1915896a4100ef4a4e6e1d82e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: geobe-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 224122e176428d8c0a816e904f11dea34193cc6a695c673d710db2147fd2258b
MD5 e79fc880eb2736bcad068ec71e2be7cc
BLAKE2b-256 d061c80f4e6bf1417a73cec845b84c98e5412094de6f0edf9ce9b304743686f5

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