Phy checks units, structure and proofs when it builds, and compiles to small, fast firmware.
A wrong sign, a missing term or a wrong law is refused before any code exists.
Checks units on every symbol, and converts units and prefixes automatically: nT ↔ µT, g/cm³ ↔ kg/m³, % ↔ 1, degrees ↔ radians.
Proves identities when it builds (✓). It shows that a derived formula really follows from its parent law.
Cross-checks several formulas for the same quantity (⋔).
Generates solvers from the equations as written: a partial differential equation written in 2 lines becomes a spectral solver.
Includes a quantum layer: states, operators, tensor products, matrix exponentials, with checks that operators are Hermitian or unitary and states are normalised.
Refuses invalid sensor samples one by one without stopping the program.
Compiles to stand-alone C for the device, with no runtime to install.
Physics in ordinary code is a copy of the physics, written by hand. Ordinary languages check types, not physics.
A unit slip, a wrong sign, sin in place of cos, or a missing term compiles, runs and ships. Even languages with units of measure cannot tell a correct law from a wrong one with the same units.
| Measure | Phy | F# (units of measure) | OpenModelica (unit checking on) |
|---|---|---|---|
| Planted physics bugs kept out of shipped firmware (35, pre-registered) | 20 | 17 | 5 |
| The same, excluding the 3 bugs with no effect on the data (of 32) | 17 | 14 | 2 |
| Bugs caught by this language alone (of 32) | 7 | 4 | 0 |
| NV-sensor firmware, ns per sample | 589 | 8,071 | 24,526 |
| Gravity-gradiometer firmware, ns per sample | 3,708 | 9,569 | 26,757 |
| What the NV device carries | 0.22 MB | 82.6 MB (with .NET) | 4.1 MB |
| Cold start, NV device | 0.016 s | 0.136 s | 0.026 s |
On the NV sensor, Phy → C was 3.5× faster than C++ (2,074 ns), 14× faster than F# and 42× faster than the Modelica FMU.
On the gradiometer, Phy → C reproduces the reference to 3e-15.
In a 3-body thermal-network model, Phy took 2 lines against 28 (F#) and 20 (OpenModelica).
Phy’s extra catches were physics structure: signs, the wrong trigonometric function, a missing term, a wrong lag law.
Cross-build. The same Phy-generated C builds for 6 processor families: x86-64 Windows and Linux, ARM64, ARMv7, RISC-V 64 and WebAssembly. It has been run and matched on 3 of them so far, with 20–55 kB of code per processor.