The finance calculator that lives in every group chat. Monthly compounding, annual raises, inflation — computed by kernels that compile to native Mojo via mojosub and are verified against CPython.
def project_final(principal, monthly, annual_return, years, raise):
balance = principal
r = (1 + annual_return) ** (1/12) - 1
c = monthly
for y in range(years):
for m in range(12):
balance = balance * (1 + r) + c
c *= (1 + raise)
return balance
Three scalar loops, no lists. Strings and shapes stay in the handler; the math is what compiles. Same rule as Trendfolio.