Skip to main content

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

  1. The Compiler: A cloud-based frontier model (or a strict local parser) reads the Wenli .wl script and validates the semantic types, variable references, and explicit closures.
  2. The Runtime Environment: Executes deterministic commands from the construted AST.
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wenli-0.0.1.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wenli-0.0.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

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

Hashes for wenli-0.0.1.tar.gz
Algorithm Hash digest
SHA256 81f3269e2ce6c75271eeac98b56775940c4b1e66bb3e7f5623c9acbc3594bc81
MD5 242cd8b88cb254ec5a7b6139d0cbd39e
BLAKE2b-256 d71fe16d92dba8f6889ec1122dc25150782a66ce58d3e3c3a6579630feda6e56

See more details on using hashes here.

Provenance

The following attestation bundles were made for wenli-0.0.1.tar.gz:

Publisher: python-publish.yml on wenli-lang/wenli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for wenli-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec5f761d065aeb14fd2b6c5350d6180c6d0a3d3d50c1e5d14273dca6b2cd6c7a
MD5 bd8009a80aaf486820435b61c09b23f7
BLAKE2b-256 e2474b4d84607f119c1cea995a6fb08d9bafaafe858a02522873676d556d9c95

See more details on using hashes here.

Provenance

The following attestation bundles were made for wenli-0.0.1-py3-none-any.whl:

Publisher: python-publish.yml on wenli-lang/wenli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page