🐱 LynxScript (Python Port)
LynxScript is a programming language designed for CatWeb, a Roblox game where users can build website-esque creations. The LynxScript compiler compiles source code files into a JSON format that can be imported directly into CatWeb.
This project is a complete, architecturally faithful port of the original Rust implementation into Python 3.10+.
Usage
Syntax
LynxScript features a syntax familiar to web developers:
// Familiar syntax to web-devs
console.log("Hello, world!");
// In-language standard library definition
#[export_as("console.log")]
function log(arg) {
// Raw CatWeb block ID calls
#0(#"", arg);
}
Command Line Interface
You can compile a LynxScript source file to JSON using the following CLI arguments:
# Compile a LynxScript source file to JSON and output it to output.json
lync --compile ./src/main.lxs --output ./out/output.json
# Or just output the JSON onto the console
lync -c ./src/main.lxs
# (-c is shorthand for --compile, and -o for --output)
If you are running directly from the source directory, you can invoke the module via Python:
python -m lynxscript.main -c <path_to_script>.lxs -o <output_path>.json
Features & Roadmap
- Function declarations
- Event handlers
- Raw CatWeb block ID calls
- In-language standard library implementation
- Link statement (Importing site JSON files and referencing UI objects)
- Arbitrary expression compilation (binary, boolean)
- Return statements
- If statements
- Loops
- Optimizations
- Function inlining
- Constant folding
- Dead code elimination
Installation
You can install lynxscript directly from PyPI:
pip install lynxscript
Or install it locally in editable mode for development:
- Clone the repository.
- Go to the project directory and run:
pip install -e .
- You can now use the
lynccommand directly in your terminal!
Development & Testing
Prerequisites
- Python 3.10 or newer.
pytestfor running tests (installed automatically viarequirements.txtor as dev dependency).
Running Tests
To run tests (which verify the parser and compiler AST output matches character-for-character with original Rust snapshots):
pytest
License
This project is licensed under the MIT License.
Acknowledgments
- Similar project: catlua also shaped the ecosystem of CatWeb text-based programming languages ✨
- Original Rust implementation by pickaxe828.
Rewritten in Python by Ziad.
Metadata
Release files for lynxscript 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lynxscript-0.1.1.tar.gz | 13.9 kB | Without provenance | Details for lynxscript-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lynxscript-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for lynxscript-0.1.1-py3-none-any.whl |
Total release size: 27.8 kB
Release files / lynxscript-0.1.1.tar.gz
| Download URL | lynxscript-0.1.1.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d84b3cb2448f8345bcebfe204afb8a163cbb5b3c535599fb086e2326fce368d1
|
|
BLAKE2b-256 checksum How to use checksums |
7da59a799f953aff866ce556fe71f04686415179ffe3ecae4efffbc700d5239c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / lynxscript-0.1.1-py3-none-any.whl
| Download URL | lynxscript-0.1.1-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b40647fad60ee26d005d8f3a5189ffc0926e688240f1cbf1d81620127d3543d
|
|
BLAKE2b-256 checksum How to use checksums |
5e2d941c90e3daaa76e2287e0687fff7bfdef47d06a3f6f757f83f470b210ee2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for lynxscript 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.