High-performance Pure MoonBit Transfer Matrix Method (TMM) optical simulation & parameter inversion engine
git clone https://github.com/zc222er/moonbit-thinfilm-tmm.git
cd moonbit-thinfilm-tmm
moon version --all
moon check --deny-warn --target all
moon test --deny-warn --target allmoon run cmd/main# Run the optical simulation demonstration
moon run cmd/main
# Run the fixed benchmark workload only
moon run cmd/main -- benchmarkcore/ Complex numbers, layers, spectra, results, and matrix primitives
math/ Dense numerical linear algebra, interpolation, integration, and RNG
dispersion/ Analytic and tabulated optical-dispersion models
materials/ Reusable optical-material records and constants
tmm2d/ Isotropic 2×2 transfer-matrix solver
tmm4x4/ Anisotropic 4×4 Berreman/Jones solver
field/ Depth-resolved electromagnetic field calculations
devices/ Optical-device construction and application presets
analysis/ Color, polarization, ellipsometry, coherence, and spectroscopy tools
inversion/ Constrained fitting and global optimization algorithms
cli/ Text rendering and benchmark orchestration
cmd/main/ Native executable entry point
wasm/ WebAssembly-facing exportsmoon run cmd/main -- benchmark| workload | points/layers | min (ms) | median (ms) | max (ms) |
|---|---|---|---|---|
| complete benchmark command | 121/401-point workload, including all three cases | 225.675 | 235.992 | 282.394 |
powershell -ExecutionPolicy Bypass -File .\scripts\benchmark.ps1 -Iterations 5moon test --deny-warn --target all
moon test --deny-warn --target nativeInstall
Download zipHigh-performance Pure MoonBit Transfer Matrix Method (TMM) optical simulation & parameter inversion engine