Skip to content

YaoXiang Design Manifesto ​

Version: v2.0.0 Status: Official Release Authors: Chenxu + YaoXiang Community Date: 2026-05-31


"The Dao gives birth to One, One gives birth to Two, Two gives birth to Three, Three gives birth to the myriad things." — Tao Te Ching

Types are like the Dao, from which all things are born.


1. Why Create YaoXiang? ​

1.1 Filling a Language Gap ​

Throughout the long history of programming languages, we have witnessed the birth and evolution of countless excellent languages: C brought the efficiency revolution in system programming, Python created a programming experience accessible to everyone, Rust proved that memory safety and performance can coexist, and TypeScript made large frontend projects maintainable. However, when we examine today's language ecosystem, we still find an obvious gap—no single language can simultaneously satisfy the following three core needs:

NeedProblems with Existing Solutions
Type SafetyRust is overly strict with a steep learning curve; TypeScript uses optional types and cannot provide compile-time guarantees
Natural SyntaxRust's syntax is complex and obscure; Haskell's functional threshold is too high; traditional static languages are verbose and cumbersome
AI FriendlyExisting languages have ambiguous syntax, complex ASTs, and unpredictable hidden behaviors, limiting the accuracy of AI code generation and modification

The birth of YaoXiang is precisely to fill this gap. We believe: a programming language should be both powerful and approachable, both safe and efficient, both rigorous and elegant.

1.2 Real Problems Being Solved ​

Problem One: Fragmentation of Type Systems

Today's programming languages show severe fragmentation in their type systems. Static type languages pursue absolute correctness at compile time but often at the expense of development efficiency; dynamic type languages offer flexibility but expose difficult-to-maintain defects in large projects. YaoXiang proposes a unified abstract framework of "everything is a type," making types the main thread throughout language design rather than a post-hoc patch.

Problem Two: The Dilemma 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 fluctuations and memory overhead; manual memory management is efficient but as dangerous as walking a tightrope. YaoXiang adopts a Rust-style ownership model, eliminating data races and memory leaks at compile time while maintaining zero-cost abstractions and achieving high performance without a GC.

Problem Three: The Cognitive Burden of Asynchronous Programming

Modern applications cannot do without networking and concurrency, yet asynchronous programming has long been a programmer's nightmare. Nested callback functions, Promise chains, async/await syntax—each solution adds to the complexity of code. YaoXiang redesigns the asynchronous model: simply add a spawn marker after a function signature, and the compiler automatically handles all asynchronous details, making concurrent programming as natural as synchronous code.

Problem Four: The Bottleneck of AI-Assisted Programming

When AI began to assist developers in writing code, the choice of language design became crucial. Ambiguous syntax rules, implicit type conversions, and complex syntactic sugar—these characteristics that human programmers have grown accustomed to have become obstacles for AI to understand and generate. From the very beginning, YaoXiang has made "AI friendly" a core design goal: strict indentation rules, clear code block boundaries, and unambiguous syntactic structures allow AI to accurately understand, generate, and modify code.

1.3 The Philosophical Foundation of the Language ​

The name YaoXiang comes from "Yao" (爻) and "Xiang" (象) in the Book of Changes. "Yao" represents the fundamental symbols composing hexagrams, symbolizing the interplay of yin and yang, motion and stillness; "Xiang" represents the external manifestations of the essence of things, embodying the myriad phenomena of the universe.

This philosophical thought is reflected in every detail of the language's design:

  • Unity: Just as the simple symbols of yao lines compose complex hexagrams, YaoXiang uses a few core concepts (types, functions, constructors) to build a complete programming model
  • Hierarchy: Just as xiang has distinctions of pre-heaven and post-heaven, YaoXiang's type system has a clear hierarchical structure, from primitive types to generics, from values to meta types
  • Variability: Just as yin and yang flow and transform endlessly, YaoXiang supports dependent types, allowing types to evolve as values change
  • Recognizability: Just as hexagrams can be interpreted and all things can be symbolized, YaoXiang provides complete type reflection capabilities, with full runtime type information available
  • Provability: Just as hexagrams reveal the patterns of things, YaoXiang's type system follows the Curry-Howard isomorphism (types as propositions, programs as proofs); type checking is the verification of logical proofs

2. Core Philosophy and Principles ​

The following design tenets are the cornerstone of YaoXiang, non-negotiable and inviolable. Any feature proposal must be examined against these principles.

2.1 Principle One: Everything Is a Type ​

In YaoXiang's worldview, types are the highest-level abstraction units and the core concept running through the language.

Specific Manifestations:

  • Values are instances of types: 42 is an instance of type Int, "hello" is an instance of type String
  • Types themselves are types: Type is the only meta type keyword in the language; the type of Int is Type
  • Functions are type mappings: add: (a: Int, b: Int) -> Int describes a type mapping from Int × Int to Int
  • Modules are type compositions: Modules are namespace compositions containing functions and types

Reason for Non-Negotiability: Unified type abstraction simplifies language semantics, eliminates the dualism between values and types, and allows the type system to become a guardian of code correctness rather than a stumbling block.

2.2 Principle Two: Strict Structuring ​

YaoXiang's syntax design pursues "unambiguous, predictable, and easy to parse."

Specific Rules:

  • Mandatory 4-space indentation: Tab characters are forbidden; code block boundaries are immediately visible
  • Brackets cannot be omitted: Function parameters must have parentheses, list elements must have commas
  • Code blocks must have curly braces: if, while, for and other control flows must be wrapped in { }
  • Streamlined keyword count: Only 17 core keywords are retained, rejecting the proliferation of syntactic sugar

Reason for Non-Negotiability: Strict structuring brings three key advantages—(1) IDE syntax highlighting and code folding become more accurate; (2) the accuracy of AI code generation and modification is greatly improved; (3) new learners can quickly understand code structure.

2.3 Principle Three: Zero-Cost Abstractions ​

High-level abstractions should not bring runtime performance overhead.

Specific Guarantees:

  • Monomorphization: Generic functions are expanded at compile time into specific versions, with no virtual table lookup overhead
  • Inline optimization: Simple functions are automatically inlined, eliminating function call overhead
  • Stack allocation priority: Small objects are allocated on the stack by default; heap allocation is used only when necessary
  • No GC: The ownership model guarantees memory safety without the runtime overhead of a garbage collector

Reason for Non-Negotiability: Performance is the lifeline of a programming language. Any design that trades performance for convenience is a betrayal of the programmer.

2.4 Principle Four: Immutable 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
  • Mutability must be explicitly declared with mut when needed
  • References are immutable by default; mutable references require the mut marker
  • The transfer of ownership means the original binding becomes invalid

Reason for Non-Negotiability: Immutability is the foundation of concurrent safety, the guarantee of code readability, and the crystallization of functional programming wisdom.

2.5 Principle Five: Types Are Data ​

Type information should not only exist at compile time but should be fully available at runtime.

Specific Capabilities:

  • Runtime type queries: any value can obtain its type information
  • Type reflection: types themselves can be constructed and manipulated
  • Pattern matching destructuring: type constructors can be used directly in pattern matching
  • Generic specialization: runtime can obtain the concrete types of generic parameters

Reason for Non-Negotiability: Complete type reflection capabilities are the foundation of metaprogramming and the cornerstone of high-performance frameworks and tools.


3. Key Innovations and Features ​

While absorbing the excellent features of existing languages, YaoXiang proposes the following innovative designs.

3.1 Innovation One: Unified Type Syntax ​

Traditional languages' type definitions 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 is name: type = value, and Type is the only meta type keyword.

yaoxiang
# === Record Types ===

Point: Type = {
    x: Float,
    y: Float,
}

# Fields with default values
Point3D: Type = {
    x: Float = 0,
    y: Float = 0,
    z: Float = 0,
}

# === Generic Types ===

Option: (T: Type) -> Type = {
    some: (T) -> Self,
    none: () -> Self,
}

Result: (T: Type, E: Type) -> Type = {
    ok: (T) -> Self,
    err: (E) -> Self,
}

# === Interfaces (records whose fields are all function types) ===

Drawable: Type = {
    draw: (Surface) -> Void,
    bounding_box: () -> Rect,
}

Serializable: Type = {
    serialize: () -> String,
}

# === Interface implementation (interface names are written within 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)
}

Innovation Value: No fragmentation of fn, struct, enum, trait, impl keywords—one unified syntax covers all declarations.

3.2 Innovation Two: Constructors Are Types ​

Value construction is completely identical to function calls:

yaoxiang
# Type definitions
Point: Type = { x: Float, y: Float }
Option: (T: Type) -> Type = {
    some: (T) -> Self,
    none: () -> Self,
}

# Value construction: same as function calls
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 implement syntax sugar similar to object 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] indicates binding to the 0th parameter position)
Point.distance = distance[0]

# === Usage ===

p1 = Point(3.0, 4.0)
p2 = Point(1.0, 2.0)

# The two calling methods are completely 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, waiting for the second parameter
d3 = dist_from_p1(p2)       # 2.828

Innovation Value: Purely functional design, no hidden self parameter, functions are values that can be freely passed and composed.

3.4 Innovation Four: The Spawn Model ​

"The myriad things arise together; I observe their return." — Yi·Hexagram of Return (Fu)

The spawn model takes its meaning from this, describing a programming paradigm: developers describe logic with synchronous, sequential thinking, while the language runtime automatically and efficiently executes the computational units therein concurrently like the myriad things arising, and ultimately unifies and coordinates them.

Three Core Principles:

PrincipleDescription
Synchronous SyntaxSequential code where what you see is what you get
Concurrent EssenceThe runtime automatically extracts parallelism
Unified CoordinationResults automatically converge when needed, guaranteeing 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 concurrent region, with tasks inside the block executing concurrently
spawn loopspawn for x in xs { ... }Data parallelism, with the loop body executing concurrently over all elements
spawn valueAsync(T)A future value currently being spawned, automatically awaited when used
spawn graphLazy computation graph (DAG)The stage where spawning occurs, describing dependencies and parallelism
spawn schedulerRuntime task schedulerThe intelligent coordinator that harmonizes the myriad things, causing them to spawn at the right moment

See details: RFC-001 Spawn Model

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)
}

# === Automatic Awaiting ===
main: () -> Void = {
    # Two independent requests automatically execute in parallel
    users = fetch_data("https://api.example.com/users")
    posts = fetch_data("https://api.example.com/posts")

    # Wait points are automatically inserted when results are needed
    print(users.length + posts.length)  # Automatically waits for users and posts
}

Thread Safety:

yaoxiang
# The ref keyword automatically handles thread safety (compiler automatically chooses Rc/Arc)
main: () -> Void = {
    counter = ref SafeCounter(0)

    # Cross-task sharing: compiler automatically chooses Arc
    spawn {
        counter.increment()
    }
    spawn {
        counter.increment()
    }
}

Technical Documentation:

Innovation Value: The cognitive burden of asynchronous programming is reduced to zero, code readability is identical to synchronous code, and high-performance parallel execution efficiency is obtained.

3.5 Innovation Five: Value-Dependent Types (RFC-011) ​

Status: In design, partially implemented

Types can depend on values, enabling true type-driven development.

yaoxiang
# Matrix type: dimensions determined at compile time
Matrix: (T: Type, Rows: Int, Cols: Int) -> Type = {
    data: Array(Array(T, Cols), Rows),
}

# Compile-time computation: factorial(3) = 6
arr: Array(Int, factorial(3)) = Array(Int, 6)()

# Compile-time dimension verification
identity_3x3: Matrix(Float, 3, 3) = identity(Float, 3)(3)
# multiply(matrix_2x3, matrix_4x2)  # Compile error: dimensions mismatch

Innovation Value: Catches more errors 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:

pub    use    spawn
ref    mut    if     else
else   match  while  for    return
break  continue as     in     unsafe
Compared LanguageNumber of Keywords
YaoXiang17
Rust51+
Python35
TypeScript64+
Go25

Innovation Value: Lower memory burden, more consistent syntactic style, and easier-to-parse grammatical structure.


4. Initial Syntax Preview ​

The following code examples showcase the style of the YaoXiang language and help you quickly experience its design aesthetics.

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 (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

# Multi-line 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 patterns
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 compile-time cost)
p2.print()           # Compiler automatically creates a &Point token
p2.shift(1.0, 1.0)  # Compiler automatically creates a &mut Point token

# ref: shared ownership (compiler automatically chooses Rc/Arc)
shared = ref p2      # Share across scopes

# clone(): explicit deep copy
backup = p2.clone()

# unsafe + raw pointers: system-level
unsafe {
    ptr: *Point = &p2
    (*ptr).x = 0.0
}

Ownership Gradient:

&T / &mut T    Move       ref        clone()    unsafe
    |             |          |           |          |
Borrow token  Default  Shared own.  Deep copy  Raw pointer
Zero cost    Zero-copy Auto Rc/Arc  Explicit  System-level

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)
}

# Using match for handling
result = divide(10.0, 2.0)
match result {
    Result.ok(value) -> print(value),
    Result.err(msg) -> print("Error: ${msg}"),
}

4.6 Concurrent Programming (Spawn Model) ​

yaoxiang
# spawn marks an asynchronous function
fetch_api: (url: String) -> JSON spawn = {
    response = HTTP.get(url)
    return JSON.parse(response.body)
}

# Concurrent construct 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)
}

5. Roadmap and Pending Items ​

5.1 Decided Design Decisions ​

The following decisions have been thoroughly discussed and reviewed, and are no longer subject to change:

ModuleDecisionDescription
Type SystemEverything is a typeValues, functions, modules, and generics are all types
Type SyntaxUnified name: type = valueOne declaration form covers all cases; Type is the only meta type keyword
Keywords17 core keywordsDoes not include type/fn/struct/enum/trait/impl
Function SyntaxSignature + expressionname: (params) -> ReturnType = body
Method BindingRFC-004 Curried bindingType.method = function[position]
Asynchronous ModelSpawn modelspawn marker, lazy evaluation, automatic parallelism
Memory ManagementOwnership model (RFC-009 v9)Move + &T/&mut T tokens + ref + clone + unsafe, no GC
File as ModuleModule systemEach .yx file is a module
Main Functionmain: () -> VoidProgram entry point
Thread Safetyref automatically selects Rc/ArcCompiler escape analysis, transparent to users

5.3 Implementation Roadmap ​

┌─────────────────────────────────────────────────────────────────────────────┐
│                              YaoXiang Implementation Roadmap (Example)            │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  v0.1: Rust Interpreter ────────→ v0.5: Rust Compiler ────────→ v1.0: Rust AOT│
│        ✅ Completed                    │ (Current Phase)         Compiler    │
│                                      │                                      │
│                                      ▼                                      │
│  v0.6: YaoXiang Interpreter ←─────── v1.0: YaoXiang JIT Compiler ←──── v2.0:│
│        (Self-hosting)                  (Self-hosting)              YaoXiang AOT│
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

6. How to Participate in Contributing ​

YaoXiang is a language born of the community, growing in the community, and serving the community. We sincerely invite every developer who loves programming language design to join this exploration journey.

6.1 Design Discussions ​

Suitable for: Programming language theory researchers, type system enthusiasts, language design fanatics

How to Participate:

  • GitHub Discussions: Participate in discussions under the "Language Design" category
  • Design Proposals (RFC): Propose design documents for new features, following the template in the rfcs/ directory
  • Syntax Review: Suggest improvements to existing syntax designs or identify potential issues

| 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. Fill in the RFC template (motivation, detailed design, pros/cons analysis, alternatives)
  3. Initiate a Pull Request for community review
  4. Merge or reject after deliberation by the core team

6.2 Compiler Implementation ​

Suitable for: Compiler developers, system programmers, performance optimization experts

Current Implementation Priorities (sorted by priority):

PriorityModuleDescriptionDifficulty
P0Bytecode Virtual MachineVM instruction completion, performance optimizationMedium
P0Runtime MemoryGC implementation, memory allocatorHigh
P0Asynchronous RuntimeComplete implementation of the spawn modelHigh
P1Standard LibraryIO, String, List, ConcurrentMedium
P1JIT CompilerCranelift integrationHigh
P2AOT CompilerLLVM/Cranelift backendHigh
P3Self-Hosting CompilerRewrite in YaoXiangVery High

Technology Stack:

  • Implementation Language: Rust (current stage)
  • Code Generation: Cranelift or LLVM
  • Build Tool: Cargo
  • Test Framework: Rust #[test] + cargo nextest

Start Contributing:

  1. Check docs/YaoXiang-implementation-plan.md to understand the architecture design
  2. Choose an interesting module under the src/ directory
  3. Check tests/unit/ to understand testing requirements
  4. Ensure cargo fmt and cargo clippy pass before submitting code

6.3 Toolchain Development ​

Suitable for: IDE plugin developers, toolchain enthusiasts, efficiency tool seekers

Tools to Develop:

ToolStatusDescription
LSP Server⏳ To be startedLanguage Server Protocol support
Debugger Integration⏳ To be startedGDB/LLDB integration
Formatter⏳ To be startedyx format
Package Manager⏳ To be startedDependency management, version resolution
Package Registry⏳ To be startedCentralized or decentralized
REPL⏳ To be startedInteractive interpreter
Benchmarking Tool⏳ To be startedPerformance analysis
VS Code Plugin⏳ To be startedSyntax highlighting, completion, debugging
Vim/Neovim Plugin⏳ To be startedSyntax highlighting, LSP client

Project Structure Reference:

yaoxiang/
├── src/
│   ├── tools/                    # Toolchain
│   │   ├── lsp/                  # LSP server
│   │   ├── fmt/                  # Formatter
│   │   ├── repl/                 # REPL
│   │   └── benchmark/            # Benchmarking
│   └── ...
├── extensions/                   # Editor extensions
│   ├── vscode/                   # VS Code
│   └── vim/                      # Vim/Neovim

6.4 Standard Library Development ​

Suitable for: Library developers, API designers, domain experts

Standard Library Module Planning:

ModulePriorityDescription
std.ioP0File IO, console input/output
std.stringP0String operations, formatting
std.listP0List/array operations
std.dictP0Dictionary/hash table
std.mathP0Math functions, constants
std.timeP1Time and date operations
std.netP1Network programming, HTTP
std.concurrentP1Concurrency primitives, channels
std.cryptoP2Cryptographic hashes, signatures
std.jsonP1JSON parsing/generation
std.regexP2Regular expressions
std.databaseP3Database connections
std.guiP3Graphical interface (long-term)

Design Principles:

  • Consistency: Function names and behaviors with the same functionality should remain consistent
  • Simplicity: APIs should be intuitive and easy to use, avoiding over-engineering
  • Performance: Standard library functions should be efficient, avoiding unnecessary copies
  • Testability: Each function should have corresponding unit tests

6.5 Documentation and Tutorials ​

Suitable for: Technical writers, educators, community managers

Documentation to Contribute:

DocumentationStatusDescription
Quick Start✅ Completed5-minute getting started guide
Language Guide✅ CompletedSystematic study of core concepts
Language Specification✅ CompletedComplete syntax and semantic definition
Implementation Plan✅ CompletedCompiler implementation technical details
API Documentation⏳ To be startedStandard library API reference
Tutorials⏳ To be startedAdvanced tutorials and best practices
Blog⏳ To be startedTechnical articles and design stories
Translation⏳ To be startedMulti-language support

6.6 Community Building ​

Suitable for: Community managers, event organizers, evangelists

Community Activities:

  • Regular online meetups (monthly)
  • Design and implementation discussions (weekly)
  • Code contribution sprints (quarterly)
  • Offline gatherings 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 documents
  2. Choose a Direction: Select a contribution area based on your interests
  3. Set Up the Environment: Rust 1.75+, cargo, git
  4. Find a Task: Check GitHub Issues for the good first issue label
  5. Submit a PR: Follow commit conventions, write tests
  6. Participate in Review: Review others' code, participate in discussions

Commit Convention:

bash
# Commit message format
<type>(<scope>): <subject>

# Types
feat: new feature
fix: bug fix
docs: documentation update
style: code formatting (no functional impact)
refactor: refactoring
perf: performance optimization
test: testing
chore: build tools or auxiliary tools

# Examples
feat(typecheck): add generic type inference
fix(parser): fix infinite loop on invalid input
docs(readme): update installation instructions

Code Style:

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

Appendix A: Language Cheat Sheet ​

A.1 Keywords ​

KeywordPurpose
pubPublic export
useImport module
spawnSpawn marker
refShared ownership (compiler automatically selects Rc/Arc)
mutMutable variable
if/else if/elseConditional branches
matchPattern matching
while/forLoops
return/break/continueControl flow
asType conversion
inMembership test/list comprehension
unsafeunsafe code block (raw pointers)

Note: Type, true, false, void, etc. are reserved words, not keywords. The type keyword has been removed in RFC-010, unifying with the name: Type = value syntax.

A.3 Primitive Types ​

TypeDescriptionDefault Size
VoidEmpty value0 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, higher than all binary operators (Zig-style, see SPEC §2.2).


Appendix B: Design Inspirations ​

YaoXiang's design draws on the excellent ideas from the following languages and projects:

SourceInspiration
RustOwnership model, zero-cost abstractions, type system
PythonSyntax style, readability, list comprehension
Idris/AgdaDependent types, type-driven development
Curry-Howard IsomorphismTypes as propositions, programs as proofs, the unified theory of type systems and logic
TypeScriptType annotations, runtime types
MoonBitAI-friendly design, concise syntax
HaskellPure functional, pattern matching
OCamlType inference, 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, but adopts a simpler syntax and lower cognitive burden. The spawn model is more concise than Rust's async/await—just one spawn marker, with no need to manually manage Future and Pin. "The myriad things arise together; I observe their return," making concurrent programming as intuitive as describing natural laws. The ownership model (RFC-009 v9) uses Move + &T/&mut T tokens to replace lifetime annotations, and type attributes (Dup/Linear) to replace the borrow checker. The unified type syntax eliminates the conceptual fragmentation of enum/struct/trait/impl.

Q: What types of development is YaoXiang suitable for?

A: System programming, application development, web services, scripting tools, AI-assisted programming. The goal is to become a general-purpose programming language.

Q: Why choose 4-space indentation?

A: 4 spaces provide clear visual separation of code blocks, reducing the confusion brought by nesting depth. This is a well-considered "AI-friendly" design decision.

Q: When will version 1.0 be released?

A: v1.0 goal: production-ready. The release date depends on implementation progress; see the Version Planning RFC.

Q: How do I contact the core team?

A: Through GitHub Discussions or the Discord community channel. Core team members respond regularly.


Last Updated: 2026-05-31

Document Version: v2.0.0

License: MIT


"The Yaos and Xiangs transform, and the myriad things are born. Types evolve, and programs are made."

May the design journey of YaoXiang be accompanied by you.