lclang
lclang is a pure-Python, async-first configuration expression language for
Python 3.14+. The 0.3.0 language, runtime, .lclcfg, and typed CLI release candidate is
verified; publication is a separate maintainer action. See
CHANGELOG.md.
The distribution and import name is lclang; production code lives under
src/lclang.
Project status
- Target: 0.4.0 development release
- Latest completed milestone: M008 —
lclangidentity andsrcpackage layout - Next planned milestone: M100 — trusted-input security boundary audit
- Implemented: foundation, enforced English rST API docs, source-aware lexer,
immutable AST, complete expression/comprehension parsing, all planned V1
expression forms, deterministic AST-to-source rendering, semantic f-string
parsing, stable root parse/print APIs, async expression evaluation with
recursively awaited sync/async iterable items, lexical
closures, structured failures, assertions, try recovery, finalization, and
synchronous/asynchronous context management, semantic f-string evaluation,
immutable runtime modules, and hierarchical single-flight Frame caching with
structured cycle detection, cancellation isolation, and atomic targeted
recalculation without dependant invalidation, plus task-local depth, work, and
materialized-collection limits, deterministic Frame close/resource cleanup,
scope-aware eager/conditional/deferred dependency analysis, immutable module
dependency graphs, filtered queries, deterministic topological ordering,
bounded runtime lookup tracing, static/dynamic edge reconciliation, and
owner-aware immutable Frame dependency snapshots with atomic refresh semantics,
plus shallow immutable host presets, reusable independent Frame factories,
manifest-driven read-only attribute namespaces, and reviewed async iterable,
text, immutable data, and strict JSON helpers in a standard preset, exposed
through a focused root API for the complete runtime workflow, plus preferred
source-string
define_module/define_frameshortcuts and the canonicalLCL_ROOT -> LCL_BUILTINS -> LCL_RUNTIME -> LCL_IMPORTS -> userhierarchy, preferredFrame.derivechild construction, non-evaluatinghasandget_definitionlookup inspection, side-effect-freeinspect_variabledependency trees with first-seen direct-name deduplication and source-oriented one-line representations with typed value/error payloads, including canonical<node-type>: <LCL expression>payloads for AST values and canonical source reprs for evaluated LCL function closures, plus controlled right-biasedFrame.mixinhost-value updates, definition-scopedlhs(), strictYYYYMMDDdate builtins, the native variadic fixed-point builtinrecursive, and non-evaluating Frame-qualified dependency graphs with value terminals and lookup paths, lexical closure ownership forlhs(), source-stringevaluate_sync, deterministic direct/FrameFactory IDs, and a dependency analytics tutorial backed by audited nested dependency and Frame packages, plus immutable CLI values, exact async command decorators, nested snake_case groups, full-argv parsing, structured help, lazy preset/default/config/override Frame layering, handler-owned dryrun, isolated logging, result/cleanup mapping, conciseCliResult.success/failconstructors, valueless override keys as booleanTrue, and built-inparse_lclwith optional evaluated inspection, lazyeval_lcl, and deterministic nestedbuiltinsmodule commands, with canonical lclang builtins and standard namespaces identified asNativeProvidedand rendered uniformly asBuiltin FunctionorBuiltin Namespace, plus structured failures carrying direct-to-failing variable evaluation stacks, plus ordered workflow execution-status trees, shared sub-task manager cursors, deterministic parent aggregation, subtree locking, exception-transparentwithfinalization, and scoped steps with atomic description/status updates and clean auto-success, packaged with thelclangidentity from thesrc/lclangsource tree - Test status: 844 tests pass at 100.00% branch coverage; strict mypy, Ruff, exhaustive source/docstring policy, executable documentation, and artifact gates pass
The authoritative milestone ledger is in progress.md. Planned features are deliberately not presented as implemented features.
Quickstart
Run from a checkout with its development environment installed. The example is extracted and executed by the test suite.
import asyncio
import lclang
async def main() -> None:
module = lclang.define_module(
"quickstart",
{"result": 'json.encode({"message": "hello lclang"})'},
)
frame = lclang.define_frame(module)
try:
print(await frame.get("result"))
snapshot = frame.dependency_snapshot("result")
print(",".join(str(edge.target) for edge in snapshot.dynamic_edges))
finally:
await frame.close()
asyncio.run(main())
Inspect an override-defined result without evaluating it, or evaluate it through the same lazy Frame pipeline:
python -m lclang.cli builtins
python -m lclang.cli parse_lcl -o a 100 -o b 200 -o RESULT "LCL[a+b]"
python -m lclang.cli eval_lcl -o a 100 -o b 200 -o RESULT "LCL[a+b]"
The first command lists canonical builtins and nested namespace methods. The
second prints the static RESULT -> a, b inspection tree. The third prints
100200 because ordinary CLI override values are literal strings.
Continue with the tutorial index, then choose the runtime guide, LCL examples gallery, or configuration-file guide. Use the dependency analytics tutorial for static graphs, Frame paths, runtime traces, and reconciliation. The CLI tutorial shows how to build a configuration-driven Python script. The workflow-status tutorial explains task/step trees, aggregation, descriptions, locking, and scoped error capture for both tasks and steps. The runtime API guide remains the detailed reference.
Intended capability
The 0.4 target comprises:
- a versioned Python-like expression grammar with a custom AST;
- an async-first interpreter and cached hierarchical runtime frames;
- dependency analysis with eager, conditional, deferred, and dynamic edges;
- UTF-8
.lclcfgfiles with versionedusingexpansion and source-aware diagnostics; - a typed framework for building configuration-driven command-line tools;
- strict typing, branch coverage, parser differential tests, stress tests, memory-leak checks, and portable package verification.
Engineering policy
Development is documentation-first and test-driven. Every implementation milestone starts with an executable behavioural contract, demonstrates a failing test, implements the behaviour, passes the complete quality gate, and then updates both README files and the progress ledger. Production and unit-test submodules mirror one another as defined in the module-layout specification.
The language is intended for trusted application configuration. It is not a security sandbox for hostile expressions.
Documentation
- Durable development rules: AGENTS.md
- Progress and verification evidence: progress.md
- English specifications:
docs/specs/ - Complete LCL syntax: docs/lcl-lang.md
- English tutorial index: docs/tutorials/README.md
- Runtime tutorial: docs/tutorials/runtime.md
- LCL examples gallery: docs/tutorials/lcl_examples.md
- Configuration-file tutorial: docs/tutorials/config_file.md
- Dependency analytics tutorial: docs/tutorials/dependency-analytics.md
- Python-script CLI tutorial: docs/tutorials/cli.md
- Workflow-status tutorial: docs/tutorials/workflow-status.md
- Chinese CLI tutorial: doc_cn/cli_cn.md
- Chinese tutorials:
doc_cn/
License
MIT. Version 0.3.0 requires Python 3.14+ and has no runtime dependencies.
Metadata
Release files for lclang 0.3.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 | |
|---|---|---|---|
| lclang-0.3.0.tar.gz | 360.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lclang-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 556.6 kB
Release files / lclang-0.3.0.tar.gz
| Download URL | lclang-0.3.0.tar.gz |
|---|---|
| Size | 360.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d632df79ee1962dcb073a5ba880beb59210b77a17fe8ead5fb4ff8bac89190a9
|
|
BLAKE2b-256 checksum How to use checksums |
809bd35b9121c1eba16e6fcf32b3e570aa54a4a2d616faa0e11a4270200d411f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / lclang-0.3.0-py3-none-any.whl
| Download URL | lclang-0.3.0-py3-none-any.whl |
|---|---|
| Size | 196.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca8ed9a3dad2d731a0bf9d576a1b74fa468acdb1e29a4d1daab5164a86bdd47c
|
|
BLAKE2b-256 checksum How to use checksums |
1aba4e013fdc7b8ebed2696309f29de56a58e49ed1067a0332ea9fe9b4283d26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|