Skip to content

Port the remaining Python app orchestration layer to Rust #72

Closed

Description

@zackees

Part of #14
Follow-up to #63 and PR #71.

Summary

The recent Rust migration moved the main CLI/runtime flows into fastled-cli and fastled._native, but a noticeable slice of the app layer is still Python-owned or Python-first. We should finish that cut-over so the default user-facing app flow is native Rust, with Python reduced to a thin compatibility/API layer.

This issue is about the remaining app/orchestration path, not the archive/downloader work already tracked in #63.

Current state

Today:

  • src/fastled/app.py and src/fastled/cli.py are compatibility shims that forward to the Rust CLI.
  • src/fastled/build_service.py, src/fastled/project_init.py, src/fastled/sketch.py, and src/fastled/string_diff.py have native fast paths, but still carry Python fallback logic and Python-owned interfaces.
  • Several app-facing modules are still Python implementations or Python-first orchestration:
    • src/fastled/args.py
    • src/fastled/parse_args.py
    • src/fastled/compile_native.py
    • src/fastled/build_types.py
    • src/fastled/open_browser.py
    • src/fastled/select_sketch_directory.py
    • src/fastled/frontend_esbuild.py

That leaves the runtime architecture mixed: Rust is authoritative for the CLI, but Python still owns meaningful pieces of app behavior and fallback control flow.

Goal

Make Rust the authoritative implementation for the app flow and reduce Python to:

  • the public package/API surface
  • minimal PyO3 bindings / compatibility shims
  • the truly hard-to-port pieces we intentionally keep in Python

Scope

In scope

  • Port or eliminate the remaining Python orchestration modules used by the app flow.
  • Move interactive sketch selection / compile target resolution into Rust.
  • Move any remaining app-side build/request/result typing to Rust/PyO3-owned types.
  • Remove Python fallbacks where the Rust native path is now expected to exist.
  • Tighten the Python package so it calls native Rust APIs directly instead of re-implementing app behavior.

Out of scope

Suggested tasks

  • Audit the current app/runtime call graph and mark each remaining Python module as either port, keep, or delete.
  • Port select_sketch_directory.py behavior into fastled-cli / fastled._native.
  • Port or remove args.py + parse_args.py from any remaining runtime path.
  • Port build_types.py fully so Python stops owning build request/result structs.
  • Move compile_native.py orchestration into Rust, or reduce it to a trivial wrapper around native bindings.
  • Port/remove the remaining app-side browser/build-launch orchestration in open_browser.py and frontend_esbuild.py where still relevant.
  • Remove Python fallback branches from build_service.py, project_init.py, sketch.py, and string_diff.py once native support is mandatory.
  • Update tests to assert the Rust/native path is primary and Python is compatibility-only.
  • Remove dead Python modules left behind by the cut-over.

Acceptance criteria

  • fastled app/compile/watch flows are driven by Rust-native code paths by default.
  • The Python package no longer owns core app orchestration logic.
  • Remaining Python modules are either compatibility wrappers or explicitly documented holdouts.
  • rg "python -m fastled.app|parse_args\(|BuildService\(" src/fastled no longer shows Python as the primary runtime owner for the app flow.
  • Unit/integration tests pass with the native path as the default.

Notes

A good end state is that src/fastled/app.py / cli.py remain tiny compatibility shims, while the substantive app behavior lives in crates/fastled-cli and crates/fastled-py.

Migration directive

During the Python compatibility-shim phase, keep the Rust CLI binary installed as fastled-rs[.exe] so a Python fastled entry point cannot recursively resolve itself. When the app flow is fully migrated to Rust, promote fastled-rs[.exe] back to fastled[.exe] and make fastled a bundled binary entry point instead of a Python console-script shim so launch is direct and faster.

Activity

  1. added a commit that references this issue on May 13, 2026
    9e35dfb
  2. zackees commented on May 13, 2026

    @zackees
    MemberAuthor

    Don't close this python layer is just a thin api shim to rust code.

  3. added a commit that references this issue on May 14, 2026
    1bbf488
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions