Skip to main content

mu

Documentation: www.shyal.com/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
mu file.mu        # the Python
mu --fmt file.mu  # the file, formatted
mu-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, v0.11, v0.12.

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). Install the .vsix from the latest vscode-v* release, or link the folder into ~/.vscode/extensions and reload the window. See vscode/README.md.

Releasing

PyPI: bump version in pyproject.toml, then uv build and uv publish dist/* with UV_PUBLISH_TOKEN set (.envrc).

Editor extension: bump version in vscode/package.json and add a line to vscode/CHANGELOG.md, then tag and push:

git tag vscode-v0.1.0 && git push origin vscode-v0.1.0

The vscode workflow runs the adapter tests, packages the .vsix, checks the tag against package.json, and attaches the .vsix to a GitHub release. A pull request that touches vscode/ runs the same steps without releasing. The extension is on neither registry: the VS Code Marketplace needs a Microsoft account and Open VSX an Eclipse account, and neither would open one.

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.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mu-language 0.12.0
File Size Uploaded Provenance Actions
mu_language-0.12.0.tar.gz 86.6 kB Without provenance Details for mu_language-0.12.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mu-language 0.12.0
File Interpreter ABI Platform Actions
mu_language-0.12.0-py3-none-any.whl Python 3 none any Details for mu_language-0.12.0-py3-none-any.whl

Total release size: 159.2 kB

Release files / mu_language-0.12.0.tar.gz

Download URL mu_language-0.12.0.tar.gz
Size 86.6 kB
Tags Source
SHA-256 checksum
How to use checksums
173014591c5a40708ee89f60225bb0f0263b6301435981771b64d33f61bcdd07
BLAKE2b-256 checksum
How to use checksums
29b8e6166426265579cf7244e57230be7eb909aa63dd91201fb3306a52dc9959
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.12.0-py3-none-any.whl

Download URL mu_language-0.12.0-py3-none-any.whl
Size 72.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
225783b9b409ad2ae7f8cb003b53c179c9e66c86736d46542f2df955a4c8cf85
BLAKE2b-256 checksum
How to use checksums
3492f277329371a2bb53154920bff25aca721cf50815a4479d93d880be3a9288
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}

Security for mu-language 0.12.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page