Skip to main content

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.

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/extensions and 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.1

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.10.1
File Size Uploaded
mu_language-0.10.1.tar.gz 78.4 kB Details

Built distribution (wheel)

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

Total release size: 145.1 kB

Release files / mu_language-0.10.1.tar.gz

Download URL mu_language-0.10.1.tar.gz
Size 78.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fb147f8f4aaea8169e6c493fce6590cbae5c07d7ae10f839cf71eabad7b06bca
BLAKE2b-256 checksum
How to use checksums
c018e51ce660d9dac41a71abef9fcd1c34f87c677ed5a4a2628b3d21947d62f7
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.1-py3-none-any.whl

Download URL mu_language-0.10.1-py3-none-any.whl
Size 66.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7ef10ac3507a438a8632049e0f6b7e753140f6e3f20f72aae71443aaf2634c8
BLAKE2b-256 checksum
How to use checksums
21faeb5e255e2be8f192a95bc76cded5f00cdb31a67c2f8dfc2694d77a88b413
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 history Release notifications | RSS feed

This release

0.10.1 This release

2 release files

0.10.0

2 release files

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