Skip to content

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:

RequirementProblems with Existing Solutions
Type SafetyRust is overly strict and has a steep learning curve; TypeScript has optional types and cannot provide compile-time guarantees
Natural SyntaxRust’s syntax is complex and obscure; Haskell’s functional model has too high an entry barrier; traditional static languages are verbose and cumbersome
AI-FriendlyExisting 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: 42 is an instance of Int, and "hello" is an instance of String
  • A type is itself a type: Type is the language’s only meta type keyword; the type of Int is Type
  • A function is a type mapping: add: (a: Int, b: Int) -> Int describes a type mapping from Int × Int to Int
  • 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, and for must 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, mut must be explicitly declared
  • References are immutable by default; mutable references require a mut marker
  • 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
// 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.

yaoxiang
# === 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:

yaoxiang
# 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.

yaoxiang
# === 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.828

Value 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:

PrincipleDescription
Synchronous SyntaxWYSIWYG sequential code
Concurrent NatureThe runtime automatically extracts parallelism
Unified CoordinationResults converge automatically when needed, ensuring logical correctness

Terminology:

Official TermCorresponding SyntaxExplanation
Spawn Functionspawn (params) => bodyDefines a computational unit that can participate in spawn execution
Spawn Blockspawn { a(), b() }An explicitly declared concurrency domain; tasks within the block execute concurrently
Spawn Loopspawn for x in xs { ... }Data parallelism; the loop body executes concurrently over all elements
Spawn ValueNo standalone handle (RFC-024)No Async(T)/future handle; the caller synchronously blocks while waiting for the result
Spawn GraphIn-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 SchedulerRuntime task schedulerThe 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)

yaoxiang
# === 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:

yaoxiang
# 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.

yaoxiang
# 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 match

Value 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
LanguageNumber of Keywords
YaoXiang17
Rust51+
Python35
TypeScript64+
Go25

About pub: According to RFC-029 Module Semantics, the language does not introduce any visibility mechanism—there is no pub, no private, and no export. RFC-029g removed this keyword entirely: pub is now an ordinary identifier (the old form pub x = 1 reports 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 ​

yaoxiang
# hello.yx

main: () -> Void = {
    print("Hello, YaoXiang!")
}

4.2 Type Definitions and Functions ​

yaoxiang
# 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 ​

yaoxiang
# 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) ​

yaoxiang
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 ​

yaoxiang
# 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) ​

yaoxiang
# 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:

ModuleDecisionExplanation
Type SystemEverything is a typeValues, functions, modules, and generics are all types
Type SyntaxUnified name: type = valueOne declaration form covers every case; Type is the only meta type keyword
Keywords18 core keywordsExcludes type/fn/struct/enum/trait/impl
Function SyntaxSignature + expressionname: (params) -> ReturnType = body
Method BindingRFC-004 curried bindingType.method = function[position]
Async ModelSpawn modelspawn explicitly marks parallel points; ordinary code executes sequentially, and DAG analysis is limited to spawn expressions (RFC-024)
Memory ManagementOwnership model (RFC-009 v9)Move + &T/&mut T tokens + ref + clone + unsafe, with no GC
File as ModuleModule systemEvery .yx file is a module
Main Functionmain: () -> VoidProgram entry point
Thread Safetyref automatically selects Rc/ArcEscape 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:

  1. Create a new file in the rfcs/ directory
  2. Complete the RFC template (motivation, detailed design, pros and cons analysis, alternatives)
  3. Open a Pull Request for community review
  4. 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):

PriorityModuleDescriptionDifficulty
P0Bytecode Virtual MachineImprove VM instructions and optimize performanceMedium
P0Runtime MemoryGC implementation and memory allocatorHigh
P0Async RuntimeComplete implementation of the spawn modelHigh
P1Standard LibraryIO, String, List, ConcurrentMedium
P1JIT CompilerCranelift integrationHigh
P2AOT CompilerLLVM/ Cranelift backendHigh
P3Self-Hosting CompilerRewrite in YaoXiangExtremely 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:

  1. Review docs/YaoXiang-implementation-plan.md to understand the architecture
  2. Choose a module of interest under the src/ directory
  3. Review tests/unit/ to understand the testing requirements
  4. Ensure that cargo fmt and cargo clippy pass 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:

ToolStatusDescription
LSP Server⏳ Not startedLanguage Server Protocol support
Debugger Integration⏳ Not startedGDB/LLDB integration
Formatter⏳ Not startedyx format
Package Manager⏳ Not startedDependency management and version resolution
Package Registry⏳ Not startedCentral or decentralized registry
REPL⏳ Not startedInteractive interpreter
Benchmarking Tools⏳ Not startedPerformance analysis
VS Code Extension⏳ Not startedSyntax highlighting, completion, and debugging
Vim/Neovim Extension⏳ Not startedSyntax 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/Neovim

6.4 Standard Library Development ​

Best suited for: library developers, API designers, and domain experts

Standard library module plan:

ModulePriorityDescription
std.ioP0File IO and console input/output
std.stringP0String operations and formatting
std.listP0List and array operations
std.dictP0Dictionaries and hash tables
std.mathP0Mathematical functions and constants
std.timeP1Date and time operations
std.netP1Network programming and HTTP
std.concurrentP1Concurrency primitives and channels
std.cryptoP2Cryptographic hashing and signatures
std.jsonP1JSON parsing and generation
std.regexP2Regular expressions
std.databaseP3Database connections
std.guiP3Graphical 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:

DocumentStatusDescription
Quick Start✅ CompleteFive-minute onboarding guide
Language Guide✅ CompleteSystematic introduction to core concepts
Language Specification✅ CompleteComplete syntax and semantic definitions
Implementation Plan✅ CompleteTechnical details of compiler implementation
API Documentation⏳ Not startedStandard library API reference
Tutorials⏳ Not startedAdvanced tutorials and best practices
Blog⏳ Not startedTechnical articles and design stories
Translations⏳ Not startedMultilingual 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:

  1. Understand the project: read the README and design documentation
  2. Choose a direction: select a contribution area based on your interests
  3. Set up your environment: Rust 1.75+, cargo, and git
  4. Find a task: look for issues with the good first issue label on GitHub Issues
  5. Submit a PR: follow the contribution guidelines and write tests
  6. Participate in reviews: review other people’s code and join discussions

Commit conventions:

bash
# 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 instructions

Code style:

  • Follow the conventions in rustfmt.toml
  • Ensure that cargo clippy produces no warnings
  • Write the necessary unit tests
  • Update the relevant documentation

Appendix A: Language Quick Reference ​

A.1 Keywords ​

KeywordPurpose
pubRemoved (RFC-029g)—no longer a keyword; reverted to an ordinary identifier
useImport modules
spawnSpawn marker
refShared ownership (the compiler automatically selects Rc/Arc)
mutMutable variable
if/else if/elseConditional branching
matchPattern matching
while/forLoops
return/break/continueControl flow
asType cast
inMembership test/list comprehension
unsafeunsafe code blocks (raw pointers)
andLogical AND
orLogical OR

Note: Words such as Type, true, false, and void are reserved words, not keywords. The type keyword was removed in RFC-010, and the unified name: Type = value syntax is used instead.

A.3 Primitive Types ​

TypeDescriptionDefault Size
Voidvoid0 bytes
BoolBoolean value1 byte
IntSigned integer8 bytes
UintUnsigned integer8 bytes
FloatFloating-point number8 bytes
StringUTF-8 stringVariable
CharUnicode character4 bytes
BytesRaw bytesVariable

A.4 Operator Precedence ​

PrecedenceOperatorAssociativity
1() [] . ?Left to right
2asLeft to right
3Unary 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
10and orLeft to right
11if...elseRight 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:

SourceInspiration
RustOwnership model, zero-cost abstractions, and type system
PythonSyntactic style, readability, and list comprehensions
Idris/AgdaDependent types and type-driven development
Curry-Howard IsomorphismUnifying theory of types as propositions, programs as proofs, and type systems with logic
TypeScriptType annotations and runtime types
MoonBitAI-friendly design and concise syntax
HaskellPurely functional programming and pattern matching
OCamlType 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.