Early Alpha โ€ข Python & Rust backends

Write drone missions like code โ€” safe, portable, declarative.

FlightLang is a domain-specific language (DSL) for UAV missions based on finite state machines, with unit-checked variables, deadlines, and multiple codegen backends (Python for simulation, Rust for controllers).

Not for real flight yet โ€” see roadmap and safety notes in the docs.
// A simple survey mission in FlightLang
let cruise_alt: m = 60 m
let max_speed: mps = 12 mps

mission Survey {
  preflight requires GPS_LOCK && BATTERY > 30%
  geofence keepout polygon "worksite-a"

  state Idle {
    on arm -> Takeoff
  }

  state Takeoff {
    action climb_to(cruise_alt) @ max_speed
    on reached_altitude -> Transit
  }

  state Transit {
    action goto(waypoint_grid(spacing: 25 m, bearing: 90 deg))
    on obstacle_detected -> Avoid
    on grid_complete -> RTL
  }

  state Avoid {
    deadline 50 ms
    action sidestep(5 m) then resume
    on clear -> Transit
  }

  state RTL {
    action return_to_launch()
    on landed -> Done
  }

  state Done { }
}

Why FlightLang

Readable mission spec

State machines instead of ad-hoc scripts. Preflight checks, deadlines, transitions โ€” all explicit.

Units & types

Unit-aware numbers (m, mps, deg, ms) with simple checks.

Multi-backend

Generate Python for simulation or Rust for controllers. PX4/ROS 2 stubs included.

Open & extensible

Add new actions, events, and backends without changing mission specs.

Install (Python)

# from your project dir
python -m flightlang.cli run examples/survey.fl

# or generate runnable Python
python -m flightlang.cli build examples/survey.fl -o out.py
python out.py

Generate Rust

python -m flightlang.cli build examples/survey.fl --backend rust --outdir mission_rs
cd mission_rs && cargo run

How it works

1) Parse
Lexer & parser build an AST from your .fl.
2) Check
Simple unit/type checks catch mistakes early.
3) Generate
Emit Python or Rust with a tiny runtime or stubs.
4) Run
Simulate or compile; integrate with PX4/ROS 2 later.

Join the project

We welcome issues, discussions, and PRs. See the roadmap for where help is most needed.

Contribute on GitHub โ†’