Frink

Frink is a calculating tool and programming language designed by Alan Eliasen. It is built on the Java Virtual Machine and incorporates features similar to Java, Perl, Ruby, Smalltalk, and various BASIC implementations. Its main focus is on the fields of science, engineering, physics, text processing, and education. Frink is named after the fictional mad scientist Professor John Frink from The Simpsons.

One of the distinguishing characteristics of Frink is that it tracks units of measure through all calculations. This allows all values to contain a quantity and its units of measure. Frink understands how different units of measure interrelate, such as how length cubed is volume, and power multiplied by time is energy. Different units of measure can be mixed in calculations, and Frink automatically ensures that the calculations lead to a result with the expected dimensions.

height = 10 feet gravitation = 9.80665 m/s^2 mass = 180 pounds potential_energy = height * gravitation * mass println // Display in joules, number displayed without units

Since gravitation is given as a floating-point value, the answer is also floating point.

2440.47230699652072

The statement above could be rewritten many ways - using different abbreviations and different target units, for instance:

3 meters 1 gravity 180 lbs -> "Calories" //Capital-C Calories = kilocalories //Quotes around target unit cause answer to be displayed with units.

Here the built-in unit "gravity" is used, which is specified in Frink's units file as a rational number. Since all the inputs are rational or integer the result is:

26689329691563/46520000000000 (approx. 0.5737173192511393) Calories

Note that different systems of measurements can be effortlessly mixed (for example, pounds, meters, and feet.) When used interactively as a desk calculator println and named variables are not required.

The standard distribution comes with a data file which contains hundreds of the most common (and uncommon) units of measure, along with data such as masses of elementary particles, planetary data, and historical units of measure. The standard data file uses the SI base units as its fundamental units of measure, and extends this with units for currency and information (bits). The standard data file can be completely replaced by the user, and new units and even fundamental dimensions may be added at runtime. Any unit or product of units in the file can be converted easily into any other unit which measures the same sort of quantity.

Read more about Frink:  Other Features, Host Platforms