Toolkit for compiling and executing the Linden Scripting Language as Python
Project description
Lummao
Lummao is a toolkit for compiling and executing the Linden Scripting Language as Python. It aims to ease testing of LSL code by leveraging Python's existing ecosystem for debugging and testing. Think of it as the less opinionated, stupider cousin of LSLForge's unit testing framework.
It could conceivably be used for compile-time evaluation of pure functions with statically known arguments.
The runtime is largely handled by the excellent implementation of LSL's basic operations and library functions from LSL-PyOptimizer.
To see an example input script and its Python output, see the test_resources
directory.
Setup
LSL PyOptimizer is not distributed in a form that would allow easily using it as a library, it must be installed separately, with an environment variable pointing to its location so Lummao can find it.
- Download https://github.com/Sei-Lisa/LSL-PyOptimizer
- Create a new environment variable named
LSL_PYOPTIMIZER_PATH
and set its value to the the path you placed LSL-PyOptimizer in - Download https://github.com/SaladDais/tailslide and follow the compilation instructions, doing
make install
at the end - Download https://github.com/SaladDais/Lummao
pip install -e .
- You can now use
lummao
to transpile an LSL script to a Python script. - Hooray
Why
If you've ever written a sufficiently complicated system in LSL, you know how annoying it is to debug your scripts or be sure if they're even correct. Clearly the sanest way to bring sanity to your workflow is to convert your LSL scripts to Python, so you can mock LSL library functions and use Python debuggers. Hence the name "Lummao".
TODO
- Use LSL-PyOptimizer's
lslparse
/lsloutput
stuff rather than rely on native code for transpilation -
- Just used Tailslide since it was easier for me to get started with it.
- Symbol shadowing behavior is not correct
- The behavior of variables whose declarations are
jump
ed over is not correct - Provide mock helpers for:
-
- inter-script communication
-
- HTTP
-
- auto-stubs for all functions
-
- state-aware event queueing (and state switching, for that matter)
License
GPLv3
Licensing Clarifications
The output of the compiler necessarily links against the GPL-licensed runtime code from LSL-PyOptimizer for functionality, and LSL-PyOptimizer does not provide a library exception in its license. You should assume that any LSL converted to Python by the compiler and any testcases you write exercising them must also be distributable under the GPL.
In short: If or when you distribute your testcases, you must also allow distribution of their direct dependencies (your LSL scripts) under the terms of the GPL. This does not necessarily change the license of your LSL scripts themselves, or require consumers of your scripts to license their own scripts under the GPL. It is perfectly possible to have an otherwise MIT-licensed or proprietary library with a GPL-licensed test suite. No distribution of testcases == no requirement to distribute under the GPL.
Suggested reading to understand your rights and obligations under the GPL when using a GPL-licensed test suite:
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
File details
Details for the file lummao-0.1.2.tar.gz
.
File metadata
- Download URL: lummao-0.1.2.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad7211794c33c9c23dcaafee60b3d791757f445e761f37f36678aa4137a67542 |
|
MD5 | 30a1a8abbdadebe56ba0c242432757f4 |
|
BLAKE2b-256 | 7cafd0427e28c761c942485db0a9fc0b14434460bdb8c79d98e7fdfb05a826a6 |
File details
Details for the file lummao-0.1.2-cp38-abi3-manylinux_2_24_x86_64.whl
.
File metadata
- Download URL: lummao-0.1.2-cp38-abi3-manylinux_2_24_x86_64.whl
- Upload date:
- Size: 554.8 kB
- Tags: CPython 3.8+, manylinux: glibc 2.24+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67cf9f8ebc158161a9b9776c1e9fe140d18af3e09f26007877eeb1d9251e907f |
|
MD5 | e09021c661f621e08dd9a162032d8957 |
|
BLAKE2b-256 | 5a18368a4db8bfadef2f82252c712d34b93787a91a324e88031a5c6cd14d342a |