Skip to content

Rewrite in gleam#23

Open
nwjlyons wants to merge 1 commit intomainfrom
rewrite-in-gleam
Open

Rewrite in gleam#23
nwjlyons wants to merge 1 commit intomainfrom
rewrite-in-gleam

Conversation

@nwjlyons
Copy link
Copy Markdown
Owner

@nwjlyons nwjlyons commented Feb 8, 2026

Summary
This PR ports the game domain logic from Elixir to Gleam while preserving the existing Phoenix-facing APIs and behavior.

What Changed

  • Added Gleam project/tooling configuration:
  • Pinned gleam 1.14.0 in .tool-versions.
  • Added gleam.toml and generated manifest.toml.
  • Updated mix.exs to compile Gleam via mix_gleam archive, include Gleam Erlang output paths, and run gleam.deps.get as part of deps.get.
  • Added Gleam runtime deps in mix.exs/mix.lock: gleam_stdlib, gleam_otp, gleam_erlang.
  • Added /build/ to .gitignore for Gleam build artifacts.
  • Implemented core logic in Gleam modules under src/:
  • src/robot_race_game.gleam
  • src/robot_race_robot.gleam
  • src/robot_race_id.gleam
  • src/robot_race_game_id.gleam
  • src/robot_race_robot_id.gleam
  • src/robot_race_stats.gleam
  • Reworked Elixir modules into compatibility wrappers/delegators:
  • lib/robot_race/game.ex
  • lib/robot_race/robot.ex
  • lib/robot_race/id.ex
  • lib/robot_race/game_id.ex
  • lib/robot_race/robot_id.ex
  • lib/robot_race_web/stats_server.ex
  • Formatting-only changes:
  • config/config.exs
  • lib/robot_race_web/templates/error/error.html.heex

Behavior/Compatibility

  • Existing public Elixir APIs are preserved.
  • Phoenix/LiveView layer remains unchanged.
  • Game state logic now executes in Gleam, with Elixir <-> Gleam conversion at module boundaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant