Reference / Comparison with C / Rust
Comparison with C / Rust
Syntax Comparison Table
| Variables | let x = 1; | int x = 1; | let mut x = 1; |
| Functions | fn f(a: i64) -> i64 | long f(long a) | fn f(a: i64) -> i64 |
| Structs | struct S { x: i64 } | struct S { long x; } | struct S { x: i64 } |
| Enums with data | enum E { A(i64), B } | needs manual tag + union | enum E { A(i64), B } |
| Matching | match v { ... } | switch (integers only) | match v { ... } |
| Strings | str (NUL-terminated) | char* | String / &str |
| Generics | fn f<T>(x: T) | macros / void* | fn f<T>(x: T) |
| Borrowing | &x / &mut x | pointers | &x / &mut x |
| Error handling | Option / Result + match | errno / return values | Result |
Positioning Differences
| Memory safety | ownership + borrow checking | manual | ownership + borrow checking |
| Ease of learning | C-like, type inference, second-level compilation | everything must be managed manually | steep learning curve |
| Memory model | ownership + Arena, two systems | manual malloc/free | ownership |
| Python interop | one-line --pyext export | hand-written extensions | pyo3 |
| Build artifacts | standalone small EXE / .pyd / .so | exe / .so | exe / .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.