calculang
functional language
- calculations described by pure-functions with no side-effects
- purity: same inputs => same outputs; predictability for calculations
- no side-effects facilitates safe recalculation
- when we want to validate, or investigate calculations, for example
- comparable to “formulae” in spreadsheet parlance
only for calculations
- This is not a bug!
- Forces separation of concerns: numbers/calcs separate from applications
- For applications BYOL
this is a wide scope on computers
what does separation of concerns do/can do?
- encapsulate calculations/numbers/workings (without other messing)
- frictionless transparency into calculations/numbers/workings
- facilitate sharing numbers and a defined link to their calculations/workings
also:
- with a domain-specific language for numbers, we can make specialised tools for numbers
- explore, interpret, visualize, …
- and we can develop a language for flexible and re-usable formulae
current implementation details
- calculang-js: looks like JS/ESM (but invalid) and
cul-js
compiles calculang to (valid) JS/ESMcul-js
piggybacks off tools like babel and webpack 🙌
calculang is free software
GitHub calculang/calculang
Twitter @calculang
Fosstodon @calculang
calculang website & community gallery TBC
- but draft website examples… LINK
Applications
calculang is unopinonated about how used (in theory).
- (but in practice…) implementation output is a JS bundle and ESM code
calcudata
is a convenient way to pull results from calculang modelscalcuvizspec
uses calcudata to map model formulae/inputs directly to visualization channels (thanks UW IDL and Vega Lite).
See code for example applications in ➤ Code blocks within applications.
Previous presentations:
- BelfastJS “little applications” Tracing calcs, Raycasting, Sunsets!
- calcuvizspec visualization API to visualize! (1x option)
DX YouTube video (almost out of date)
Other content
about to be harvested into a community gallery!
- Hearty maths ❤️, my first blog post on CalcWithDec.dev
- You 👉 be the finance minister 🎩 modular!
- Pension calculator modular, recycles tax calcs!
- Sunsets interactions and animations 🌞🌞
- Raycasting 3d worlds 🧱🔫, a slightly-rushed competition entry for maths education (will improve and post to CalcWithDec)
Mixed up/older examples:
calculang.party
A short-term goal is to publish a community gallery of calculang models and visualizations.
Feel free to talk to me if you want to publish a model! 😊
other calculang future
Browser extension (issue #5)
Wikipedia calculations ?: reproduce some, share?
language integrations e.g. Python, Julia
tools (“explore, interpret, visualize”…)
other language targets, optimisation engine (long term for me)
Connect
Twitter @calculang
Fosstodon @calculang
YouTube @CalcWithDec
Slides
This QR code will bring you to a webpage of slide contents.
To go to the draft website examples we looked at then scroll to end and click HERE ⏩ (works better on desktop!).