A TrackMania-themed syntax wrapper for Python
Project description
TrackLang
A programming language* using TrackMania terminology
TrackLang is a syntax-level wrapper around Python.
Overview
TrackLang is a domain-specific language that maps TrackMania-inspired terminology to standard Python constructs.
TrackLang does not introduce new semantics, runtime behavior, or execution models. All TrackLang programs are translated into valid Python and executed using the Python interpreter.
If it works in Python, it works in TrackLang.
Design Goals
- Preserve full Python semantics
- Avoid custom runtimes or interpreters
- Keep translation logic simple and transparent
- Remain honest about what the project is
Non-Goals
TrackLang does not aim to:
- Improve performance
- Replace Python
- Introduce new language features
- Be suitable for production use
Example
TrackLang source:
START_RACE main():
PB time = 3
LOOP_TRACK time FASTER_THAN 0:
CHAT time
PB time = time - 1
FINISH
FINISH
GO main()
Translated Python:
def main():
time = 3
while time > 0:
print(time)
time = time - 1
main()
The programs are functionally identical.
Syntax Overview
TrackLang replaces a small set of Python keywords with TrackMania-themed aliases. All other syntax is standard Python.
Control Flow
| TrackLang | Python |
|---|---|
| START_RACE | def |
| CHECKPOINT | if |
| ALT_ROUTE | elif |
| ELSE_ROUTE | else |
| LOOP_TRACK | while |
| LAP | for |
| FINISH | end |
Statements
| TrackLang | Python |
|---|---|
| CHAT | |
| PB x = y | x = y |
| GO f() | f() |
| RESTART_MAP | return |
| DNF | break |
| RESET_RUN | continue |
| INSTALLOPENPLANETPLUGIN {module} | import {module} |
| INSTALLOPENPLANETPLUGIN {module} AS {alias} | import {module} as {alias} |
| DOWNLOADFROMNADEO {module} {thing} | from {module} import {thing} |
Operators
| TrackLang | Python |
|---|---|
| FASTER_THAN | > |
| SLOWER_THAN | < |
| EQUALS | == |
| NOT_PB | != |
| AT_LEAST | >= |
| AT_MOST | <= |
Indentation Model
TrackLang uses explicit block terminators.
- Blocks begin with control statements
- Blocks end with FINISH
- Indentation is generated automatically during translation
This removes whitespace sensitivity while preserving Python compatibility.
Installation
pip install tracklang
Usage
tracklang example.tm
Limitations
- Errors originate from Python
- Debugging occurs in translated Python
- No sandboxing is provided
Intended Use
TrackLang is intended for:
- Educational experiments
- Language tooling exploration
- Demonstrations
- Jokes taken seriously
It is not recommended for production systems. Seriously. It isn't.
Project details
Release history Release notifications | RSS feed
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 tracklang-0.2.1.tar.gz.
File metadata
- Download URL: tracklang-0.2.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
090e64fed1d69e8f140fcd77dbfc58ca33d6f370c93ea82a22ab31d965068eef
|
|
| MD5 |
62c4f9d2cd05dcb86bafb71f720b4362
|
|
| BLAKE2b-256 |
96a170d16c5c0b9cef66bcfc06cf9d71c153d46457af9cfaea473c3065163934
|
Provenance
The following attestation bundles were made for tracklang-0.2.1.tar.gz:
Publisher:
python-publish.yml on Melodii7785/TrackLang
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tracklang-0.2.1.tar.gz -
Subject digest:
090e64fed1d69e8f140fcd77dbfc58ca33d6f370c93ea82a22ab31d965068eef - Sigstore transparency entry: 774570193
- Sigstore integration time:
-
Permalink:
Melodii7785/TrackLang@9eefe9bca261d8bd8149f71719456fb6df1bf214 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/Melodii7785
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9eefe9bca261d8bd8149f71719456fb6df1bf214 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tracklang-0.2.1-py3-none-any.whl.
File metadata
- Download URL: tracklang-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bdb7cf716fdd8490d99d7797b142294c3226ba052e922be9f5840277624b142
|
|
| MD5 |
5145419ab7ce83cb00893547858eb076
|
|
| BLAKE2b-256 |
3b89dd5a322ca54373d370c1e347fd5e0f0270b582a2026c29f08455f84a8d54
|
Provenance
The following attestation bundles were made for tracklang-0.2.1-py3-none-any.whl:
Publisher:
python-publish.yml on Melodii7785/TrackLang
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tracklang-0.2.1-py3-none-any.whl -
Subject digest:
2bdb7cf716fdd8490d99d7797b142294c3226ba052e922be9f5840277624b142 - Sigstore transparency entry: 774570196
- Sigstore integration time:
-
Permalink:
Melodii7785/TrackLang@9eefe9bca261d8bd8149f71719456fb6df1bf214 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/Melodii7785
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9eefe9bca261d8bd8149f71719456fb6df1bf214 -
Trigger Event:
release
-
Statement type: