mu
mu is a small language that transpiles to Python. A file is indented
blocks without colons, calls of one argument without brackets, ..
ranges, x -> ... lambdas, <- push, folds (sum for x in xs: f(x)),
memo for a cached function with cases, and class for a Python class.
The Python it produces is plain and runs anywhere; the transpiler pastes
in the source of every helper the file calls.
pip install mu-language
python -m mulang file.mu # the Python
python -m mulang --fmt file.mu # the file, formatted
python -m mulang.repl # a REPL
Spec
The language is specified one version at a time: v0.1, v0.2, v0.3, v0.4, v0.5, v0.6, v0.7, v0.8, v0.9, v0.10.
Profiles
The language owns a few helpers (Grid, deep). The rest come from a
profile: a Python file that registers a project's library with
mulang.library(module, *names) and the names its run time preloads with
mulang.environment(objects). A project names its profile in
pyproject.toml:
[tool.mu]
profile = "mu/leetmu.py"
python -m mulang, the REPL, py2mu and the ide load it from the
working directory, or from the workspace root the ide is asked about.
The first profile is the LeetCode one in the leet repo, whose library
is the pydsa package (not yet published).
Tools
mulang.ide: hover, completion, go-to-definition and signature help over JSON lines, through the transpiled Python and Jedi.mulang.py2mu: a Python solution written as mu, in as few lines as the language allows.vscode/: the VS Code extension (highlighting, formatter, the ide, a debugger that steps through the mu file). Link it into~/.vscode/extensionsand reload the window.
Tests
pip install -e '.[test]'
pytest
The tests also need pydsa, the leet profile's library, on the path. Two of
them run only under the leet harness, whose sitecustomize preloads the names
LeetCode preloads; elsewhere they skip.
Metadata
Release files for mu-language 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mu_language-0.10.0.tar.gz | 78.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mu_language-0.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 144.6 kB
Release files / mu_language-0.10.0.tar.gz
| Download URL | mu_language-0.10.0.tar.gz |
|---|---|
| Size | 78.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f614d9d1de6c15a75b48d31be6520637a53436c6263237a3cea4b3dd7d1d04a4
|
|
BLAKE2b-256 checksum How to use checksums |
ca65353802237253247ce07704a2c8d65287891fe28e92ff8f0670069def6b43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mu_language-0.10.0-py3-none-any.whl
| Download URL | mu_language-0.10.0-py3-none-any.whl |
|---|---|
| Size | 66.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6f38bb2b8e5ea1596963d252ea5cf96bdaba81aa89ef2ad30d43cb1f1a476b3
|
|
BLAKE2b-256 checksum How to use checksums |
f8f7bf4d0787c9c0d3343aeb544457e9faf3b9f982a6c218a8a72490a1308ef2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|