Est. 2001 Intermediate

Frink

A practical calculating language that tracks units of measure through every operation, combining arbitrary-precision arithmetic with a built-in physical and currency database.

Created by Alan Eliasen

Paradigm Multi-paradigm: Procedural, Object-Oriented, Functional
Typing Dynamic, Strong (with first-class units of measure)
First Appeared 2001
Latest Version Rolling release (updated frequently)

Frink is a practical calculating tool and general-purpose programming language designed around a single, unusual idea: every numeric quantity carries its units of measure, and those units are tracked, checked, and converted through every operation. Created by Alan Eliasen and first released in December 2001, Frink sits at the intersection of a scientific calculator, an arbitrary-precision arithmetic system, and a scripting language — letting users write expressions like 55 miles/hour -> meters/second and have them just work, while also offering full programming constructs for non-trivial computations.

History & Origins

Frink was created by Alan Eliasen, an independent software developer, who began work on the language in December 2001. Eliasen built Frink on top of the Java Virtual Machine, a choice that gave the language immediate access to Java’s BigInteger and BigDecimal types — the foundation of Frink’s arbitrary-precision arithmetic — along with portability across the many platforms that supported a Java 1.1 or later runtime at the time.

The language is named, with characteristic humor, after Professor John Frink, the fictional, hyper-articulate mad scientist from The Simpsons. The name reflects both Eliasen’s affection for the character and the language’s positioning as a tool for the kind of physical-world calculation Professor Frink might attempt.

Frink was publicly introduced to the broader language community in 2004 at the Lightweight Languages 4 (LL4) workshop at MIT, where Eliasen presented the design and demonstrated the language’s units-tracking model. The LL series — focused on small, expressive languages — was a natural venue for Frink, which built much of its appeal around a single, sharply chosen design decision.

The Verizon Math Incident

In 2006, Frink received an unusual boost in public visibility through what became known as the “Verizon math” story. A Verizon Wireless customer recorded a customer service call in which representatives repeatedly confused $0.002 per kilobyte with 0.002 cents per kilobyte — a thousand-fold pricing error. Eliasen used Frink to demonstrate, in a few lines, that the dimensional analysis made the mistake unambiguous: $0.002/kilobyte and 0.002 cents/kilobyte are not interchangeable units, and Frink’s unit tracking turns what was an argument over arithmetic into a mechanical check. The episode became a small case study in why explicit units matter, and helped publicize Frink beyond its initial niche.

Design Philosophy

Frink’s design rests on a few mutually reinforcing convictions:

Units are part of numbers, not metadata about them. In most languages, a “5 meters” value is either a bare number with a comment, or a wrapped object that the programmer has to remember to use. In Frink, units are intrinsic to numeric values, and operations that combine quantities check dimensional consistency automatically. 5 meters + 2 feet is a valid expression and yields a length; 5 meters + 2 kilograms is an error.

Precision should be the default. Numbers in Frink default to exact representations — integers are arbitrary-precision, fractions are kept as rationals where possible, and arithmetic does not silently lose accuracy. Floating-point is available, but is opt-in rather than default. This is a deliberate inversion of most languages, where 1/3 returns 0.3333… and accumulating error is the user’s problem.

Friendly syntax for casual use. Frink expressions are designed to be writable interactively, with minimal ceremony. The conversion operator -> reads naturally (30 mph -> km/h), units may be written in any order, and the parser tolerates many natural-language conventions for compound units.

A real programming language underneath. Although Frink is excellent as a calculator, it is also a full language with functions, control flow, arrays, dictionaries, regular expressions, object-oriented features, graphics, and access to the underlying Java library. A short interactive expression and a multi-page program use the same evaluation model.

Key Features

Units of Measure

The defining feature of Frink is its built-in handling of units. A simple example:

// Convert 60 miles per hour to meters per second
60 miles/hour -> m/s

// Calculate kinetic energy of a 2000 kg car at 30 m/s
0.5 * 2000 kg * (30 m/s)^2 -> joules

Frink ships with a large, editable units database covering SI base and derived units, customary US units, imperial units, astronomical units, atomic and nuclear units, historical units, currencies, and many more. Users can define their own units freely.

Dimensional analysis is enforced: an expression like 5 meters + 3 seconds raises an error because length and time are incompatible dimensions. This eliminates a class of mistakes that, in conventional languages, can quietly produce wrong results — including spectacular failures such as the loss of the NASA Mars Climate Orbiter in 1999, often cited by Eliasen as a motivating example for units-aware computation.

Arbitrary-Precision and Rational Arithmetic

Numbers in Frink are exact by default. Integer arithmetic uses Java’s BigInteger under the hood, so 2^1000 returns the full 302-digit answer rather than overflowing or producing a floating-point approximation. Rational arithmetic preserves fractions:

1/3 + 1/6   // returns 1/2, exactly

Floating-point evaluation is available when desired — for example, by including an explicit decimal point in a literal — and complex numbers are first-class. Frink also supports interval arithmetic, where a quantity is represented as a range with rigorous error bounds, useful in scientific calculations where uncertainty must be propagated through expressions.

Programming Constructs

Beyond expressions, Frink is a complete programming language. It includes:

  • Functions, including anonymous functions and higher-order functions
  • Control structures (if, while, for, do…while)
  • Arrays, dictionaries (hash tables), and sets
  • String manipulation with full Unicode support
  • Regular expressions
  • Object-oriented features with classes and methods
  • Date and time arithmetic, including timezone-aware operations
  • File and network I/O
  • Graphics with transparency and anti-aliasing
  • Direct access to the underlying Java class library

This means a Frink program can do anything a Java program can — but with units, exact arithmetic, and a more compact syntax.

Currency, Time, and Real-World Data

Frink integrates real-world reference data into the language. Currencies are treated as units and can be converted using current exchange rates fetched at runtime. Date arithmetic, timezones, and astronomical quantities are all directly expressible. Calculations such as “what is the speed of a point on the equator due to Earth’s rotation, in furlongs per fortnight?” are one-liners, and the answer is correct and unit-checked.

Distribution and Platforms

Frink is implemented in Java and is therefore available on essentially any system with a sufficiently recent Java runtime. Official documentation describes builds and usage on:

  • Windows, macOS, and Linux desktops
  • Android (distributed both directly from frinklang.org and through app stores)
  • Web-based interactive interfaces

Historical documentation also references support for older J2ME-class mobile devices — including certain Sony Ericsson handsets and Nokia Communicator models — though these are now of historical interest only.

Frink follows a rolling release model: the language is updated frequently, with the latest build available directly from frinklang.org. There is no official Docker Hub image, and the recommended way to obtain Frink remains a direct download of the JAR file.

Current Relevance

More than two decades after its initial release, Frink remains actively maintained by Alan Eliasen and continues to receive regular updates documented on frinklang.org. Its community is small but engaged: contributors maintain solutions on Rosetta Code, share calculations and idioms on programming forums, and use the language as a portable scientific calculator in fields ranging from physics teaching to amateur radio.

Frink’s specific design — exact arithmetic plus tracked units plus a real programming language — has not been seriously displaced by any mainstream successor. Python, Mathematica, and Julia all have units libraries (pint, Unitful.jl, and the Quantity features built into Mathematica), but each of these treats units as an add-on layered over a numeric system that does not natively understand them. Frink’s design choice to put units into the core of the language remains distinctive, and is one of the reasons the language is still used and discussed.

Why It Matters

Frink is a small language with an outsized intellectual payoff. It demonstrates that a single, sharply chosen design idea — first-class units of measure — can change the shape of an entire programming model. Calculations that are tedious and error-prone in conventional languages become natural in Frink, and a class of bugs that has caused real engineering failures simply cannot occur.

It also serves as a working argument for the broader principle that the type system should know what the numbers mean. The same idea reappears in dependent type systems, in the F# units-of-measure feature, and in libraries like Unitful.jl and pint. Frink got there first as a complete language, and continues to be one of the cleanest demonstrations of the idea in practice.

For a programmer who has only ever seen units as comments, a few hours with Frink can be quietly perspective-changing — which is exactly the role a small, opinionated language is supposed to play in the broader ecosystem.

Timeline

2001
Alan Eliasen begins work on Frink in December 2001, building the language on top of the Java Virtual Machine to leverage Java's arbitrary-precision numeric types
2004
Eliasen presents Frink at the Lightweight Languages 4 (LL4) workshop at MIT, introducing the language and its units-aware design to the broader programming language community
2006
Frink gains public attention after Eliasen uses it to verify a widely circulated phone call recording in which a Verizon customer service representative confuses dollars with cents — Frink's unit handling makes the dimensional error obvious
2010s
Frink builds support for handheld and mobile platforms, with Android becoming a primary distribution target alongside the desktop JVM build, and the app eventually becomes available on the Amazon Appstore
2020s
Eliasen continues a rapid, rolling release cadence with frequent updates documented on frinklang.org, expanding the units database, currency feeds, and date/time handling

Notable Uses & Legacy

Scientific and Engineering Calculation

Engineers, physicists, and chemists use Frink as a units-aware calculator that prevents dimensional errors — adding a length to a mass produces an error, not a silent nonsense result.

Rosetta Code

Frink has an active presence on Rosetta Code, where its solutions to standard problems frequently showcase concise unit-aware arithmetic and arbitrary-precision math compared to general-purpose languages.

Education

The language is used in physics, chemistry, and engineering education as a tool that makes dimensional analysis explicit, helping students reason about the units that accompany numerical quantities.

Currency and Financial Conversions

Frink ships with currency exchange rate handling and historical price data, making it useful for ad-hoc financial calculations where unit-of-currency tracking matters as much as numeric precision.

Android Field Calculations

Distributed as an Android app, Frink is reportedly used as a portable scientific calculator that can mix everyday units (cups, gallons, miles, kilograms) with scientific units in a single expression.

Language Influence

Influenced By

Running Today

Run examples using the official Docker image:

docker pull
Last updated: