YaoXiang Design Manifesto
Version: v2.0.0 Status: Officially Released Author: Chenxu + YaoXiang Community Date: 2026-05-31
“The Dao gives birth to one, one to two, two to three, and three to all things.” — Tao Te Ching
Types are like the Dao; all things arise from them.
I. Why Was YaoXiang Created?
1.1 Filling a Gap in Programming Languages
Throughout the history of programming languages, we have witnessed the birth and evolution of countless excellent languages: C brought an efficiency revolution to systems programming, Python created a programming experience accessible to everyone, Rust proved that memory safety and performance could coexist, and TypeScript made large frontend projects maintainable. Yet when we examine today’s language ecosystem, we still find an obvious gap—no single language can simultaneously satisfy the following three core needs:
| Requirement | Problems with Existing Solutions |
|---|---|
| Type Safety | Rust is overly strict and has a steep learning curve; TypeScript has optional types and cannot provide compile-time guarantees |
| Natural Syntax | Rust’s syntax is complex and obscure; Haskell’s functional model has too high an entry barrier; traditional static languages are verbose and cumbersome |
| AI-Friendly | Existing languages often have ambiguous syntax, complex ASTs, and hard-to-predict hidden behavior, limiting the accuracy of AI-generated and AI-modified code |
YaoXiang was created to fill this gap. We believe that programming languages should be both powerful and approachable, safe and efficient, and rigorous and elegant.
1.2 Solving Practical Problems
Problem One: Fragmentation of the Type System
Today’s programming languages exhibit severe fragmentation in their type systems. Staticly typed languages pursue absolute correctness at compile time, but often do so at the cost of development efficiency. Dynamically typed languages offer flexibility, but expose difficult-to-maintain flaws in large projects. YaoXiang introduces a unified abstraction framework in which “everything is a type,” making types the throughline of language design rather than a patch applied afterward.
Problem Two: Choosing Between Memory Safety and Performance
For a long time, developers have had to make difficult choices between memory safety and runtime performance. GC (garbage collection) liberates developers, but introduces latency variance and memory overhead. Manual memory management is efficient, but is as dangerous as walking a tightrope. YaoXiang adopts a Rust-style ownership model that eliminates data races and memory leaks at compile time while retaining zero-cost abstractions and achieving high performance without GC.
Problem Three: The Cognitive Burden of Async Programming
Modern applications cannot avoid networking and concurrency, yet async programming has long been a programmer’s nightmare. Nested callbacks, chained Promises, and async/await syntax all increase code complexity. YaoXiang has redesigned the async model: spawn explicitly marks parallel points, and the compiler constructs a dependency graph within that expression and executes it in parallel. The caller synchronously blocks while waiting for the result (RFC-024). There are no callbacks, no await, and no function coloring.
Problem Four: The Bottleneck of AI-Assisted Programming
When AI begins assisting developers in writing code, language design choices become crucial. Ambiguous syntax rules, implicit type conversions, and complex syntactic sugar—features to which human programmers are accustomed—become obstacles to AI understanding and generation. From the very beginning, YaoXiang made “AI-friendliness” a core objective: strict indentation rules, clear code block boundaries, and unambiguous syntactic structures enable AI to accurately understand, generate, and modify code.
1.3 The Philosophical Foundations of the Language
The name YaoXiang derives from “Yao” and “Xiang” in the I Ching. “Yao” are the basic symbols that form hexagrams and symbolize the changes of yin and yang and the coexistence of movement and stillness. “Xiang” is the external manifestation of a thing’s essence, representing the myriad phenomena and encompassing everything.
This philosophy is reflected in every detail of the language’s design:
- Unity: Just as simple yao symbols compose complex hexagrams, YaoXiang uses a few core concepts—types, functions, and constructors—to construct a complete programming model
- Hierarchy: Just as xiang are distinguished as prenatal and postnatal, YaoXiang’s type system has a clear hierarchy, ranging from primitive types to generics and from values to meta types
- Transformability: Just as yin and yang circulate through endless change, YaoXiang supports dependent types, allowing types to evolve as values change
- Recognizability: Just as hexagrams can be interpreted and all things can be represented, YaoXiang provides complete type reflection, with runtime type information fully available
- Provability: Just as hexagrams reveal the laws of things, YaoXiang’s type system follows the Curry-Howard isomorphism (types as propositions, programs as proofs); type checking is the verification of a logical proof
II. Core Philosophy and Principles
The following design tenets are the cornerstones of YaoXiang. They are non-negotiable and inviolable. Every feature proposal must be tested against these principles.
2.1 Principle One: Everything Is a Type
In YaoXiang’s worldview, types are the highest-level units of abstraction and the core concept that runs throughout the language.
Concrete manifestations:
- A value is an instance of a type:
42is an instance ofInt, and"hello"is an instance ofString - A type is itself a type:
Typeis the language’s only meta type keyword; the type ofIntisType - A function is a type mapping:
add: (a: Int, b: Int) -> Intdescribes a type mapping fromInt × InttoInt - A module is a composition of types: a module is a namespace composition containing functions and types
Why this is non-negotiable: A unified type abstraction simplifies language semantics, eliminates the duality between values and types, and makes the type system a guardian of code correctness rather than an obstacle to it.
2.2 Principle Two: Strict Structuring
YaoXiang’s syntax is designed to be “unambiguous, predictable, and easy to parse.”
Specific rules:
- Mandatory four-space indentation: Tab characters are prohibited, and code block boundaries are immediately apparent
- Brackets cannot be omitted: function parameters must be enclosed in parentheses, and list elements must be separated by commas
- Code blocks must use braces: control flow such as
if,while, andformust be enclosed in{ } - A minimal set of keywords: only 18 core keywords are retained, rejecting the proliferation of syntactic sugar
Why this is non-negotiable: Strict structuring provides three key advantages: (1) more accurate IDE syntax highlighting and code folding; (2) greatly improved accuracy in AI code generation and modification; and (3) rapid understanding of code structure for new learners.
2.3 Principle Three: Zero-Cost Abstractions
High-level abstractions should not impose runtime performance overhead.
Specific guarantees:
- Monomorphization: generic functions are expanded into concrete versions at compile time, with no vtable lookup overhead
- Inlining optimization: simple functions are automatically inlined, eliminating function call overhead
- Stack allocation first: small objects are allocated on the stack by default, with heap allocation used only when necessary
- No GC: the ownership model guarantees memory safety without the runtime overhead of a garbage collector
Why this is non-negotiable: Performance is the survival threshold of a programming language. Any design that trades performance for convenience betrays programmers.
2.4 Principle Four: Immutability by Default
Mutability and complexity go hand in hand. YaoXiang chooses immutability by default, making code easier to reason about and understand.
Specific rules:
- Variables are immutable by default and cannot be modified after assignment
- When mutability is required,
mutmust be explicitly declared - References are immutable by default; mutable references require a
mutmarker - Transferring ownership invalidates the original binding
Why this is non-negotiable: Immutability is the foundation of concurrency safety, a safeguard for code readability, and the culmination of the wisdom of functional programming.
2.5 Principle Five: Types Are Data
Type information should not exist only at compile time; it should be fully available at runtime.
Specific capabilities:
- Runtime type queries: the type information of any value can be obtained
- Type reflection: types themselves can be constructed and manipulated
- Pattern-matching destructuring: type constructors can be used directly in pattern matching
- Generic specialization: the concrete, monomorphized types of generic parameters can be obtained at runtime
Why this is non-negotiable: Complete type reflection is the foundation of metaprogramming and a cornerstone of high-performance frameworks and tools.
III. Key Innovations and Features
While absorbing the excellent features of existing languages, YaoXiang introduces the following innovative designs.
3.1 Innovation One: Unified Type Syntax
Type definitions in traditional languages often require multiple keywords:
// Rust
struct Point { x: f64, y: f64 }
enum Result<T, E> { Ok(T), Err(E) }
enum Color { Red, Green, Blue }
trait Drawable { fn draw(&self, s: &Surface); }YaoXiang’s unified syntax: everything follows name: type = value, with Type as the only meta type keyword.
# === Record type ===
Point: Type = {
x: Float,
y: Float,
}
# Fields with default values
Point3D: Type = {
x: Float = 0,
y: Float = 0,
z: Float = 0,
}
# === Generic type ===
Option: (T: Type) -> Type = {
some: (T) -> Self,
none: () -> Self,
}
Result: (T: Type, E: Type) -> Type = {
ok: (T) -> Self,
err: (E) -> Self,
}
# === Interface type (a record whose fields are all function types) ===
Drawable: Type = {
draw: (Surface) -> Void,
bounding_box: () -> Rect,
}
Serializable: Type = {
serialize: () -> String,
}
# === Interface implementation (the interface name appears inside the type body) ===
Point: Type = {
x: Float,
y: Float,
Drawable,
Serializable,
}
# === Methods (Type.method syntax) ===
Point.draw: (self: &Point, surface: Surface) -> Void = {
surface.plot(self.x, self.y)
}Value of the innovation: no keyword fragmentation such as fn, struct, enum, trait, or impl—one unified syntax covers every kind of declaration.
3.2 Innovation Two: Constructors Are Types
Value construction and function calls are exactly the same:
# Type definition
Point: Type = { x: Float, y: Float }
Option: (T: Type) -> Type = {
some: (T) -> Self,
none: () -> Self,
}
# Value construction: identical to a function call
p: Point = Point(3.0, 4.0)
opt: Option(Int) = Option.some(42)
none: Option(Int) = Option.none()
# Pattern matching: direct destructuring
match opt {
Option.some(value) -> print(value)
Option.none -> print("nothing")
}3.3 Innovation Three: Curried Method Binding
YaoXiang adopts a purely functional design, using currying to provide syntactic sugar for object-style method calls without introducing class and method keywords.
# === Type definition ===
Point: Type = {
x: Float,
y: Float,
}
# Core function: Euclidean distance
distance: (a: Point, b: Point) -> Float = {
dx = a.x - b.x
dy = a.y - b.y
return (dx * dx + dy * dy).sqrt()
}
# Method syntax sugar binding ([0] means binding to parameter position 0)
Point.distance = distance[0]
# === Usage ===
p1 = Point(3.0, 4.0)
p2 = Point(1.0, 2.0)
# Both calling forms are exactly equivalent
d1 = distance(p1, p2) # Direct call to the core function
d2 = p1.distance(p2) # Method syntax sugar
# Curried usage
dist_from_p1 = p1.distance # Partial application; waits for the second argument
d3 = dist_from_p1(p2) # 2.828Value of the innovation: a purely functional design with no hidden self parameter; functions are values and can be passed and composed freely.
3.4 Innovation Four: The Spawn Model
“All things move together; I observe their returning.” — I Ching, Fu Hexagram
The spawn model draws inspiration from this passage and describes a programming paradigm in which developers describe logic synchronously and sequentially, while the language runtime automatically and efficiently executes the computational units within it concurrently, like all things moving together, and ultimately coordinates them in unity.
Three core principles:
| Principle | Description |
|---|---|
| Synchronous Syntax | WYSIWYG sequential code |
| Concurrent Nature | The runtime automatically extracts parallelism |
| Unified Coordination | Results converge automatically when needed, ensuring logical correctness |
Terminology:
| Official Term | Corresponding Syntax | Explanation |
|---|---|---|
| Spawn Function | spawn (params) => body | Defines a computational unit that can participate in spawn execution |
| Spawn Block | spawn { a(), b() } | An explicitly declared concurrency domain; tasks within the block execute concurrently |
| Spawn Loop | spawn for x in xs { ... } | Data parallelism; the loop body executes concurrently over all elements |
| Spawn Value | No standalone handle (RFC-024) | No Async(T)/future handle; the caller synchronously blocks while waiting for the result |
| Spawn Graph | In-expression DAG (RFC-024) | The stage on which spawning occurs; the dependency graph is built only within a spawn expression, with no whole-program analysis |
| Spawn Scheduler | Runtime task scheduler | The intelligent hub that coordinates everything so that it runs concurrently at the right time |
See also: RFC-024 Spawn-Based Concurrent Runtime Semantics (for the orthogonal syntax, see RFC-032)
# === Spawn function ===
# A function marked with spawn
fetch_data: (url: String) -> JSON spawn = {
return HTTP.get(url).json()
}
# === Spawn block ===
# Expressions inside spawn { } are forced to execute in parallel
compute_all: () -> (Int, Int, Int) spawn = {
(a, b, c) = spawn {
heavy_calc(1), # Task 1
heavy_calc(2), # Task 2
another_calc(3) # Task 3
}
return (a, b, c)
}
# === Explicit spawn + synchronous wait ===
main: () -> Void = {
# Parallel points must be explicitly marked: RFC-024 has no whole-program automatic parallelism
(users, posts) = spawn {
fetch_data("https://api.example.com/users"),
fetch_data("https://api.example.com/posts")
}
# Evaluating the spawn expression blocks synchronously and returns the results directly (no future handle)
print(users.length + posts.length)
}Thread safety:
# The ref keyword automatically handles thread safety (the compiler automatically chooses Rc/Arc)
main: () -> Void = {
counter = ref SafeCounter(0)
# Sharing across tasks: the compiler automatically selects Arc
spawn {
counter.increment()
}
spawn {
counter.increment()
}
}Technical documentation:
Value of the innovation: the cognitive burden of async programming drops to zero, and code is exactly as readable as synchronous code while gaining the execution efficiency of high-performance parallelism.
3.5 Innovation Five: Value-Dependent Types (RFC-011)
Status: Under design; partially implemented
Types can depend on values, enabling truly type-driven development.
# Matrix type: dimensions are determined at compile time
Matrix: (T: Type, Rows: Int, Cols: Int) -> Type = {
data: Array(Array(T, Cols), Rows),
}
# Compile-time evaluation: factorial(3) = 6
arr: Array(Int, factorial(3)) = Array(Int, 6)()
# Compile-time dimension validation
identity_3x3: Matrix(Float, 3, 3) = identity(Float, 3)(3)
# multiply(matrix_2x3, matrix_4x2) # Compile error: dimensions do not matchValue of the innovation: more errors are caught at compile time, enabling more precise type guarantees.
3.6 Innovation Six: Minimalist Keyword Design
YaoXiang defines only 17 core keywords, far fewer than mainstream languages:
use spawn ref
mut if else match
while for return break
continue as in unsafe
and or| Language | Number of Keywords |
|---|---|
| YaoXiang | 17 |
| Rust | 51+ |
| Python | 35 |
| TypeScript | 64+ |
| Go | 25 |
About
pub: According to RFC-029 Module Semantics, the language does not introduce any visibility mechanism—there is nopub, noprivate, and noexport. RFC-029g removed this keyword entirely:pubis now an ordinary identifier (the old formpub x = 1reports E1001), and the keyword list has changed from 18 to 17.
Value of the innovation: a lower memory burden, a more consistent syntactic style, and a more readily parseable syntactic structure.
IV. Preliminary Syntax Preview
The following code examples show the character of the YaoXiang language and help you quickly appreciate its design aesthetic.
4.1 Hello World
# hello.yx
main: () -> Void = {
print("Hello, YaoXiang!")
}4.2 Type Definitions and Functions
# Unified type syntax: name: type = value
# Record type
Point: Type = { x: Float, y: Float }
# Generic type
Option: (T: Type) -> Type = {
some: (T) -> Self,
none: () -> Self,
}
# Interface type (a record whose fields are all functions)
Serializable: Type = {
serialize: () -> String,
}
# Function definition
add: (a: Int, b: Int) -> Int = a + b
# Generic function
identity: (T: Type) -> ((x: T) -> T) = x
# Multiline function
fact: (n: Int) -> Int = {
if n == 0 { return 1 }
return n * fact(n - 1)
}4.3 Pattern Matching
# Pattern matching
classify: (n: Int) -> String = {
return match n {
0 -> "zero",
1 -> "one",
_ if n < 0 -> "negative",
_ -> "positive",
}
}
# Destructuring pattern
Point: Type = { x: Float, y: Float }
match point {
Point(0.0, 0.0) -> "origin",
Point(x, y) -> "point at (${x}, ${y})",
}4.4 Ownership Model (RFC-009 v9)
Point: Type = { x: Float, y: Float }
# Default Move (zero-copy)
p1 = Point(1.0, 2.0)
p2 = p1 # Move; p1 can no longer be read
# &T / &mut T tokens (zero overhead at compile time)
p2.print() # The compiler automatically creates an &Point token
p2.shift(1.0, 1.0) # The compiler automatically creates an &mut Point token
# ref: shared ownership (the compiler automatically chooses Rc/Arc)
shared = ref p2 # Shared across scopes
# clone(): explicit deep copy
backup = p2.clone()
# unsafe + raw pointers: system-level
unsafe {
ptr: *Point = &p2
(*ptr).x = 0.0
}Ownership spectrum:
&T / &mut T Move ref clone() unsafe
| | | | |
借用令牌默认共享持有深拷贝裸指针
零成本零拷贝自动Rc/Arc 显式系统级4.5 Error Handling
# Result type
Result: (T: Type, E: Type) -> Type = {
ok: (T) -> Self,
err: (E) -> Self,
}
divide: (a: Float, b: Float) -> Result(Float, String) = {
if b == 0.0 {
return Result.err("Division by zero")
}
return Result.ok(a / b)
}
# Handling with match
result = divide(10.0, 2.0)
match result {
Result.ok(value) -> print(value),
Result.err(msg) -> print("Error: ${msg}"),
}4.6 Concurrent Programming (The Spawn Model)
# A function marked with spawn is asynchronous
fetch_api: (url: String) -> JSON spawn = {
response = HTTP.get(url)
return JSON.parse(response.body)
}
# Concurrent construction block: explicit parallelism
process_all: () -> (JSON, JSON, JSON) spawn = {
(a, b, c) = spawn {
fetch_api("https://api1.com/data"),
fetch_api("https://api2.com/data"),
fetch_api("https://api3.com/data")
}
return (a, b, c)
}V. Roadmap and Open Items
5.1 Design Decisions Already Made
The following decisions have been thoroughly discussed and reviewed and are no longer open to changes:
| Module | Decision | Explanation |
|---|---|---|
| Type System | Everything is a type | Values, functions, modules, and generics are all types |
| Type Syntax | Unified name: type = value | One declaration form covers every case; Type is the only meta type keyword |
| Keywords | 18 core keywords | Excludes type/fn/struct/enum/trait/impl |
| Function Syntax | Signature + expression | name: (params) -> ReturnType = body |
| Method Binding | RFC-004 curried binding | Type.method = function[position] |
| Async Model | Spawn model | spawn explicitly marks parallel points; ordinary code executes sequentially, and DAG analysis is limited to spawn expressions (RFC-024) |
| Memory Management | Ownership model (RFC-009 v9) | Move + &T/&mut T tokens + ref + clone + unsafe, with no GC |
| File as Module | Module system | Every .yx file is a module |
| Main Function | main: () -> Void | Program entry point |
| Thread Safety | ref automatically selects Rc/Arc | Escape analysis in the compiler, with no user-facing burden |
5.3 Implementation Roadmap
┌─────────────────────────────────────────────────────────────────────────────┐
│ YaoXiang 实现路线图(示例) │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ v0.1: Rust 解释器 ────────→ v0.5: Rust 编译器 ────────→ v1.0: Rust AOT │
│ ✅ 已完成 │ (当前阶段) 编译器 │
│ │ │
│ ▼ │
│ v0.6: YaoXiang 解释器 ←─────── v1.0: YaoXiang JIT 编译器 ←──── v2.0: │
│ (自举) (自举) YaoXiang AOT │
│ │
└─────────────────────────────────────────────────────────────────────────────┘VI. How to Contribute
YaoXiang is a language born in the community, grown by the community, and serving the community. We warmly invite every developer who loves programming language design to join this exploration.
6.1 Design Discussions
Best suited for: programming language theory researchers, type system enthusiasts, and language design enthusiasts
Ways to participate:
- GitHub Discussions: participate in discussions in the “Language Design” category
- Design proposals (RFCs): submit design documents for new features, following the templates in the
rfcs/directory - Syntax reviews: suggest improvements to existing syntax designs or identify potential problems
| Current hot topics: | | | | - Macro system design and implementation | | - Interface type mechanism | | - Error-handling syntax optimization | | - Standard library API design |
Submitting a design proposal:
- Create a new file in the
rfcs/directory - Complete the RFC template (motivation, detailed design, pros and cons analysis, alternatives)
- Open a Pull Request for community review
- Merge or reject the proposal after review by the core team
6.2 Compiler Implementation
Best suited for: compiler developers, systems programmers, and performance optimization experts
Current implementation priorities (in priority order):
| Priority | Module | Description | Difficulty |
|---|---|---|---|
| P0 | Bytecode Virtual Machine | Improve VM instructions and optimize performance | Medium |
| P0 | Runtime Memory | GC implementation and memory allocator | High |
| P0 | Async Runtime | Complete implementation of the spawn model | High |
| P1 | Standard Library | IO, String, List, Concurrent | Medium |
| P1 | JIT Compiler | Cranelift integration | High |
| P2 | AOT Compiler | LLVM/ Cranelift backend | High |
| P3 | Self-Hosting Compiler | Rewrite in YaoXiang | Extremely high |
Technology stack:
- Implementation language: Rust (current phase)
- Code generation: Cranelift or LLVM
- Build tool: Cargo
- Test framework: Rust
#[test]+cargo nextest
How to start contributing:
- Review
docs/YaoXiang-implementation-plan.mdto understand the architecture - Choose a module of interest under the
src/directory - Review
tests/unit/to understand the testing requirements - Ensure that
cargo fmtandcargo clippypass before submitting code
6.3 Toolchain Development
Best suited for: IDE plugin developers, toolchain enthusiasts, and productivity tool enthusiasts
Tools that need to be developed:
| Tool | Status | Description |
|---|---|---|
| LSP Server | ⏳ Not started | Language Server Protocol support |
| Debugger Integration | ⏳ Not started | GDB/LLDB integration |
| Formatter | ⏳ Not started | yx format |
| Package Manager | ⏳ Not started | Dependency management and version resolution |
| Package Registry | ⏳ Not started | Central or decentralized registry |
| REPL | ⏳ Not started | Interactive interpreter |
| Benchmarking Tools | ⏳ Not started | Performance analysis |
| VS Code Extension | ⏳ Not started | Syntax highlighting, completion, and debugging |
| Vim/Neovim Extension | ⏳ Not started | Syntax highlighting and LSP client |
Project structure reference:
yaoxiang/
├── src/
│ ├── tools/ # Toolchain
│ │ ├── lsp/ # LSP server
│ │ ├── fmt/ # Formatter
│ │ ├── repl/ # REPL
│ │ └── benchmark/ # Benchmarks
│ └── ...
├── extensions/ # Editor extensions
│ ├── vscode/ # VS Code
│ └── vim/ # Vim/Neovim6.4 Standard Library Development
Best suited for: library developers, API designers, and domain experts
Standard library module plan:
| Module | Priority | Description |
|---|---|---|
std.io | P0 | File IO and console input/output |
std.string | P0 | String operations and formatting |
std.list | P0 | List and array operations |
std.dict | P0 | Dictionaries and hash tables |
std.math | P0 | Mathematical functions and constants |
std.time | P1 | Date and time operations |
std.net | P1 | Network programming and HTTP |
std.concurrent | P1 | Concurrency primitives and channels |
std.crypto | P2 | Cryptographic hashing and signatures |
std.json | P1 | JSON parsing and generation |
std.regex | P2 | Regular expressions |
std.database | P3 | Database connections |
std.gui | P3 | Graphical user interface (long-term) |
Design principles:
- Consistency: functions with the same purpose should have consistent names and behavior
- Simplicity: APIs should be intuitive and easy to use, avoiding overengineering
- Performance: standard library functions should be efficient, avoiding unnecessary copies
- Testability: every function should have corresponding unit tests
6.5 Documentation and Tutorials
Best suited for: technical writers, educators, and community managers
Documentation that needs contributions:
| Document | Status | Description |
|---|---|---|
| Quick Start | ✅ Complete | Five-minute onboarding guide |
| Language Guide | ✅ Complete | Systematic introduction to core concepts |
| Language Specification | ✅ Complete | Complete syntax and semantic definitions |
| Implementation Plan | ✅ Complete | Technical details of compiler implementation |
| API Documentation | ⏳ Not started | Standard library API reference |
| Tutorials | ⏳ Not started | Advanced tutorials and best practices |
| Blog | ⏳ Not started | Technical articles and design stories |
| Translations | ⏳ Not started | Multilingual support |
6.6 Community Development
Best suited for: community managers, event organizers, and evangelists
Community activities:
- Regular online Meetups (once a month)
- Design and implementation discussions (once a week)
- Code contribution Sprints (once a quarter)
- Offline meetups and conference talks
Communication channels:
- GitHub Discussions: technical discussions
- GitHub Issues: bug reports and feature requests
- Discord/Slack: real-time communication
- Twitter/X: project updates
- Blog: in-depth articles
6.7 Contribution Guide
How to start contributing:
- Understand the project: read the README and design documentation
- Choose a direction: select a contribution area based on your interests
- Set up your environment: Rust 1.75+, cargo, and git
- Find a task: look for issues with the
good first issuelabel on GitHub Issues - Submit a PR: follow the contribution guidelines and write tests
- Participate in reviews: review other people’s code and join discussions
Commit conventions:
# Commit message format
<type>(<scope>): <subject>
# Types
feat: 新功能
fix: Bug 修复
docs: 文档更新
style: 代码格式(不影响功能)
refactor: 重构
perf: 性能优化
test: 测试
chore: 构建工具或辅助工具
# Example
feat(typecheck): add generic type inference
fix(parser): fix infinite loop on invalid input
docs(readme): update installation instructionsCode style:
- Follow the conventions in
rustfmt.toml - Ensure that
cargo clippyproduces no warnings - Write the necessary unit tests
- Update the relevant documentation
Appendix A: Language Quick Reference
A.1 Keywords
| Keyword | Purpose |
|---|---|
pub | Removed (RFC-029g)—no longer a keyword; reverted to an ordinary identifier |
use | Import modules |
spawn | Spawn marker |
ref | Shared ownership (the compiler automatically selects Rc/Arc) |
mut | Mutable variable |
if/else if/else | Conditional branching |
match | Pattern matching |
while/for | Loops |
return/break/continue | Control flow |
as | Type cast |
in | Membership test/list comprehension |
unsafe | unsafe code blocks (raw pointers) |
and | Logical AND |
or | Logical OR |
Note: Words such as
Type,true,false, andvoidare reserved words, not keywords. Thetypekeyword was removed in RFC-010, and the unifiedname: Type = valuesyntax is used instead.
A.3 Primitive Types
| Type | Description | Default Size |
|---|---|---|
Void | void | 0 bytes |
Bool | Boolean value | 1 byte |
Int | Signed integer | 8 bytes |
Uint | Unsigned integer | 8 bytes |
Float | Floating-point number | 8 bytes |
String | UTF-8 string | Variable |
Char | Unicode character | 4 bytes |
Bytes | Raw bytes | Variable |
A.4 Operator Precedence
| Precedence | Operator | Associativity |
|---|---|---|
| 1 | () [] . ? | Left to right |
| 2 | as | Left to right |
| 3 | Unary prefix ! - + | Right to left |
| 4 | * / % | Left to right |
| 5 | + - | Left to right |
| 6 | .. | Left to right |
| 7 | << >> | Left to right |
| 8 | & | ^ | Left to right |
| 9 | == != < > <= >= | Left to right |
| 10 | and or | Left to right |
| 11 | if...else | Right to left |
| 12 | = += -= *= /= | Right to left |
Unary prefix operators (
!-+) bind tightly, above all binary operators (Zig-style; see SPEC §2.2).
Appendix B: Design Inspirations
YaoXiang draws inspiration from the excellent ideas of the following languages and projects:
| Source | Inspiration |
|---|---|
| Rust | Ownership model, zero-cost abstractions, and type system |
| Python | Syntactic style, readability, and list comprehensions |
| Idris/Agda | Dependent types and type-driven development |
| Curry-Howard Isomorphism | Unifying theory of types as propositions, programs as proofs, and type systems with logic |
| TypeScript | Type annotations and runtime types |
| MoonBit | AI-friendly design and concise syntax |
| Haskell | Purely functional programming and pattern matching |
| OCaml | Type inference and variant types |
Appendix C: Frequently Asked Questions
Q: What advantages does YaoXiang have over Rust?
A: YaoXiang retains Rust’s memory safety and zero-cost abstractions while adopting simpler syntax and a lower cognitive load. The spawn model is more concise than Rust’s async/await—only one spawn marker is required, with no manual management of Future and Pin. “All things move together; I observe their return,” making concurrent programming as intuitive as describing natural laws. The ownership model (RFC-009 v9) replaces lifetime annotations with Move + &T/&mut T tokens and uses type attributes (Dup/Linear) in place of the borrow checker. Unified type syntax eliminates the conceptual fragmentation of enum/struct/trait/impl.
Q: What kinds of development is YaoXiang suited to?
A: Systems programming, application development, web services, scripting tools, and AI-assisted programming. The goal is to become a general-purpose programming language.
Q: Why choose four-space indentation?
A: Four spaces provide clear visual separation between code blocks and reduce confusion caused by nesting depth. It is a carefully considered “AI-friendly” design decision.
Q: When will version 1.0 be released?
A: The v1.0 goal is production readiness. The release date depends on implementation progress; the current version number is determined by Cargo.toml in the repository root.
Q: How can I contact the core team?
A: Through GitHub Discussions or the Discord community channel. Core team members reply regularly.
Last updated: 2026-10-02
Document version: v2.0.0
License: MIT
“As YaoXiang changes, all things arise. As types evolve, programs take shape.”
We hope you will join us on YaoXiang’s design journey.
