Reference / Comparison with C / Rust

Comparison with C / Rust

Syntax Comparison Table

Variableslet x = 1;int x = 1;let mut x = 1;
Functionsfn f(a: i64) -> i64long f(long a)fn f(a: i64) -> i64
Structsstruct S { x: i64 }struct S { long x; }struct S { x: i64 }
Enums with dataenum E { A(i64), B }needs manual tag + unionenum E { A(i64), B }
Matchingmatch v { ... }switch (integers only)match v { ... }
Stringsstr (NUL-terminated)char*String / &str
Genericsfn f<T>(x: T)macros / void*fn f<T>(x: T)
Borrowing&x / &mut xpointers&x / &mut x
Error handlingOption / Result + matcherrno / return valuesResult

Positioning Differences

Memory safetyownership + borrow checkingmanualownership + borrow checking
Ease of learningC-like, type inference, second-level compilationeverything must be managed manuallysteep learning curve
Memory modelownership + Arena, two systemsmanual malloc/freeownership
Python interopone-line --pyext exporthand-written extensionspyo3
Build artifactsstandalone small EXE / .pyd / .soexe / .soexe / .so

In One Sentence

Aero takes Rust's memory-safety philosophy (ownership + borrow checking) and C's ease of learning (C-like syntax, no complex trait system), then adds a shortcut neither C nor Rust has: one line to export a Python module.

Aero 文档 · 基于 Aero 1.2.0 文档整理 · MIT
SereinTeam