Wenli (文理), an AI-Native Programming Language (ANPL) designed for the era of autonomous agents.
Project description
Wenli (文理)
A strictly typed, AI-native programming language.
📖 The Philosophy: Order + Smart
Wenli (文理) is an AI-Native Programming Language (ANPL) designed for the era of autonomous agents and local SLMs.
The name originates from the inherent patterns found in nature:
- 文 (Wen) - The Language: Code that reads with the fluidity and expressiveness of natural language prose. Highly readable, even for non-programmers.
- 理 (Li) - The Logic: A strict, unforgiving underlying structure. It compiles into a deterministic Abstract Syntax Tree (AST) with strong semantic typing, explicitly managing control flow and state.
Current AI interaction is stuck in the "machine code" era. Prompt engineering is fragile, expensive, and leads to the Token Monster—an ever-expanding context window that drowns small local models in irrelevant history. Wenli stops "prompting" and starts programming, decoupling complex reasoning from local execution.
✨ Core Features
- Context Firewall (Heap vs. Stack): Instead of treating chat history as an endless stack, Wenli treats context as a heap. The runtime only injects explicitly named variables (
> 变量名) into the SLM's active KV-Cache, purging the rest. - Semantic Strong Typing: Beyond basic strings and integers, Wenli enforces Semantic Types. If an agent hallucinates a response that fails the semantic type check, Wenli triggers a structured Refinement Loop rather than crashing the pipeline.
- Strict vs. Agent Calls: Clear lexical separation between deterministic tool execution (calling Python scripts, CLI tools, standard libraries) and probabilistic SLM inference.
- Static Distillation: The ultimate endgame. As Wenli monitors execution logs, it may asks cloud frontier models to write permanent, deterministic code (like a Python function) to replace probabilistic SLM steps that have proven to be purely deterministic over time. Your AI agent slowly compiles itself into a zero-token software suite.
💻 Language Specification Sneak Peek
Wenli is written in strict, beautifully formatted Markdown with exact punctuation rules.
⚙️ How It Works
- The Compiler: A cloud-based frontier model (or a strict local parser) reads the Wenli
.wlscript and validates the semantic types, variable references, and explicit closures. - The Runtime Environment: Executes deterministic commands from the construted AST.
- The Local SLM (Interpreter): When an Agent Call is reached, the runtime spins up a constrained prompt, injects only the explicitly requested variables, and returns the strongly typed output.
🚀 Getting Started
Wenli is currently in active development. The initial compiler and runtime engine are being built to support seamless integration with standard command-line tools and local model servers.
🤝 Contributing
We believe in the open-source ethos. If you are passionate about compiler design, LLM orchestration, or creating deterministic tools for an unpredictable AI world, PRs and discussions are welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wenli-0.0.1.tar.gz.
File metadata
- Download URL: wenli-0.0.1.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81f3269e2ce6c75271eeac98b56775940c4b1e66bb3e7f5623c9acbc3594bc81
|
|
| MD5 |
242cd8b88cb254ec5a7b6139d0cbd39e
|
|
| BLAKE2b-256 |
d71fe16d92dba8f6889ec1122dc25150782a66ce58d3e3c3a6579630feda6e56
|
Provenance
The following attestation bundles were made for wenli-0.0.1.tar.gz:
Publisher:
python-publish.yml on wenli-lang/wenli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wenli-0.0.1.tar.gz -
Subject digest:
81f3269e2ce6c75271eeac98b56775940c4b1e66bb3e7f5623c9acbc3594bc81 - Sigstore transparency entry: 1142783987
- Sigstore integration time:
-
Permalink:
wenli-lang/wenli@4ba734d80e9d0bbb37c2a06ef7d74f11b2513ca1 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/wenli-lang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4ba734d80e9d0bbb37c2a06ef7d74f11b2513ca1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file wenli-0.0.1-py3-none-any.whl.
File metadata
- Download URL: wenli-0.0.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec5f761d065aeb14fd2b6c5350d6180c6d0a3d3d50c1e5d14273dca6b2cd6c7a
|
|
| MD5 |
bd8009a80aaf486820435b61c09b23f7
|
|
| BLAKE2b-256 |
e2474b4d84607f119c1cea995a6fb08d9bafaafe858a02522873676d556d9c95
|
Provenance
The following attestation bundles were made for wenli-0.0.1-py3-none-any.whl:
Publisher:
python-publish.yml on wenli-lang/wenli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wenli-0.0.1-py3-none-any.whl -
Subject digest:
ec5f761d065aeb14fd2b6c5350d6180c6d0a3d3d50c1e5d14273dca6b2cd6c7a - Sigstore transparency entry: 1142784024
- Sigstore integration time:
-
Permalink:
wenli-lang/wenli@4ba734d80e9d0bbb37c2a06ef7d74f11b2513ca1 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/wenli-lang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4ba734d80e9d0bbb37c2a06ef7d74f11b2513ca1 -
Trigger Event:
release
-
Statement type: