Dudu

Write like Python, run like C++.

Use Python's familiar syntax with static types and native performance. Dudu compiles to readable C++ and works directly with existing C and C++ libraries.

Pre-alpha: 0.1.0-alpha.13 Releases

Built different

Familiar

Dudu uses Python's syntax and type inference while keeping static types, native data layouts, and predictable compiled behavior.

Native

Import C and C++ headers directly. Use existing libraries, CMake projects, debuggers, profilers, and platform APIs.

Readable output

Dudu compiles to ordinary C++20. Generated code is available for inspection and works with existing native tools.

Language

Python on top. C++ underneath.

Dudu keeps the source compact while preserving native types and ordinary control flow. The compiler emits readable C++20 and hands serious project builds to CMake.

  • Multi-file modules
  • Native generics and fixed arrays
  • Payload enums and exhaustive match
  • References, pointers, const, and explicit allocation

Read the language tour

src/main.dd
from c import raylib.h

class Player:
    hp: i32
    pos: Vec2

def main() -> i32:
    player = Player(hp=100, pos=Vec2(400.0, 300.0))
    InitWindow(800, 600, "dudu")

    while not WindowShouldClose():
        BeginDrawing()
        DrawCircle(player.pos.x, player.pos.y, 40.0, BROWN)
        EndDrawing()

    CloseWindow()
    return 0
A pixel-sharp raymarched sphere rendered by a Dudu SDL3 dogfood project

Projects

Used on real programs.

The compiler is exercised through real projects using SDL3, raylib, ImGui, glm, SQLite, the C and C++ standard libraries, and generated multi-module CMake builds.

View raymarch-dd source or browse dudu-webserver.

Pre-alpha means pre-alpha. Dudu is usable for experiments and dogfooding, but language and generated ABI compatibility can change. Read the known limitations before adopting it.