# Sample Index
This directory contains reference Python samples and transpiled outputs for each target language.
- Golden manifest: [`golden/manifest.json`](golden/manifest.json)
| No | Sample | Output | Py | cpp | rs | cs | ps1 | js | ts | dart | go | java | swift | kt | rb | lua | scala | php | nim | jl | zig |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 01 | mandelbrot | [`01_mandelbrot.png`](images/01_mandelbrot.png) | [`py`](py/01_mandelbrot.py) | [`cpp`](cpp/01_mandelbrot.cpp) | [`rs`](rs/01_mandelbrot.rs) | [`cs`](cs/01_mandelbrot.cs) | [`ps1`](powershell/01_mandelbrot.ps1) | [`js`](js/01_mandelbrot.js) | [`ts`](ts/01_mandelbrot.ts) | [`dart`](dart/01_mandelbrot.dart) | [`go`](go/01_mandelbrot.go) | [`java`](java/01_mandelbrot.java) | [`swift`](swift/01_mandelbrot.swift) | [`kt`](kotlin/01_mandelbrot.kt) | [`rb`](ruby/01_mandelbrot.rb) | [`lua`](lua/01_mandelbrot.lua) | [`scala`](scala/01_mandelbrot.scala) | [`php`](php/01_mandelbrot.php) | [`nim`](nim/01_mandelbrot.nim) | [`jl`](julia/01_mandelbrot.jl) | [`zig`](zig/01_mandelbrot.zig) |
| 02 | raytrace_spheres | [`02_raytrace_spheres.png`](images/02_raytrace_spheres.png) | [`py`](py/02_raytrace_spheres.py) | [`cpp`](cpp/02_raytrace_spheres.cpp) | [`rs`](rs/02_raytrace_spheres.rs) | [`cs`](cs/02_raytrace_spheres.cs) | [`ps1`](powershell/02_raytrace_spheres.ps1) | [`js`](js/02_raytrace_spheres.js) | [`ts`](ts/02_raytrace_spheres.ts) | [`dart`](dart/02_raytrace_spheres.dart) | [`go`](go/02_raytrace_spheres.go) | [`java`](java/02_raytrace_spheres.java) | [`swift`](swift/02_raytrace_spheres.swift) | [`kt`](kotlin/02_raytrace_spheres.kt) | [`rb`](ruby/02_raytrace_spheres.rb) | [`lua`](lua/02_raytrace_spheres.lua) | [`scala`](scala/02_raytrace_spheres.scala) | [`php`](php/02_raytrace_spheres.php) | [`nim`](nim/02_raytrace_spheres.nim) | [`jl`](julia/02_raytrace_spheres.jl) | [`zig`](zig/02_raytrace_spheres.zig) |
| 03 | julia_set | [`03_julia_set.png`](images/03_julia_set.png) | [`py`](py/03_julia_set.py) | [`cpp`](cpp/03_julia_set.cpp) | [`rs`](rs/03_julia_set.rs) | [`cs`](cs/03_julia_set.cs) | [`ps1`](powershell/03_julia_set.ps1) | [`js`](js/03_julia_set.js) | [`ts`](ts/03_julia_set.ts) | [`dart`](dart/03_julia_set.dart) | [`go`](go/03_julia_set.go) | [`java`](java/03_julia_set.java) | [`swift`](swift/03_julia_set.swift) | [`kt`](kotlin/03_julia_set.kt) | [`rb`](ruby/03_julia_set.rb) | [`lua`](lua/03_julia_set.lua) | [`scala`](scala/03_julia_set.scala) | [`php`](php/03_julia_set.php) | [`nim`](nim/03_julia_set.nim) | [`jl`](julia/03_julia_set.jl) | [`zig`](zig/03_julia_set.zig) |
| 04 | orbit_trap_julia | [`04_orbit_trap_julia.png`](images/04_orbit_trap_julia.png) | [`py`](py/04_orbit_trap_julia.py) | [`cpp`](cpp/04_orbit_trap_julia.cpp) | [`rs`](rs/04_orbit_trap_julia.rs) | [`cs`](cs/04_orbit_trap_julia.cs) | [`ps1`](powershell/04_orbit_trap_julia.ps1) | [`js`](js/04_orbit_trap_julia.js) | [`ts`](ts/04_orbit_trap_julia.ts) | [`dart`](dart/04_orbit_trap_julia.dart) | [`go`](go/04_orbit_trap_julia.go) | [`java`](java/04_orbit_trap_julia.java) | [`swift`](swift/04_orbit_trap_julia.swift) | [`kt`](kotlin/04_orbit_trap_julia.kt) | [`rb`](ruby/04_orbit_trap_julia.rb) | [`lua`](lua/04_orbit_trap_julia.lua) | [`scala`](scala/04_orbit_trap_julia.scala) | [`php`](php/04_orbit_trap_julia.php) | [`nim`](nim/04_orbit_trap_julia.nim) | [`jl`](julia/04_orbit_trap_julia.jl) | [`zig`](zig/04_orbit_trap_julia.zig) |
| 05 | mandelbrot_zoom | [`05_mandelbrot_zoom.gif`](images/05_mandelbrot_zoom.gif) | [`py`](py/05_mandelbrot_zoom.py) | [`cpp`](cpp/05_mandelbrot_zoom.cpp) | [`rs`](rs/05_mandelbrot_zoom.rs) | [`cs`](cs/05_mandelbrot_zoom.cs) | [`ps1`](powershell/05_mandelbrot_zoom.ps1) | [`js`](js/05_mandelbrot_zoom.js) | [`ts`](ts/05_mandelbrot_zoom.ts) | [`dart`](dart/05_mandelbrot_zoom.dart) | [`go`](go/05_mandelbrot_zoom.go) | [`java`](java/05_mandelbrot_zoom.java) | [`swift`](swift/05_mandelbrot_zoom.swift) | [`kt`](kotlin/05_mandelbrot_zoom.kt) | [`rb`](ruby/05_mandelbrot_zoom.rb) | [`lua`](lua/05_mandelbrot_zoom.lua) | [`scala`](scala/05_mandelbrot_zoom.scala) | [`php`](php/05_mandelbrot_zoom.php) | [`nim`](nim/05_mandelbrot_zoom.nim) | [`jl`](julia/05_mandelbrot_zoom.jl) | [`zig`](zig/05_mandelbrot_zoom.zig) |
| 06 | julia_parameter_sweep | [`06_julia_parameter_sweep.gif`](images/06_julia_parameter_sweep.gif) | [`py`](py/06_julia_parameter_sweep.py) | [`cpp`](cpp/06_julia_parameter_sweep.cpp) | [`rs`](rs/06_julia_parameter_sweep.rs) | [`cs`](cs/06_julia_parameter_sweep.cs) | [`ps1`](powershell/06_julia_parameter_sweep.ps1) | [`js`](js/06_julia_parameter_sweep.js) | [`ts`](ts/06_julia_parameter_sweep.ts) | [`dart`](dart/06_julia_parameter_sweep.dart) | [`go`](go/06_julia_parameter_sweep.go) | [`java`](java/06_julia_parameter_sweep.java) | [`swift`](swift/06_julia_parameter_sweep.swift) | [`kt`](kotlin/06_julia_parameter_sweep.kt) | [`rb`](ruby/06_julia_parameter_sweep.rb) | [`lua`](lua/06_julia_parameter_sweep.lua) | [`scala`](scala/06_julia_parameter_sweep.scala) | [`php`](php/06_julia_parameter_sweep.php) | [`nim`](nim/06_julia_parameter_sweep.nim) | [`jl`](julia/06_julia_parameter_sweep.jl) | [`zig`](zig/06_julia_parameter_sweep.zig) |
| 07 | game_of_life_loop | [`07_game_of_life_loop.gif`](images/07_game_of_life_loop.gif) | [`py`](py/07_game_of_life_loop.py) | [`cpp`](cpp/07_game_of_life_loop.cpp) | [`rs`](rs/07_game_of_life_loop.rs) | [`cs`](cs/07_game_of_life_loop.cs) | [`ps1`](powershell/07_game_of_life_loop.ps1) | [`js`](js/07_game_of_life_loop.js) | [`ts`](ts/07_game_of_life_loop.ts) | [`dart`](dart/07_game_of_life_loop.dart) | [`go`](go/07_game_of_life_loop.go) | [`java`](java/07_game_of_life_loop.java) | [`swift`](swift/07_game_of_life_loop.swift) | [`kt`](kotlin/07_game_of_life_loop.kt) | [`rb`](ruby/07_game_of_life_loop.rb) | [`lua`](lua/07_game_of_life_loop.lua) | [`scala`](scala/07_game_of_life_loop.scala) | [`php`](php/07_game_of_life_loop.php) | [`nim`](nim/07_game_of_life_loop.nim) | [`jl`](julia/07_game_of_life_loop.jl) | [`zig`](zig/07_game_of_life_loop.zig) |
| 08 | langtons_ant | [`08_langtons_ant.gif`](images/08_langtons_ant.gif) | [`py`](py/08_langtons_ant.py) | [`cpp`](cpp/08_langtons_ant.cpp) | [`rs`](rs/08_langtons_ant.rs) | [`cs`](cs/08_langtons_ant.cs) | [`ps1`](powershell/08_langtons_ant.ps1) | [`js`](js/08_langtons_ant.js) | [`ts`](ts/08_langtons_ant.ts) | [`dart`](dart/08_langtons_ant.dart) | [`go`](go/08_langtons_ant.go) | [`java`](java/08_langtons_ant.java) | [`swift`](swift/08_langtons_ant.swift) | [`kt`](kotlin/08_langtons_ant.kt) | [`rb`](ruby/08_langtons_ant.rb) | [`lua`](lua/08_langtons_ant.lua) | [`scala`](scala/08_langtons_ant.scala) | [`php`](php/08_langtons_ant.php) | [`nim`](nim/08_langtons_ant.nim) | [`jl`](julia/08_langtons_ant.jl) | [`zig`](zig/08_langtons_ant.zig) |
| 09 | fire_simulation | [`09_fire_simulation.gif`](images/09_fire_simulation.gif) | [`py`](py/09_fire_simulation.py) | [`cpp`](cpp/09_fire_simulation.cpp) | [`rs`](rs/09_fire_simulation.rs) | [`cs`](cs/09_fire_simulation.cs) | [`ps1`](powershell/09_fire_simulation.ps1) | [`js`](js/09_fire_simulation.js) | [`ts`](ts/09_fire_simulation.ts) | [`dart`](dart/09_fire_simulation.dart) | [`go`](go/09_fire_simulation.go) | [`java`](java/09_fire_simulation.java) | [`swift`](swift/09_fire_simulation.swift) | [`kt`](kotlin/09_fire_simulation.kt) | [`rb`](ruby/09_fire_simulation.rb) | [`lua`](lua/09_fire_simulation.lua) | [`scala`](scala/09_fire_simulation.scala) | [`php`](php/09_fire_simulation.php) | [`nim`](nim/09_fire_simulation.nim) | [`jl`](julia/09_fire_simulation.jl) | [`zig`](zig/09_fire_simulation.zig) |
| 10 | plasma_effect | [`10_plasma_effect.gif`](images/10_plasma_effect.gif) | [`py`](py/10_plasma_effect.py) | [`cpp`](cpp/10_plasma_effect.cpp) | [`rs`](rs/10_plasma_effect.rs) | [`cs`](cs/10_plasma_effect.cs) | [`ps1`](powershell/10_plasma_effect.ps1) | [`js`](js/10_plasma_effect.js) | [`ts`](ts/10_plasma_effect.ts) | [`dart`](dart/10_plasma_effect.dart) | [`go`](go/10_plasma_effect.go) | [`java`](java/10_plasma_effect.java) | [`swift`](swift/10_plasma_effect.swift) | [`kt`](kotlin/10_plasma_effect.kt) | [`rb`](ruby/10_plasma_effect.rb) | [`lua`](lua/10_plasma_effect.lua) | [`scala`](scala/10_plasma_effect.scala) | [`php`](php/10_plasma_effect.php) | [`nim`](nim/10_plasma_effect.nim) | [`jl`](julia/10_plasma_effect.jl) | [`zig`](zig/10_plasma_effect.zig) |
| 11 | lissajous_particles | [`11_lissajous_particles.gif`](images/11_lissajous_particles.gif) | [`py`](py/11_lissajous_particles.py) | [`cpp`](cpp/11_lissajous_particles.cpp) | [`rs`](rs/11_lissajous_particles.rs) | [`cs`](cs/11_lissajous_particles.cs) | [`ps1`](powershell/11_lissajous_particles.ps1) | [`js`](js/11_lissajous_particles.js) | [`ts`](ts/11_lissajous_particles.ts) | [`dart`](dart/11_lissajous_particles.dart) | [`go`](go/11_lissajous_particles.go) | [`java`](java/11_lissajous_particles.java) | [`swift`](swift/11_lissajous_particles.swift) | [`kt`](kotlin/11_lissajous_particles.kt) | [`rb`](ruby/11_lissajous_particles.rb) | [`lua`](lua/11_lissajous_particles.lua) | [`scala`](scala/11_lissajous_particles.scala) | [`php`](php/11_lissajous_particles.php) | [`nim`](nim/11_lissajous_particles.nim) | [`jl`](julia/11_lissajous_particles.jl) | [`zig`](zig/11_lissajous_particles.zig) |
| 12 | sort_visualizer | [`12_sort_visualizer.gif`](images/12_sort_visualizer.gif) | [`py`](py/12_sort_visualizer.py) | [`cpp`](cpp/12_sort_visualizer.cpp) | [`rs`](rs/12_sort_visualizer.rs) | [`cs`](cs/12_sort_visualizer.cs) | [`ps1`](powershell/12_sort_visualizer.ps1) | [`js`](js/12_sort_visualizer.js) | [`ts`](ts/12_sort_visualizer.ts) | [`dart`](dart/12_sort_visualizer.dart) | [`go`](go/12_sort_visualizer.go) | [`java`](java/12_sort_visualizer.java) | [`swift`](swift/12_sort_visualizer.swift) | [`kt`](kotlin/12_sort_visualizer.kt) | [`rb`](ruby/12_sort_visualizer.rb) | [`lua`](lua/12_sort_visualizer.lua) | [`scala`](scala/12_sort_visualizer.scala) | [`php`](php/12_sort_visualizer.php) | [`nim`](nim/12_sort_visualizer.nim) | [`jl`](julia/12_sort_visualizer.jl) | [`zig`](zig/12_sort_visualizer.zig) |
| 13 | maze_generation_steps | [`13_maze_generation_steps.gif`](images/13_maze_generation_steps.gif) | [`py`](py/13_maze_generation_steps.py) | [`cpp`](cpp/13_maze_generation_steps.cpp) | [`rs`](rs/13_maze_generation_steps.rs) | [`cs`](cs/13_maze_generation_steps.cs) | [`ps1`](powershell/13_maze_generation_steps.ps1) | [`js`](js/13_maze_generation_steps.js) | [`ts`](ts/13_maze_generation_steps.ts) | [`dart`](dart/13_maze_generation_steps.dart) | [`go`](go/13_maze_generation_steps.go) | [`java`](java/13_maze_generation_steps.java) | [`swift`](swift/13_maze_generation_steps.swift) | [`kt`](kotlin/13_maze_generation_steps.kt) | [`rb`](ruby/13_maze_generation_steps.rb) | [`lua`](lua/13_maze_generation_steps.lua) | [`scala`](scala/13_maze_generation_steps.scala) | [`php`](php/13_maze_generation_steps.php) | [`nim`](nim/13_maze_generation_steps.nim) | [`jl`](julia/13_maze_generation_steps.jl) | [`zig`](zig/13_maze_generation_steps.zig) |
| 14 | raymarching_light_cycle | [`14_raymarching_light_cycle.gif`](images/14_raymarching_light_cycle.gif) | [`py`](py/14_raymarching_light_cycle.py) | [`cpp`](cpp/14_raymarching_light_cycle.cpp) | [`rs`](rs/14_raymarching_light_cycle.rs) | [`cs`](cs/14_raymarching_light_cycle.cs) | [`ps1`](powershell/14_raymarching_light_cycle.ps1) | [`js`](js/14_raymarching_light_cycle.js) | [`ts`](ts/14_raymarching_light_cycle.ts) | [`dart`](dart/14_raymarching_light_cycle.dart) | [`go`](go/14_raymarching_light_cycle.go) | [`java`](java/14_raymarching_light_cycle.java) | [`swift`](swift/14_raymarching_light_cycle.swift) | [`kt`](kotlin/14_raymarching_light_cycle.kt) | [`rb`](ruby/14_raymarching_light_cycle.rb) | [`lua`](lua/14_raymarching_light_cycle.lua) | [`scala`](scala/14_raymarching_light_cycle.scala) | [`php`](php/14_raymarching_light_cycle.php) | [`nim`](nim/14_raymarching_light_cycle.nim) | [`jl`](julia/14_raymarching_light_cycle.jl) | [`zig`](zig/14_raymarching_light_cycle.zig) |
| 15 | wave_interference_loop | [`15_wave_interference_loop.gif`](images/15_wave_interference_loop.gif) | [`py`](py/15_wave_interference_loop.py) | [`cpp`](cpp/15_wave_interference_loop.cpp) | [`rs`](rs/15_wave_interference_loop.rs) | [`cs`](cs/15_wave_interference_loop.cs) | [`ps1`](powershell/15_wave_interference_loop.ps1) | [`js`](js/15_wave_interference_loop.js) | [`ts`](ts/15_wave_interference_loop.ts) | [`dart`](dart/15_wave_interference_loop.dart) | [`go`](go/15_wave_interference_loop.go) | [`java`](java/15_wave_interference_loop.java) | [`swift`](swift/15_wave_interference_loop.swift) | [`kt`](kotlin/15_wave_interference_loop.kt) | [`rb`](ruby/15_wave_interference_loop.rb) | [`lua`](lua/15_wave_interference_loop.lua) | [`scala`](scala/15_wave_interference_loop.scala) | [`php`](php/15_wave_interference_loop.php) | [`nim`](nim/15_wave_interference_loop.nim) | [`jl`](julia/15_wave_interference_loop.jl) | [`zig`](zig/15_wave_interference_loop.zig) |
| 16 | glass_sculpture_chaos | [`16_glass_sculpture_chaos.gif`](images/16_glass_sculpture_chaos.gif) | [`py`](py/16_glass_sculpture_chaos.py) | [`cpp`](cpp/16_glass_sculpture_chaos.cpp) | [`rs`](rs/16_glass_sculpture_chaos.rs) | [`cs`](cs/16_glass_sculpture_chaos.cs) | [`ps1`](powershell/16_glass_sculpture_chaos.ps1) | [`js`](js/16_glass_sculpture_chaos.js) | [`ts`](ts/16_glass_sculpture_chaos.ts) | [`dart`](dart/16_glass_sculpture_chaos.dart) | [`go`](go/16_glass_sculpture_chaos.go) | [`java`](java/16_glass_sculpture_chaos.java) | [`swift`](swift/16_glass_sculpture_chaos.swift) | [`kt`](kotlin/16_glass_sculpture_chaos.kt) | [`rb`](ruby/16_glass_sculpture_chaos.rb) | [`lua`](lua/16_glass_sculpture_chaos.lua) | [`scala`](scala/16_glass_sculpture_chaos.scala) | [`php`](php/16_glass_sculpture_chaos.php) | [`nim`](nim/16_glass_sculpture_chaos.nim) | [`jl`](julia/16_glass_sculpture_chaos.jl) | [`zig`](zig/16_glass_sculpture_chaos.zig) |
| 17 | monte_carlo_pi | - | [`py`](py/17_monte_carlo_pi.py) | [`cpp`](cpp/17_monte_carlo_pi.cpp) | [`rs`](rs/17_monte_carlo_pi.rs) | [`cs`](cs/17_monte_carlo_pi.cs) | [`ps1`](powershell/17_monte_carlo_pi.ps1) | [`js`](js/17_monte_carlo_pi.js) | [`ts`](ts/17_monte_carlo_pi.ts) | [`dart`](dart/17_monte_carlo_pi.dart) | [`go`](go/17_monte_carlo_pi.go) | [`java`](java/17_monte_carlo_pi.java) | [`swift`](swift/17_monte_carlo_pi.swift) | [`kt`](kotlin/17_monte_carlo_pi.kt) | [`rb`](ruby/17_monte_carlo_pi.rb) | [`lua`](lua/17_monte_carlo_pi.lua) | [`scala`](scala/17_monte_carlo_pi.scala) | [`php`](php/17_monte_carlo_pi.php) | [`nim`](nim/17_monte_carlo_pi.nim) | [`jl`](julia/17_monte_carlo_pi.jl) | [`zig`](zig/17_monte_carlo_pi.zig) |
| 18 | mini_language_interpreter | - | [`py`](py/18_mini_language_interpreter.py) | [`cpp`](cpp/18_mini_language_interpreter.cpp) | [`rs`](rs/18_mini_language_interpreter.rs) | [`cs`](cs/18_mini_language_interpreter.cs) | [`ps1`](powershell/18_mini_language_interpreter.ps1) | [`js`](js/18_mini_language_interpreter.js) | [`ts`](ts/18_mini_language_interpreter.ts) | [`dart`](dart/18_mini_language_interpreter.dart) | [`go`](go/18_mini_language_interpreter.go) | [`java`](java/18_mini_language_interpreter.java) | [`swift`](swift/18_mini_language_interpreter.swift) | [`kt`](kotlin/18_mini_language_interpreter.kt) | [`rb`](ruby/18_mini_language_interpreter.rb) | [`lua`](lua/18_mini_language_interpreter.lua) | [`scala`](scala/18_mini_language_interpreter.scala) | [`php`](php/18_mini_language_interpreter.php) | [`nim`](nim/18_mini_language_interpreter.nim) | [`jl`](julia/18_mini_language_interpreter.jl) | [`zig`](zig/18_mini_language_interpreter.zig) |
Notes:
- `-` in `Output` means the sample does not currently publish an image/GIF artifact in `sample/images/`.
- This index is path-based and intended for GitHub folder browsing.
## Sample Operation Guide
### Purpose
`sample/` is the directory for transpiling practical Python samples into each target language and comparing execution results and runtime.
### Directory Structure
- [`py/`](py): Source Python samples (currently `01` to `18`)
- [`cpp/`](cpp): C++ transpilation outputs
- [`rs/`](rs): Rust transpilation outputs
- [`cs/`](cs): C# transpilation outputs
- [`powershell/`](powershell): PowerShell transpilation outputs
- [`js/`](js): JavaScript transpilation outputs
- [`ts/`](ts): TypeScript transpilation outputs
- [`dart/`](dart): Dart transpilation outputs
- [`go/`](go): Go transpilation outputs
- [`java/`](java): Java transpilation outputs
- [`swift/`](swift): Swift transpilation outputs
- [`kotlin/`](kotlin): Kotlin transpilation outputs
- [`ruby/`](ruby): Ruby transpilation outputs
- [`lua/`](lua): Lua transpilation outputs
- [`scala/`](scala): Scala transpilation outputs
- [`php/`](php): PHP transpilation outputs
- [`nim/`](nim): Nim transpilation outputs
- [`julia/`](julia): Julia transpilation outputs
- [`zig/`](zig): Zig transpilation outputs
- [`images/`](images): Static images for README rendering (tracked by Git)
- `obj/`: Build artifacts for each language (not tracked by Git)
- `out/`: Runtime output images (PNG/GIF, not tracked by Git)
## Runtime Performance Comparison
Execution times for sample programs written in Python and their transpiled versions (unit: seconds). In the table, Python is the original code and PyPy is for reference.
|No.|Workload|Python|PyPy|C++|Rust|C#|PS|JS|TS|Dart|Go|Java|Swift|Kotlin|Ruby|Lua|Scala3|PHP|Nim|Julia|Zig|
|-|-|-:|-:|-:|-:|-:|-:|-:|-:|-:|-:|-:|-:|-:|-:|-:|-:|-:|-:|-:|-:|
|01 |Mandelbrot set (PNG)|39.303|1.091|18.214|0.781|6.092|232|0.768|7.936|1.742|1.615|2.987|0.760|0.756|18.955|5.500|2.221|10.73|2.63|4.964|1.39|
|02 |Simple sphere ray tracer (PNG)|13.823|0.529|19.953|0.165|4.357|>600|0.277|5.526|1.232|0.868|3.422|0.289|0.258|11.146|3.049|15.765|4.52|1.12|5.122|0.45|
|03 |Julia set (PNG)|48.285|1.959|18.404|0.823|14.972|>600|1.210|30.285|3.335|2.141|5.272|1.125|1.151|37.170|8.162|7.935|15.84|4.30|17.446|1.44|
|04 |Orbit-trap Julia set (PNG)|26.903|1.081|19.529|0.358|5.013|240|0.473|23.409|2.136|1.204|3.013|0.482|0.469|28.702|4.237|7.592|7.54|1.53|2.657|0.85|
|05 |Mandelbrot zoom (GIF)|28.506|1.262|17.797|0.569|3.932|>600|1.144|4.268|1.440|1.203|2.598|0.695|0.687|14.892|17.852|8.871|7.27|1.93|2.987|0.92|
|06 |Julia parameter sweep (GIF)|19.846|0.507|20.272|0.407|3.487|>600|1.192|4.373|1.597|1.008|2.925|0.624|0.629|10.704|11.122|11.067|5.51|1.54|4.455|0.87|
|07 |Game of Life (GIF)|12.917|0.685|19.345|0.369|7.773|>600|1.364|11.787|5.237|1.278|6.771|1.290|1.267|11.205|8.036|5.225|9.09|2.42|15.551|2.18|
|08 |Langton's Ant (GIF)|15.253|0.767|19.218|0.483|9.833|>600|4.383|14.494|8.223|1.364|6.570|1.886|2.019|18.824|10.367|6.446|12.56|2.90|21.323|2.77|
|09 |Flame simulation (GIF)|54.585|1.167|19.281|0.661|17.466|>600|2.374|16.352|9.557|1.682|35.798|2.306|2.358|32.077|18.097|18.956|32.64|5.19|28.351|1.80|
|10 |Plasma effect (GIF)|15.664|0.876|21.471|0.554|9.037|>600|1.444|7.862|2.711|1.627|4.526|1.444|1.319|11.745|7.806|4.525|6.66|2.00|15.702|1.79|
|11 |Lissajous particles (GIF)|10.077|0.532|20.776|0.359|6.069|>600|1.425|7.189|5.478|1.085|4.795|1.371|1.413|7.950|7.809|3.406|6.48|2.23|16.981|2.29|
|12 |Sorting visualization (GIF)|10.779|0.552|17.563|0.362|6.568|>600|1.341|7.800|4.453|1.163|5.007|1.328|1.306|8.087|7.078|4.057|6.74|2.21|13.143|0.60|
|13 |Maze generation steps (GIF)|9.145|0.533|19.213|0.298|6.337|>600|1.038|7.965|5.014|1.114|4.507|0.997|0.987|6.825|6.288|3.735|6.85|1.98|11.589|1.75|
|14 |Simple ray marching (GIF)|6.012|0.300|20.663|0.159|3.290|>600|0.489|3.527|1.453|0.791|2.517|0.503|0.492|3.800|3.370|2.138|2.82|0.71|8.241|0.66|
|15 |Wave interference loop (GIF)|6.192|0.402|20.289|0.252|3.390|>600|0.616|3.878|1.713|0.918|2.878|0.629|0.612|5.142|3.316|2.496|2.77|0.94|7.849|0.76|
|16 |Chaos rotation of glass sculpture (GIF)|13.057|0.606|20.583|0.246|5.229|>600|0.650|3.795|1.667|0.885|4.116|0.667|0.643|8.743|8.059|15.675|5.26|1.54|11.077|0.68|
|17 |Monte Carlo Pi approximation|7.055|0.105|27.458|0.018|1.408|8|0.597|1.772|0.133|0.593|2.195|0.436|0.436|1.988|0.534|0.279|0.72|0.80|0.074|0.02|
|18 |Mini-language interpreter|2.793|0.601|28.132|0.427|3.608|>600|0.792|1.596|0.422|0.878|2.977|0.423|0.417|7.854|2.403|0.885|2.92|2.32|2.037|6.38|
> Last auto-updated: 2026-03-31T05:05:44
### Measurement Conditions (README Table Baseline)
- Python: `PYTHONPATH=src python3 sample/py/.py`
- PyPy: `PYTHONPATH=src pypy3 sample/py/.py`
- C++: `g++ -std=c++20 -O3 -ffast-math -flto -I src ...`
- C#: `mcs ...` + `mono ...`
- PowerShell: `pwsh -File sample/powershell/.ps1` (PowerShell 7.4.6)
- Rust: `rustc -O ...`
- JavaScript: `node sample/js/.js`
- TypeScript: Compile with `tsc ...`, then run with `node ...`
- Go: `go run` or execute after `go build`
- Java: `javac` + `java`
- Swift: Executable built with `swiftc`
- Kotlin: `jar` built with `kotlinc -include-runtime`
- Ruby: `ruby --yjit sample/ruby/.rb` (for benchmarking; regular runs can use `ruby sample/ruby/.rb`)
- PHP: `php -d memory_limit=8G sample/php/.php` (PHP 8.3.15 CLI)
- Nim: `nim c --hints:off -o:app.out .nim`, then run executable (Nim 2.2.8)
- Zig: `zig build-exe -OReleaseFast .zig`, then run executable (Zig 0.13.0)
- Julia: `julia .jl` (Julia 1.11.3)
Note:
- `py2go.py` / `py2java.py` / `py2swift.py` / `py2kotlin.py` are currently in preview emitter status.
- For these four languages, outputs are minimal entry files with intermediate-code comments, so they are excluded from runtime comparison.
### README Runtime Table Details
- Values in `readme.md` are measured as of 2026-02-26 for all 18 `sample/py` cases using current transpiler outputs (rounded to 3 decimals).
- Measurement protocol: fresh transpile, `warmup=1`, `repeat=5`, median of `elapsed_sec` (compile time excluded).
- C++/Rust columns were remeasured on 2026-02-27 using `tools/benchmark_sample_cpp_rs.py` (fresh transpile, `warmup=1`, `repeat=5`) with logs at `work/logs/bench_cpp_rs_after_east3_opt_20260227_cases01_17.json` and `work/logs/bench_cpp_rs_after_east3_opt_20260227_case18.json`.
- Ruby column was remeasured on 2026-02-27 with fresh transpile + `ruby --yjit` + `warmup=1` + `repeat=5` (median), with log at `work/logs/bench_ruby_yjit_sample_20260227.json`.
- Ruby benchmarks are run with `ruby --yjit`.
- In the latest measurement, there are no `>1.5x` gaps (all 18 cases are `<=1.5x`).
- Go/Java/Swift/Kotlin currently run via the JS sidecar bridge, so their numbers reflect that bridge execution path.
- Output parity is confirmed for all 18 `sample/py` cases across `cpp/rs/cs/js/ts/go/java/swift/kotlin/php/nim` (S3-S7 verification logs from `tools/runtime_parity_check.py`).
- PHP column was measured on 2026-03-22 with fresh transpile + `php -d memory_limit=8G` (`warmup=0`, `repeat=1`).
- Nim column was measured on 2026-03-22 with fresh transpile + `nim c --hints:off` compile then run (`warmup=0`, `repeat=1`).
- Zig column was measured on 2026-03-22 with fresh transpile + `zig build-exe -OReleaseFast` compile then run (`warmup=0`, `repeat=3`, best of 3). Output parity confirmed (byte-identical artifacts for all 16 image-producing samples).
### Runtime Notes
- When running `sample/py/` as Python directly, add `PYTHONPATH=src` for `pylib` resolution.
```bash
PYTHONPATH=src python3 sample/py/01_mandelbrot.py
```
### Relation To Test Code
`test/` and `sample/` have different roles: `test/` is for small feature checks, `sample/` is for practical, heavier-load cases.
- [`../test/fixtures`](../test/fixtures): Source test code for transpilation
- [`../test/unit`](../test/unit): Unit tests
- `../test/transpile/`: Working directory for transpilation artifacts (not tracked by Git)
- Not viewable on GitHub. Generate locally by running transpilation when needed.
### Parity Check (Output Verification)
`tools/check/runtime_parity_check.py` is the canonical parity check tool for all languages. It uses the fast parity engine internally and compares Python execution results (stdout + artifacts) against target language results.
```bash
# C++ only
python3 tools/check/runtime_parity_check.py --targets cpp --case-root sample --all-samples
# All languages
python3 tools/check/runtime_parity_check.py \
--targets cpp,rs,cs,js,ts,go,java,kotlin,swift,ruby,lua,php,scala,nim \
--case-root sample --all-samples
```