Frink

Frink

Infobox programming language
name = Frink

paradigm = procedural
year =
designer = Alan Eliasen
developer =
latest release version =
latest release date =
typing = dynamic typing, strong typing
implementations = Frink
dialects =
influenced_by = Java, Perl, Ruby, Smalltalk, BASIC
influenced =

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.

The language is named after the fictional mad scientist Professor John Frink from the popular animated television series "The Simpsons", who predicted, decades ago, "I predict that within 100 years, computers will be twice as powerful, ten thousand times larger, and so expensive that only the five richest kings of Europe will own them."

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 = 3 feet gravitation = 9.80665 m/s^2 mass = 60 kg potential_energy = height * gravitation * mass println [potential_energy -> joules] // Display in joules

The standard distribution comes with a data file which contains thousands of the most common units of measure, along with common data such as masses of elementary particles, planetary data, and historical measures. 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.

The syntax of Frink tries to follow standard mathematical notation when unambiguous. For example, the statement above could be rewritten using implicit multiplication between the three units:

height gravitation mass

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:

var p is power = 10 watts

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 numbers greater than 100.

Frink has arbitrary-size integers, arbitrary-size rational numbers, arbitrary-precision floating-point numbers, complex numbers, and interval arithmetic.

Date/Time values are integrated with the units of measure. Date/time literals are surrounded by the pound sign # and can be parsed in a wide variety of formats. A date/time represents a particular moment in time, and can be converted to different timezones, Julian day, Modified Julian day, Dynamical Time, and other systems of time. A value with dimensions of time can be added to or subtracted from a date/time to obtain a new date time. In addition, a date/time value may be subtracted from another date/time value to obtain the interval between the dates.

The following program demonstrates date handling. It calculates the date/time that a computer's clock will fail if times are represented as a signed 32-bit two's complement integer, indicating the seconds from the Unix epoch.

#1970-01-01 00:00 UTC# + (2^31-1) seconds -> UTC AD 2038-01-19 03:14:07.000 AM (Tue) Coordinated Universal Time

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

Frink has regular expressions for text processing which are very similar to those in Perl or Ruby.

Other built-in datatypes include dynamically resizable arrays, dictionaries, sets, enumerating expressions, and anonymous functions. Frink also allows writing of object-oriented programs, although inheritance is not yet implemented.

Frink can call Java 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 or Active Server Pages.

It is implemented in Java and will run on a Java Virtual Machine version 1.1 and later. This includes PersonalJava 1.1 implementations that include implementations of the optional java.math libraries. It includes a text-mode interface as well as two different graphical interfaces using the Java AWT and Swing libraries respectively.

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

The interpreter is freeware, but its source code is not available.

External links

* [http://futureboy.homeip.net/frinkdocs/ Frink] homepage, including full documentation.
* [http://futureboy.us/frink/ Frink web-based interface]
* [http://futureboy.us/frinkdocs/faq.html Frequently Asked Questions]
* [http://futureboy.us/frinkdocs/fspdocs.html Frink Server Pages Documentation]
* [http://futureboy.us/fsp/samples.fsp Sample Programs]


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Frink — Apparu en 2001 Auteur Alan Eliasen Influencé par Java, Perl, Ruby, Smalltalk, BASIC …   Wikipédia en Français

  • Frink (disambiguation) — Frink may refer to:People*Elisabeth Frink, an English sculptor and printmaker *John Frink, an American writer *Professor Frink, a fictional character in The Simpsons *Stephen Frink, an underwater photographerOther*Frink, a calculating tool and… …   Wikipedia

  • Frink, Florida — Frink is an unincorporated community in Calhoun County, Florida, United States. It is located on State Road 73. GeographyFrink is located at coor dms|30|22|06|N|85|12|51|W (30.3683, 85.2142).GR|1 ReferencesExternal links …   Wikipedia

  • Frink Park (Seattle) — [ 1911] Frink Park is a 17.2 acre (70,000 m²) park in the Leschi neighborhood of Seattle, Washington. It is a heavily wooded hillside and ravine through which flows Frink Creek. Most of the park is bounded by 31st Avenue S. in the west, 34th… …   Wikipedia

  • Frink, Elisabeth —    b. 1930, Thurlow, Sussex; d. 1993, Woolland, Dorset    Sculptor    Born of widely travelled parents with Dutch and French forebearers, the sculptor Elisabeth Frink spent her childhood in England. After training at Guildford and Chelsea, she… …   Encyclopedia of contemporary British culture

  • Frink School — The Frink School of Figurative Sculpture was named after Elisabeth Frink, British Sculptor, and was a small intimate academy with a specific discipline of study closer in spirit to a master and apprentice structure than an educational institution …   Wikipedia

  • Frink, Dame Elisabeth Jean — ▪ 1994       British sculptor (b. Nov. 14, 1930, Thurlow, Suffolk, England d. April 18, 1993, Woolland, Dorset, England), was best known for her monumental figurative bronzes. Frink brought a sense of passion and energy to her naturalistic horses …   Universalium

  • Frink Medal — The Frink Medal for British Zoologists is awarded by the Zoological Society of London For significant and original contributions by a professional zoologist to the development of zoology in the wider applications. Recipients Frink Medal… …   Wikipedia

  • Frink\ Factor — How many Professor Frink appearances orquotes there are in a Simpsons episode, if any. Did you see that new Simpsons episode last night? The Frink Factor was extremely high …   Dictionary of american slang

  • Frink\ Factor — How many Professor Frink appearances orquotes there are in a Simpsons episode, if any. Did you see that new Simpsons episode last night? The Frink Factor was extremely high …   Dictionary of american slang

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”