A transpiler toolchain for Platskript, a parody programming language using Flemish dialect keywords that compiles to Python
Project description
VlaamsCodex
A transpiler toolchain for Platskript (.plats), a parody programming language that uses Flemish dialect keywords. VlaamsCodex compiles Platskript source code to Python and executes it.
Key Feature
After installation, you can run Platskript files directly with Python:
python examples/hello.plats
This "magic mode" works through Python's source encoding mechanism (PEP 263).
Installation
Option A: pipx (Recommended for End Users)
python -m pip install --user pipx
python -m pipx ensurepath
pipx install vlaamscodex
Option B: Virtual Environment
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install vlaamscodex
Option C: Development Installation
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e ".[dev]"
Usage
CLI Commands
Run a Platskript program:
plats run path/to/script.plats
Display generated Python code:
plats show-python path/to/script.plats
Compile to a Python file:
plats build path/to/script.plats --out output.py
Magic Mode
Platskript files begin with a Python encoding declaration:
# coding: vlaamsplats
After installing VlaamsCodex, execute directly with Python:
python path/to/script.plats
Quick Test
plats run examples/hello.plats
python examples/hello.plats
Expected output:
gdag aan weeireld
Example Program
# coding: vlaamsplats
plan doe
zet naam op tekst weeireld amen
maak funksie groet met wie doe
klap tekst gdag plakt spatie plakt tekst aan plakt spatie plakt da wie amen
gedaan
roep groet met da naam amen
gedaan
How It Works
- Python detects
# coding: vlaamsplats(PEP 263) and requests the corresponding codec. - During normal startup, Python's
sitemodule processes.pthfiles in site-packages. - VlaamsCodex installs
vlaamscodex_autoload.pthcontaining:import vlaamscodex.codec as _vc; _vc.register() - The
register()function registers thevlaamsplatscodec. - The codec decodes UTF-8 bytes, strips the encoding declaration, transpiles Platskript to Python, and returns valid Python source.
- Python executes the generated code transparently.
Language Specification (v0.1)
Statements terminate with amen. Programs are wrapped in plan doe ... gedaan.
Statements
| Syntax | Description |
|---|---|
zet <var> op <expr> amen |
Variable assignment |
klap <expr> amen |
Print expression |
maak funksie <name> met <params...> doe ... gedaan |
Function definition |
roep <name> met <args...> amen |
Function call |
geeftterug <expr> amen |
Return statement |
Expressions
| Syntax | Description |
|---|---|
tekst <words...> |
String literal (words joined by spaces) |
getal <digits> |
Numeric literal |
da <name> |
Variable reference |
spatie |
Space character literal |
plakt |
String concatenation operator |
Limitations
python -S: Disablessitemodule, preventing.pthhook execution.python -I: Isolated mode restricts site-packages access.- Fallback: Use
plats run script.platswhen magic mode is unavailable.
Troubleshooting
If you encounter SyntaxError: encoding problem: vlaamsplats:
- Verify VlaamsCodex is installed in the active Python environment.
- Ensure you are not using
-Sor-Iflags. - Use
plats runas an alternative.
Project Structure
src/vlaamscodex/ # Core implementation (compiler, codec, CLI)
data/ # Runtime artifacts (.pth startup hook)
examples/ # Sample Platskript programs
tests/ # Test suite
docs/ # Technical documentation
Documentation
- Overview
- How Python Runs It
- Packaging & Installation
- Language Specification
- Security Notes
- User Guide
Contributing
Contributions are welcome! Please read our Contributing Guidelines before submitting a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 vlaamscodex-0.1.3.tar.gz.
File metadata
- Download URL: vlaamscodex-0.1.3.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b90e0d9f2fa39a89af6f3c5f8c12c5e9f4c775431f61461d6833bc350b85d132
|
|
| MD5 |
677aa56422767568eefcaa45e5d2eb9a
|
|
| BLAKE2b-256 |
68fdef68540d10198d2f52c82df3b0d0a6e659f0c125e38129f3ac454734934c
|
File details
Details for the file vlaamscodex-0.1.3-py3-none-any.whl.
File metadata
- Download URL: vlaamscodex-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7a0dd71561d0bc9a2867d1c777af6d98bcf4ab941a6f80f0016fae0555b256c
|
|
| MD5 |
bd3590985b562cd1e4debaa4b65595cb
|
|
| BLAKE2b-256 |
6e5f5283a9873b4d417047c0844241b24cf0c88027e0120591f677c7407c9088
|