windjammer 0.48.0

A simple language inspired by Go, Ruby, and Elixir that transpiles to Rust - 80% of Rust's power with 20% of the complexity
Documentation
# Windjammer TODO List

**Last Updated:** 2025-12-04  
**Status:** Active Development - TDD + Dogfooding

---

## ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰ MILESTONE: PLATFORMER IS PLAYABLE! ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

### Complete! First Playable Windjammer Game!
**Priority:** โœ… DONE  
**Status:** Complete!  
**Context:** Full stack working - compiler โ†’ game engine โ†’ rendering โ†’ input โ†’ playable game!

**What Works:**
- โœ… Platformer game compiles from Windjammer source
- โœ… Window opens (800x600 using winit)
- โœ… **wgpu 2D rendering!** (draw_rect, draw_circle)
- โœ… **Real keyboard input!** (WASD, Arrows, Space, Escape, etc.)
- โœ… Mouse input handling (position, clicks)
- โœ… Physics simulation (gravity, collision)
- โœ… **Player moves and jumps!**
- โœ… **Platforms render and collide!**

**To Play:**
```bash
cd windjammer-game/examples/build
cargo run --bin platformer_test
```
- WASD / Arrow keys: Move
- Space / W / Up: Jump
- Close window to exit

---

## ๐ŸŽ‰ Previous Milestones

### windjammer-game-core BUILDS! (92โ†’0 errors)
**Status:** โœ… Complete!  

**Major Wins:**
- โœ… Auto-generate mod.rs for multi-file projects
- โœ… Fix Copy type parameters in trait methods
- โœ… Added Copy derive to Color, Tile, TileType structs
- โœ… Remove std::ui and std::game from stdlib
- โœ… Fixed String literal conversion
- โœ… Fixed window types (intโ†’u32)
- โœ… Fixed ownership/borrowing for all modules

### Trait Bound Inference (NEW!)
**Status:** โœ… Complete!  
**Context:** Automatically infers trait bounds for generic type parameters

**What Was Implemented:**
- โœ… Infers `Display` from `println!("{}", x)`
- โœ… Infers `Debug` from `println!("{:?}", x)`
- โœ… Infers `Clone` from `x.clone()`
- โœ… Infers `Add<Output = T>` from `x + x` (not just `Add`)
- โœ… Infers `Copy` when variable used twice in operators
- โœ… Infers `Sub`, `Mul`, `Div` with `Output = T` for same-type ops
- โœ… Automatically imports required traits (`std::fmt::Display`, `std::ops::Add`, etc.)

**Example:**
```windjammer
fn double<T>(x: T) -> T {
    x + x  // Infers T: Add<Output = T> + Copy
}
```

**Compiler Improvements:**
- Removed unnecessary `.to_string()` on string literals
- Better ownership inference for struct methods
- Proper `&str` handling in FFI calls
- Added `is_mutable` field to Parameter AST

**Test Status:**
- โœ… 206+ unit tests passing
- โœ… All integration tests passing
- โœ… Game engine builds cleanly

---

## ๐Ÿ”ฅ Next Priority: Enhance the Game!

### Text Rendering
**Priority:** HIGH  
**Status:** โœ… Complete!  
**Goal:** Display FPS, controls, status text in the platformer

**Implemented:**
- โœ… Bitmap font using 5x7 pixel characters
- โœ… `draw_text()` method on Renderer2D
- โœ… Supports A-Z, 0-9, punctuation
- โœ… Platformer displays FPS, controls, status!

### Sprite/Texture Rendering
**Priority:** MEDIUM  
**Status:** In Progress  
**Goal:** Load and render sprites for proper game graphics

**Implemented:**
- โœ… TextureManager for loading PNG/JPEG images
- โœ… Texture data accessible by handle
- โœ… Textured WGSL shader with UV coords
- โณ GPU texture upload (pending)
- โณ Renderer integration (pending)

**What we still need:
1. Texture loading (PNG support via `image` crate)
2. Implement `draw_sprite` with texture binding
3. Test with a sprite-based game

---

## ๐Ÿ› ๏ธ Compiler Improvements (Ongoing)

### String โ†’ &str Automatic Borrow Inference
**Priority:** MEDIUM (partially done)  
**Status:** Basic implementation complete

**Current State:**
- โœ… Function calls no longer add unnecessary `.to_string()` to string literals
- โณ Struct field initialization still needs explicit `.to_string()` in some cases

### Source Maps with Relative Paths
**Priority:** MEDIUM  
**Status:** Pending  
**Fix Needed:**
- Use relative paths from workspace root
- Detect workspace root dynamically
- Test across different machines

---

## ๐ŸŽฏ Game Engine Goals

### MVP: Platformer Demo โœ… COMPLETE!
**Status:** DONE!  
**Steps:**
1. โœ… windjammer-game-core compiles (0 errors)
2. โœ… Platformer game compiles
3. โœ… Window opens with input handling
4. โœ… wgpu rendering works
5. โœ… **Platformer is playable!**

### Next Games
- Breakout game (dogfooding test)
- Angry Birds clone (2D physics test)
- 3D FPS demo (3D rendering test)

---

## ๐Ÿงช Language Features (Planned)

### Ownership & Inference
- Closure capture analysis (by value/ref/mut)
- Local variable ownership tracking
- Move semantics for local variables

### Syntax Sugar
- Compound assignments (+=, -=, *=, /=)
- Destructuring assignment ((x, y) = (1, 2))
- Pattern matching in let (let Some(x) = opt else)

### Type System
- Trait bound inference
- Associated types as generics
- Smarter @auto derive inference

---

## ๐Ÿ”ง Developer Tools

### Error Handling
- Map Rust errors to Windjammer source lines
- Better error messages (colorized, helpful)

### Performance
- Performance benchmarks vs Rust
- Profiler integration

### Documentation
- Rust-style doctests in comments
- Language guide
- API reference
- Beginner tutorials
- 10+ example games

### IDE Support
- Language Server Protocol implementation
- VS Code extension (autocomplete, hover, etc.)
- Syntax highlighting

---

## ๐Ÿ“ฆ Package Management

### Windjammer Package Manager
- Package manager (wj add serde)
- Dependency resolution
- Version management

### Standard Library
- std/fs file system operations
- std/http client/server
- std/json parsing
- std/testing framework

---

## ๐ŸŽฎ 3D Game Engine (Long-term)

### 3D Rendering
- 3D rendering pipeline
- 3D camera system (FPS/orbit/follow)
- 3D lighting (directional/point/spot)
- 3D shadow mapping
- PBR materials

### Animation
- Skeletal animation system
- IK system
- Procedural animation
- Blend spaces

### Physics
- 3D physics integration (rapier)
- Ragdoll system
- Cloth simulation

### Environment
- Terrain system
- Water rendering
- Weather system
- Foliage

---

## ๐Ÿ“Š Progress Metrics

**Compiler Tests:** 206+ passing (100%) โœ…  
**Game Engine Errors:** 0 (down from 92!) ๐ŸŽ‰  
**Platformer:** PLAYABLE! ๐ŸŽฎโœ…  
**Features Working:**
- โœ… Window creation (winit)
- โœ… 2D rendering (wgpu)
- โœ… Keyboard input
- โœ… Mouse input
- โœ… Physics simulation
- โœ… Collision detection
- โณ Text rendering (stub)
- โณ Sprite rendering (stub)
- โณ Audio (stub)

---

## ๐Ÿ’ก Philosophy Reminders

**"80% of Rust's power with 20% of Rust's complexity"**

- Compiler does the hard work, not the developer
- Infer what doesn't matter (ownership, mutability, simple types)
- Be explicit about what matters (algorithms, business logic)
- No workarounds, no tech debt, only proper fixes
- TDD for all compiler changes
- Dogfooding reveals real bugs

---

**Remember:** Every bug is an opportunity to make the compiler better. Every test is documentation. Every commit is progress. No shortcuts. No tech debt. Only proper fixes.

---

## ๐ŸŽŠ Celebration!

We now have a **complete, working game** written in Windjammer:
1. Source code in `.wj` files
2. Compiled to Rust by Windjammer compiler
3. Uses wgpu for GPU rendering
4. Real-time input handling
5. Physics and collision
6. **IT'S PLAYABLE!**

This proves the Windjammer vision is viable. ๐Ÿš€