Ordered roadmap M0–M12, with open design questions.
geometry:
Units: Pixels, ScaledPixels, DevicePixels, Rems.
Lengths: AbsoluteLength, DefiniteLength, Length, with parsing.
Types: Point, Size, Bounds, Edges, Corners, Anchor, Axis, ContentMask.
color:
Rgba and Hsla, with conversions, hex parsing and blending.
Background: solid, linear gradient, slash pattern, checkerboard.
scene:
Primitives: Quad, Shadow, PaintedPath, Underline, and monochrome, subpixel and polychrome sprites.
TransformationMatrix.
The BoundsTree draw-order R-tree.
Layers, finish (stable sort by order and texture), batches, and replay.
LICENSE (Apache-2.0) and NOTICE recording that the code is derived from GPUI.
Testing
moon check --target all and moon test --target all pass: 45 tests on each of wasm, wasm-gc, js and native. moon fmt and moon info are clean.
Some tests are ported from GPUI:
Pixels to int.
Bounds join and intersects.
Color hex parsing, alpha, opacity and background tests.
The bounds-tree insert test.
The randomized bounds-tree test, run over 200 seeds against a brute-force oracle.
Deviations
These are listed in PORTING.md §6:
Units are Double rather than f32.
PaintedPath stores polygon contours, not lyon-tiled paths.
Surfaces, native views and sprite animations are not ported yet.
batches() returns an Array.
Ecosystem findings
Milky2018/moon_taffy@0.5.3 does not compile on the current toolchain: it hits the new explicit trait-method extend rule. The layout milestone needs a vendored fix.
First vertical slice of the MoonBit port of Zed's GPUI.
## What's here
- **docs/PORTING.md** has six parts:
- GPUI architecture summary.
- Module map from GPUI to MoonBit packages, split into pure and platform code.
- Mooncakes package survey with backend support.
- Backend recommendation: js plus Canvas2D first, behind a small `Platform` trait. WebGPU and native come later.
- Rust idioms (`dyn Any`/`TypeId`, associated types, `Drop`, macros, async) mapped to MoonBit designs.
- Ordered roadmap M0–M12, with open design questions.
- **`geometry`**:
- Units: `Pixels`, `ScaledPixels`, `DevicePixels`, `Rems`.
- Lengths: `AbsoluteLength`, `DefiniteLength`, `Length`, with parsing.
- Types: `Point`, `Size`, `Bounds`, `Edges`, `Corners`, `Anchor`, `Axis`, `ContentMask`.
- **`color`**:
- `Rgba` and `Hsla`, with conversions, hex parsing and blending.
- `Background`: solid, linear gradient, slash pattern, checkerboard.
- **`scene`**:
- Primitives: `Quad`, `Shadow`, `PaintedPath`, `Underline`, and monochrome, subpixel and polychrome sprites.
- `TransformationMatrix`.
- The `BoundsTree` draw-order R-tree.
- Layers, `finish` (stable sort by order and texture), `batches`, and `replay`.
- LICENSE (Apache-2.0) and NOTICE recording that the code is derived from GPUI.
## Testing
`moon check --target all` and `moon test --target all` pass: 45 tests on each of wasm, wasm-gc, js and native. `moon fmt` and `moon info` are clean.
Some tests are ported from GPUI:
- Pixels to int.
- Bounds join and intersects.
- Color hex parsing, alpha, opacity and background tests.
- The bounds-tree insert test.
- The randomized bounds-tree test, run over 200 seeds against a brute-force oracle.
## Deviations
These are listed in PORTING.md §6:
- Units are `Double` rather than `f32`.
- `PaintedPath` stores polygon contours, not lyon-tiled paths.
- Surfaces, native views and sprite animations are not ported yet.
- `batches()` returns an `Array`.
## Ecosystem findings
- `Milky2018/moon_taffy@0.5.3` does not compile on the current toolchain: it hits the new explicit trait-method `extend` rule. The layout milestone needs a vendored fix.
- `Milky2018/moon_cosmic` checks on js and native.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
docs/PORTING.md maps GPUI's architecture onto MoonBit packages, separates
pure logic from platform code, surveys mooncakes packages and their backends,
recommends a js + Canvas2D first backend behind a small Platform trait, lists
the Rust idioms that need a different design, and gives an ordered roadmap.
First slice (pure, tested on wasm, wasm-gc, js and native):
- geometry: Pixels/ScaledPixels/DevicePixels/Rems, Absolute/Definite/Length
with parsing, Point/Size/Bounds/Edges/Corners, Anchor, Axis, ContentMask
- color: Rgba/Hsla with conversions, hex parsing, blending, Background
(solid, linear gradient, patterns)
- scene: primitives (Quad, Shadow, Path, Underline, sprites), transformation
matrix, BoundsTree draw ordering, layers, finish/batches, replay
Derived from Zed's GPUI (Apache-2.0); see LICENSE and NOTICE.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
First vertical slice of the MoonBit port of Zed's GPUI.
What's here
Platformtrait. WebGPU and native come later.dyn Any/TypeId, associated types,Drop, macros, async) mapped to MoonBit designs.geometry:Pixels,ScaledPixels,DevicePixels,Rems.AbsoluteLength,DefiniteLength,Length, with parsing.Point,Size,Bounds,Edges,Corners,Anchor,Axis,ContentMask.color:RgbaandHsla, with conversions, hex parsing and blending.Background: solid, linear gradient, slash pattern, checkerboard.scene:Quad,Shadow,PaintedPath,Underline, and monochrome, subpixel and polychrome sprites.TransformationMatrix.BoundsTreedraw-order R-tree.finish(stable sort by order and texture),batches, andreplay.Testing
moon check --target allandmoon test --target allpass: 45 tests on each of wasm, wasm-gc, js and native.moon fmtandmoon infoare clean.Some tests are ported from GPUI:
Deviations
These are listed in PORTING.md §6:
Doublerather thanf32.PaintedPathstores polygon contours, not lyon-tiled paths.batches()returns anArray.Ecosystem findings
Milky2018/moon_taffy@0.5.3does not compile on the current toolchain: it hits the new explicit trait-methodextendrule. The layout milestone needs a vendored fix.Milky2018/moon_cosmicchecks on js and native.🤖 Generated with Claude Code