The "can I buy this?" calculator. Months to save, amortised monthly cost, and a stress test: what happens if your income drops 30% for a year? Kernels compile to native Mojo.
def months_to_save(price, savings, monthly_saving) -> int:
if price <= savings: return 0
if monthly_saving <= 0: return -1
balance = savings; months = 0
while balance < price:
balance += monthly_saving; months += 1
return months
A while + break-free bounded loop
— compilers love it, Python pays per-iteration. Same contract as the
other examples: parse in the handler, reduce in the kernel.