Skip to main content

calc — a scripting language for building things simply

calc_rs

calc_rs is a strongly typed scripting language for calculations and structured data. The core is written in Rust, and is available as a CLI, Rust library, and Python extension module.

Key features

  • Strongly typed: Currency, percentages, dates, durations, tonnage, tables, and other domain values are distinct types rather than decorated numbers.

  • Calculations: Designed for real-world calculations with units and domain-specific values, while retaining a concise expression-oriented syntax.

  • Data & Tables: Tables are first-class values that can be created, transformed, queried, and persisted directly from the language.

  • Pipelines: Compose transformations with |>, making data workflows read from top to bottom instead of nesting operations.

  • Schema-aware: CSV data can be loaded with inferred or explicit schemas. Values are checked against their declared types rather than silently converted to text.

  • Scripting: Run individual expressions, .calc files, or multi-file projects with imports and modules.

  • Interactive: A REPL with syntax highlighting, completion, signatures, multi-line expressions, and session state.

  • Editor Support: Built-in Language Server support provides diagnostics, completion, and hover information.

  • Embeddable: Use the engine directly from Rust or Python.

  • Rust: Written in Rust with the performance-critical engine implemented natively and exposed through a library API.

Why calc_rs?

calc_rs is designed for programs where calculations and structured data are central to the problem.

Instead of treating everything as an untyped number or string, values carry their meaning and type:

let price = $12.50
let quantity = 3

price * quantity
// $37.50

The same language can work with structured data:

load("sales.csv")
  |> filter([region] == "EU")
  |> extend("net", [gross] - [tax])
  |> groupby("region", "net", "sum")
  |> sort([sum_net], "desc")

Schemas can be declared explicitly when the shape of the data matters:

struct Shipment {
  date: date,
  port: text,
  box: container,
  amount: currency
}

load("jan.csv", Shipment)

This lets the language check data as it enters the program rather than discovering type problems later.

Philosophy

The goal of calc_rs is to provide a scripting language that:

  • Keeps calculations concise without sacrificing strong typing.
  • Treats domain-specific values as real types.
  • Makes structured data and tables first-class language values.
  • Makes data transformations readable through pipelines.
  • Detects schema and type errors before they become silent data corruption.
  • Works interactively as well as in scripts and multi-file projects.
  • Can be embedded in both Rust and Python applications.
  • Provides useful editor tooling without requiring a separate runtime.

calc_rs is written in Rust, giving the engine control over its data representation and performance-critical execution while keeping the language small and embeddable.

Install

CLI

uv tool install calc-rust

Then:

calc_rs '$5.00 * 3'
# $15.00

Or run without installing:

uvx --from calc-rust calc_rs '$5.00 * 3'

Desktop app (Windows and macOS)

uv tool install calc-desktop
calc_desktop path/to/project

The app installs like the CLI — uv unpacks it into your user folder, so no installer runs. On Windows it needs the WebView2 runtime (included in Windows 11). On Linux, build it from desktop/ instead.

Python

pip install calc-rs-lang
import calc_rs

calc_rs.evaluate("$5.00 * 3")
# Currency($15.00)

Rust

[dependencies]
calc_rs = { git = "https://github.com/Attica-oss/calc_rs" }

Documentation

Development

cargo test
maturin develop --release

License

MIT — see LICENSE.

Metadata

Release files for calc-rs-lang 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for calc-rs-lang 0.3.3
File Size Uploaded Provenance Actions
calc_rs_lang-0.3.3.tar.gz 1.6 MB With provenance Details for calc_rs_lang-0.3.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for calc-rs-lang 0.3.3
File Actions
calc_rs_lang-0.3.3-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for calc_rs_lang-0.3.3-cp310-abi3-win_amd64.whl
calc_rs_lang-0.3.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for calc_rs_lang-0.3.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
calc_rs_lang-0.3.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for calc_rs_lang-0.3.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
calc_rs_lang-0.3.3-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for calc_rs_lang-0.3.3-cp310-abi3-macosx_11_0_arm64.whl
calc_rs_lang-0.3.3-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for calc_rs_lang-0.3.3-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 14.0 MB

Release files / calc_rs_lang-0.3.3.tar.gz

Download URL calc_rs_lang-0.3.3.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
b2259de2b3e0df8b74e1508862f1f58428dfa1a39edde5bdcf0d03cb04ba3630
BLAKE2b-256 checksum
How to use checksums
6bb50b39d8f7460323c1d335082db1e0c57c39505a5c010266d886161252ea35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / calc_rs_lang-0.3.3-cp310-abi3-win_amd64.whl

Download URL calc_rs_lang-0.3.3-cp310-abi3-win_amd64.whl
Size 2.3 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
28a34f51f2a61e2c3748cae92b3d1923f32067b79a9f665596e0bb021346d706
BLAKE2b-256 checksum
How to use checksums
144e5d59d875c74bca5707b4a75f02cf4ce410cdf56656432f1507a5672d4cd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / calc_rs_lang-0.3.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL calc_rs_lang-0.3.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
d578b4ffd3bb486dd2455f9e8b88a3917c85b5a9a6d360f51a5ba66a17472276
BLAKE2b-256 checksum
How to use checksums
9e6a3e85b8db2f17e7020d0d57c90fe34ab94984a8774b66486e68496b274a8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / calc_rs_lang-0.3.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL calc_rs_lang-0.3.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.6 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
1a78a237ca4c6aa6b239e910e33ab86f0281aade5070edf47db53ce5980e4bbd
BLAKE2b-256 checksum
How to use checksums
6882ed43ca2985b67f4a7251ec458dcf41548ee7057fb6ce4aab870d259e3bf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / calc_rs_lang-0.3.3-cp310-abi3-macosx_11_0_arm64.whl

Download URL calc_rs_lang-0.3.3-cp310-abi3-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d3a084651c16f2cc20621708b5c733ab0172308d8a9ae8dcc13384a47d0dc827
BLAKE2b-256 checksum
How to use checksums
51a5f8e7cb5056f54d91915b69e6041f4cba2834efefdc05105a2e075e79708b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / calc_rs_lang-0.3.3-cp310-abi3-macosx_10_12_x86_64.whl

Download URL calc_rs_lang-0.3.3-cp310-abi3-macosx_10_12_x86_64.whl
Size 2.4 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
c2230c572fee63d21a1b96f7015e379e4fb881bf3c5db3f59550d946b5ab9e31
BLAKE2b-256 checksum
How to use checksums
1c70f4bd7bdd113f38b58e3f4b1b13660fe2bbd7b9308e200c6616b7258b0662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Security for calc-rs-lang 0.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for calc_rs_lang-0.3.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page