Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ccalc

A fast terminal calculator with Octave/MATLAB syntax and script support — one binary, no runtime.

Octave is hundreds of megabytes. Python requires a runtime. ccalc is a single self-contained binary that starts instantly and works anywhere: interactive sessions, shell scripts, CI pipelines, Docker containers.

Quick start

# Interactive REPL
ccalc

# Single expression
ccalc "2 ^ 32"

# Script file
ccalc script.m

# Pipe mode
echo "sqrt(2)" | ccalc

Who is it for?

UserTypical use
Embedded / systems engineerArithmetic, hex/bin conversions, bit masks
DevOps / SREQuick calculations in scripts and pipelines
Scientist / studentInteractive session with variables and math functions
MATLAB / Octave userFamiliar syntax, no heavy installation

Project structure

CrateRole
crates/ccalcCLI binary: argument parsing, REPL, pipe mode
crates/ccalc-engineLibrary: tokenizer, parser, AST evaluator, variable environment

The engine crate is the computation foundation. It has no I/O dependencies and is the target for all Octave/MATLAB compatibility work (Phases 1–10).

Compatibility standard

Where MATLAB and Octave differ, ccalc follows the modern MATLAB standard (R2016b+). See Architecture → Overview for design principles.

Source