Skip to content
PT

Static copy

Copied from docs/en/getting-started/what-is-aipo.md in https://github.com/poppy-team/aipo-lang (MIT). Pinned to revision ce47c4e070404fc41722ccd8e2b7b808b99062a8, blob a15d50813bc975e59a52ccf72ce28c23706e5983. The source repository remains canonical; this copy is refreshed through a sync pull request, not live.

What is Aipo? ​

Aipo is a modern general-purpose programming language featuring dynamic and strong typing, paired with native signature contracts and structural invariants.

Engineered with a philosophy of clarity, robustness, and predictability, Aipo was built from the ground up in Rust using Clean Architecture boundaries.


Core Pillars ​

1. Dynamic and Strong Typing ​

In Aipo, values have concrete types and the runtime never performs arbitrary or hidden conversions between incompatible types:

aipo
let x = "42"
let y = 10

# Runtime type fault:
# Operator '+' does not concatenate String and Int implicitly
let z = x + y # Explicit failure!

Converting or concatenating values requires clear programmer intent.

2. Structural Invariants, Contracts, and Enums ​

While traditional languages require scattering manual assertions across every method, Aipo introduces the invariant hook bound directly to the type:

aipo
struct Temperature {
    var celsius: Float = 0.0
}

Temperature:invariant {
    self.celsius >= -273.15 # Cannot be below absolute zero
}

Aipo also provides closed sum type enums with compiler-enforced exhaustiveness checks in match:

aipo
enum RunMode {
    Manual,
    Automated { interval_ms: Int },
}

Any mutation that violates an invariant is intercepted at the boundary. Inside attempt { ... } failed err { ... } transaction blocks, modifications undergo atomic rollback to their previous state.

3. Deterministic Concurrency ​

Aipo's concurrency model is founded on cooperative fibers and virtual time. Async calls utilize async fn and high-level combinators (task.spawn, task.sleep, task.all, task.race), orchestrated by a deterministic scheduler that enables 100% reproducible tests.

4. Dual Target: Native VM and JavaScript ​

The Aipo compiler targets two first-class runtimes:

  1. Rust Bytecode VM: Fast execution, deterministic .aibc binary serialization, and instruction disassembly with mapped line/column metadata.
  2. JavaScript Backend (aipo-js): Direct transpilation to modern ES2022 with a modular runtime shim, guaranteeing bit-for-bit differential parity.

Quick Comparison ​

FeatureAipoPythonLuaJavaScript
TypingDynamic & StrongDynamic & StrongDynamic & WeakDynamic & Weak
Native InvariantsYes (invariant())No (manual)NoNo
Transactional RollbackYes (attempt)NoNoNo
Native AsyncYes (Deterministic)Yes (asyncio)CoroutinesYes (Event Loop)
Package PanningCommit SHA + OfflinePip / VirtualenvExternal (Luarocks)NPM / Node Modules
ImplementationRust (Compiler + VM)C / C++ANSI CC++ (V8) / Rust (Deno)