Idea

Project / Portable calculations

Move a prepared calculation.

A rainwater report prepares weather data before you adjust a tank-size slider. Moving that calculation to a browser or worker can mean repeating the preparation or writing another implementation.

Yichus can package a supported pure Bosatsu function with its captured values and compiled instructions. Bosatsu is the typed functional language used for the calculation. The browser or a Node worker calls that function with the saved state, without repeating preparation.

What works today

The rainwater report prepares a weather record once. Its sliders then run the calculation locally with that captured data. Why shows the inputs and recorded values from the displayed run.

A separately configured Node host can distribute scenario calculations to HTTP workers. The static report linked here runs in your browser; the worker setup is in the runtime guide.

The compiler checks which functions and captured values can be transferred. This supports pure calculations at function-call boundaries, rather than suspending an arbitrary running program. Workers accept configured, trusted generated code; they are not a sandbox for arbitrary uploads.

All Yichus projects · Calculators with Why buttons