Frink
Encyclopedia
Frink, named after the fictional mad scientist Professor John Frink
Professor Frink
Professor John Nerdelbaum Frink, Jr., or simply Professor Frink, is a recurring character in the animated television series The Simpsons. He is voiced by Hank Azaria, and first appeared in the 1991 episode "Old Money". Frink is Springfield's nerdy scientist and professor and is extremely...

 from The Simpsons
The Simpsons
The Simpsons is an American animated sitcom created by Matt Groening for the Fox Broadcasting Company. The series is a satirical parody of a middle class American lifestyle epitomized by its family of the same name, which consists of Homer, Marge, Bart, Lisa and Maggie...

, is a calculating tool and programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 designed by Alan Eliasen. It is built on the Java Virtual Machine
Java Virtual Machine
A Java virtual machine is a virtual machine capable of executing Java bytecode. It is the code execution component of the Java software platform. Sun Microsystems stated that there are over 4.5 billion JVM-enabled devices.-Overview:...

 and incorporates features similar to Java, Perl, Ruby, Smalltalk, and various BASIC implementations. Its main focus is on the fields of science
Science
Science is a systematic enterprise that builds and organizes knowledge in the form of testable explanations and predictions about the universe...

, engineering
Engineering
Engineering is the discipline, art, skill and profession of acquiring and applying scientific, mathematical, economic, social, and practical knowledge, in order to design and build structures, machines, devices, systems, materials and processes that safely realize improvements to the lives of...

, physics
Physics
Physics is a natural science that involves the study of matter and its motion through spacetime, along with related concepts such as energy and force. More broadly, it is the general analysis of nature, conducted in order to understand how the universe behaves.Physics is one of the oldest academic...

, text processing, and education
Education
Education in its broadest, general sense is the means through which the aims and habits of a group of people lives on from one generation to the next. Generally, it occurs through any experience that has a formative effect on the way one thinks, feels, or acts...

.

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 a length cubed is a volume, or 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[potential_energy -> joules] // Display in joule
Joule
The joule ; symbol J) is a derived unit of energy or work in the International System of Units. It is equal to the energy expended in applying a force of one newton through a distance of one metre , or in passing an electric current of one ampere through a resistance of one ohm for one second...

s, 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
Si
Si, si, or SI may refer to :- Measurement, mathematics and science :* International System of Units , the modern international standard version of the metric system...

 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.

Other features

Frink has arbitrary-size integer
Integer
The integers are formed by the natural numbers together with the negatives of the non-zero natural numbers .They are known as Positive and Negative Integers respectively...

s, arbitrary-size rational number
Rational number
In mathematics, a rational number is any number that can be expressed as the quotient or fraction a/b of two integers, with the denominator b not equal to zero. Since b may be equal to 1, every integer is a rational number...

s, arbitrary-precision floating-point
Floating point
In computing, floating point describes a method of representing real numbers in a way that can support a wide range of values. Numbers are, in general, represented approximately to a fixed number of significant digits and scaled using an exponent. The base for the scaling is normally 2, 10 or 16...

 numbers, complex number
Complex number
A complex number is a number consisting of a real part and an imaginary part. Complex numbers extend the idea of the one-dimensional number line to the two-dimensional complex plane by using the number line for the real part and adding a vertical axis to plot the imaginary part...

s, and interval arithmetic
Interval (mathematics)
In mathematics, a interval is a set of real numbers with the property that any number that lies between two numbers in the set is also included in the set. For example, the set of all numbers satisfying is an interval which contains and , as well as all numbers between them...

. It also has a number of optimized functions for number theory computations.

Frink uses Unicode
Unicode
Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems...

 characters throughout, allowing it to represent most of the world's languages.

On systems with an internet connection, Frink can translate dozens of human languages, including some requiring right-to-left reading, and it can also convert among current currency and precious metal values as well as inflation-adjusted US dollar and British pound values.

Frink has regular expression
Regular expression
In computing, a regular expression provides a concise and flexible means for "matching" strings of text, such as particular characters, words, or patterns of characters. Abbreviations for "regular expression" include "regex" and "regexp"...

s for text processing which are very similar to those in Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

 or Ruby.

Other built-in datatypes include dynamically resizable arrays, dictionaries, sets, enumerating expressions, and anonymous functions. Frink also allows writing of object-oriented
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...

 programs, although inheritance
Inheritance (computer science)
In object-oriented programming , inheritance is a way to reuse code of existing objects, establish a subtype from an existing object, or both, depending upon programming language support...

 is not yet implemented.

Frink is not exactly a dynamically typed nor a statically typed language. By default, any value may be placed into any variable. However, for more safety, arbitrary constraints may be placed on any variable, ensuring that only values meeting the constraints can be assigned to the variable. For example, one can constrain a variable to only contain values that have dimensions of power. Any number of arbitrary constraints may be placed on a variable, including constraints described by user-defined functions. For example, a variable or function argument could be constrained to only contain prime number
Prime number
A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. A natural number greater than 1 that is not a prime number is called a composite number. For example 5 is prime, as only 1 and 5 divide it, whereas 6 is composite, since it has the divisors 2...

s greater than 100.

Frink contains a pattern-matching and tree-rewriting engine that allows transformation of one mathematical expression to another. This allows symbolic manipulation of equations, solving of systems of equations, simplification of algebraic expressions, and symbolic derivatives and integrals with the proper rules defined.

Frink includes concise commands for creating graphical user interfaces as well as animated or static vector and bitmapped graphics, optionally with scaling directives for physically dimensioned drawings.

Date and time values are integrated with the units of measure. Dates and times can be specified and used in calculations in a wide variety of formats. A date/time represents a particular moment in time, and can be converted to different timezones, Julian day
Julian day
Julian day is used in the Julian date system of time measurement for scientific use by the astronomy community, presenting the interval of time in days and fractions of a day since January 1, 4713 BC Greenwich noon...

, Modified Julian day, Dynamical Time, and many other systems of time. Frink keeps track of the quirks of these different systems, even down to leap seconds.

Frink can call Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

 methods and automatically convert its internal types to and from Java types, allowing use of external Java libraries. Frink can also be embedded in a Java program with only a few lines of code.

Frink Server Pages uses Frink as a language for creating dynamic web-based resources, similar to PHP
PHP
PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...

 or Active Server Pages.

Host platforms

It is implemented in Java and will run on Java Virtual Machine version 1.1 and later, or on Android 1.5 and later. (This includes nearly all personal computers and operating systems as well as many cellphones and hand-held devices.) Supported platforms include PersonalJava 1.1 implementations that include implementations of the optional java.math libraries. It includes a text-mode interface as well as three different graphical interfaces using the Java AWT, Swing, and Android libraries.

The interpreter is freeware
Freeware
Freeware is computer software that is available for use at no cost or for an optional fee, but usually with one or more restricted usage rights. Freeware is in contrast to commercial software, which is typically sold for profit, but might be distributed for a business or commercial purpose in the...

, but proprietary
Proprietary software
Proprietary software is computer software licensed under exclusive legal right of the copyright holder. The licensee is given the right to use the software under certain conditions, while restricted from other uses, such as modification, further distribution, or reverse engineering.Complementary...

: its source code is not available. It generally installs with one or two clicks on any machine with a recent version of Java, or it can be used via the web-based interface.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK