Skip to main content

MicaLang

Mica is a scripting language and its execution engine, built around a single idea: creating a fully isolated, arbitrarily nestable runtime environment should be a cheap, first-class operation in the language itself.

Syntax borrows a subset of Python, but Mica source is compiled into Mica's own instruction stream and executed by the Mica engine — never through exec/eval. Every VM starts with zero capabilities: its own virtual IO, its own in-memory filesystem, and the ability to create child VMs. Everything else (network, host data, whatever you choose) is granted explicitly, layer by layer, through FFI.

中文文档与项目说明

Status

0.1.0 prototype. The engine is a Python reference implementation (codename Mica-PY): zero runtime dependencies, Python ≥ 3.12, 198 regression tests. APIs and semantics may change before 1.0.

Security note. Mica is designed for isolation, but the current prototype runs in the host process and has not been formally audited. Do not rely on it as the only boundary when executing adversarial code. See the security model (中文) for exactly what is and is not guaranteed.

Install

pip install micalang

The distribution is named micalang; the import package is mica.

Quick start

As a CLI:

printf 'print("hello from mica")\n' > hello.mica
micalang hello.mica        # hello from mica

Embedded in Python:

from mica import MicaEngine

engine = MicaEngine()
vm = engine.create_root("""
sub = VM("print('hello from a child VM')")
print(sub.run())
""")
print(vm.run(), end="")

Grant a capability to a VM (FFI):

def double(x):
    return x * 2

vm = engine.create_root("print(double(21))", functions={"double": double})
print(vm.run(), end="")    # 42

What a Mica VM is

A VM is a cheap, self-contained workspace:

  • it cannot see its parent's variables, files, or handles, and cannot tell how deep it is nested;
  • it has its own empty in-memory filesystem (text only — structurally unable to touch the real disk);
  • resource quotas (instructions, memory, output, child VMs, nesting depth, …) can only be tightened, never loosened, and a child's consumption is charged to all its ancestors;
  • its parent can preset files, feed input, single-step it statement by statement or instruction by instruction, snapshot its state, or terminate it;
  • it can create its own child VMs — isolation is recursive, because untrusted code is.

Documentation

Document Language Contents
Design notes 中文 What Mica is, why it exists, where the boundaries are
Language reference 中文 The language subset and semantics, self-contained
Architecture 中文 Engine structure, invariants, resource quotas
Security model 中文 Threat model; what the engine does and does not guarantee
Build journal 中文 How Mica 0.1.0 was built, stage by stage, with runnable checkpoints (git checkout stage-1 … stage-6)
Behind the scenes 中文 Origin story and how AI-assisted development was used

An English documentation set is planned after 0.1.0.

How this project was built

Mica was developed with AI assistance throughout — design discussion, implementation, testing, adversarial review, and documentation drafting. What the AI did, what the author did, and how outputs were verified are documented in AI-assisted development (中文), with selected conversation records alongside.

Roadmap

  • List/dict/string methods and more ergonomic syntax
  • Performance benchmarks (child-VM creation cost, per-instruction overhead)
  • A normative language spec and a conformance test suite, so a future non-Python engine can be validated against them
  • Evaluation of a native engine (the package name is language-level on purpose: micalang survives an engine rewrite)

The name

Mica (云母) is a layered mineral: it cleaves into thin sheets, each sheet complete in itself, and it is an insulator — layers do not conduct into each other. That is the shape of a Mica VM tree.

Not related to the Windows "Mica" UI material, the PyPI bioinformatics package MICA, or the (inactive) Rust scripting language named Mica.

License

Apache-2.0 — see NOTICE.

Metadata

Release files for micalang 0.1.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 micalang 0.1.0
File Size Uploaded Provenance
micalang-0.1.0.tar.gz 135.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for micalang 0.1.0
File Interpreter ABI Platform
micalang-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 163.5 kB

Release files / micalang-0.1.0.tar.gz

Download URL micalang-0.1.0.tar.gz
Size 135.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cdda06ace0462136fab1f8929b751eeca39d88262cfe95cc18afa06a5b304dce
BLAKE2b-256 checksum
How to use checksums
47860648cf877706b0d5f5e2d4ee31207c916a322c36b9da95eabe171084e208
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / micalang-0.1.0-py3-none-any.whl

Download URL micalang-0.1.0-py3-none-any.whl
Size 27.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4c5fc3afcf11f546ae8606e68372cff6bd36499dadf17c0159f5f5a66c5bb16
BLAKE2b-256 checksum
How to use checksums
8aafad859ad10a3b2e4d717233f8a09cc77838b0dcc54365b572b5258f5c8841
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for micalang 0.1.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for micalang-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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