Compare Hardhat and Foundry for gas optimization. Analyze compilation speed and testing capabilities.
Hardhat is JavaScript-based with excellent debugging. Foundry is Rust-based with extremely fast testing.
Foundry's forge test runs 100x faster. Hardhat has better error messages and stack traces.