ball-lang — the Ball language, Python toolchain
Ball is a programming language where every
program is a Protocol Buffer message. This distribution bundles the whole Python
toolchain: the Ball → Python compiler, the Python → Ball encoder, the
self-hosted engine, the zero-dependency runtime, and the ball CLI.
pip install ball-lang
Usage
ball --version # the installed toolchain version
ball check program.ball.json # validate without running
ball compile program.ball.json # Ball -> Python source [-o out.py]
ball encode source.py # Python -> Ball program [-o out.ball.json]
ball run program.ball.json # execute via the self-hosted engine
Programs are read as proto3 JSON (.ball.json / .json), optionally wrapped in
a google.protobuf.Any @type envelope.
Exit codes: 0 success · 1 runtime error · 2 invalid program / usage ·
3 I/O error.
First ball run compiles the engine
The Ball engine is itself a Ball program. Rather than ship a generated ~690 KB
Python module, this wheel carries the engine's Ball source and compiles it
with the bundled Ball → Python compiler the first time you run ball run,
caching the result. That takes well under a second; every later run reuses the
cache.
The cache lives in %LOCALAPPDATA%\ball-lang\engine on Windows and
$XDG_CACHE_HOME/ball-lang/engine (default ~/.cache/ball-lang/engine)
elsewhere. Set BALL_CACHE_DIR to override it — useful in containers, CI, and
read-only-HOME environments. The cache key covers the installed version and a
hash of the bundled source, so an upgrade recompiles rather than reusing a stale
engine.
Python API
from ball_compiler.compiler import compile as compile_program
from ball_compiler.loader import load_program
from ball_encoder.encoder import encode
src = compile_program(load_program("program.ball.json"))
License
MIT — see the repository.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ball_lang-0.1.0.tar.gz.
File metadata
- Download URL: ball_lang-0.1.0.tar.gz
- Upload date:
- Size: 621.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11653de4c2b3c3828ae54c366e021851d783bd76bdea2bc1927cb27688f14367
|
|
| MD5 |
45743f1f56d599f8fd1df2cdcabff691
|
|
| BLAKE2b-256 |
93c228ca436f0caa9fa02bc1cf9e2feb685dad5ad09d54a384ba56a3d96715b7
|
Provenance
The following attestation bundles were made for ball_lang-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on Ball-Lang/ball
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ball_lang-0.1.0.tar.gz -
Subject digest:
11653de4c2b3c3828ae54c366e021851d783bd76bdea2bc1927cb27688f14367 - Sigstore transparency entry: 2716465488
- Sigstore integration time:
-
Permalink:
Ball-Lang/ball@673cc8f318b366a9081487b1083e868418d3cacd -
Branch / Tag:
refs/tags/python-pypi/v0.1.0 - Owner: https://github.com/Ball-Lang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@673cc8f318b366a9081487b1083e868418d3cacd -
Trigger Event:
push
-
Statement type:
File details
Details for the file ball_lang-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ball_lang-0.1.0-py3-none-any.whl
- Upload date:
- Size: 631.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
446b9471ee003db81f080104062053567090db8a26e22dc2b74371e8a600b9dc
|
|
| MD5 |
9e57a7f27ce853307120f4ebaab57606
|
|
| BLAKE2b-256 |
ee88096c6c66bc92f1cbb1cda07980614f6534a9543811fb3988e0b68da3d53a
|
Provenance
The following attestation bundles were made for ball_lang-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on Ball-Lang/ball
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ball_lang-0.1.0-py3-none-any.whl -
Subject digest:
446b9471ee003db81f080104062053567090db8a26e22dc2b74371e8a600b9dc - Sigstore transparency entry: 2716465780
- Sigstore integration time:
-
Permalink:
Ball-Lang/ball@673cc8f318b366a9081487b1083e868418d3cacd -
Branch / Tag:
refs/tags/python-pypi/v0.1.0 - Owner: https://github.com/Ball-Lang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@673cc8f318b366a9081487b1083e868418d3cacd -
Trigger Event:
push
-
Statement type: