BookRags.com Literature Guides Literature Guides Criticism/Essays Criticism/Essays Biographies Biographies My Bibliography Periodic Table U.S. Presidents Shakespeare Sonnet Shake-Up
Research Anything:        
History | Encyclopedias | Films | News | Create a Bibliography | More... Login | Register | Help

Search "Ml"

Contents Navigation
 

Ml

Print-Friendly  Order the PDF version  Order the RTF version
About 2 pages (718 words)

Bookmark and Share

Ml

ML, or Meta-Language, is a family of programming languages that are functional in nature. Functional programming is a programming style that is based on the evaluation of expressions rather than execution of commands. Functional programming is concerned with what needs to be done instead of how it is to be accomplished.

History

ML was first designed and implemented in the 1970s at the University of Edinburgh's Laboratory for Foundations of Computer Science. As the ML developed further in the 1980s, a common dialect and a base set of features was standardized. In 1990 the Standard ML (SML) was released. In 1997 the standard was revised as SML'97. SML is the most common implementation of ML.

In addition to SML, the ML family of languages includes Standard ML of New Jersey (SML/NJ), Extended ML (EML), Moscow ML, CAML, and others. ML is portable, and it has been implemented on a variety of platforms, including PCs, workstations, mainframes, and supercomputers. Most ML implementations provide an interactive system for writing programs, compiling and linking programs, and executing the programs. Some implementations also provide extensive libraries as well as sophisticated development tools.

The SML Implementation

SML was developed by the research community and is most widely used in academic settings. It is particularly useful in metaprogramming, or writing programs that manipulate other programs. In this context SML is used in compilers and interpreters. SML imposes strict semantics, hierarchical structure, and a modular manner of programming. These help enforce abstraction of reusable components.

In a pure functional language, all computation is done via functions. Programmers declare functions and references to values. Function calls are nested inside each other to build up complex expressions. SML encourages functional programming where appropriate, but it allows imperative programming if necessary. Because it does not meet all the requirements of a pure functional language, SML is considered an extended functional language.

Some of the defining characteristics of SML include the use of type inference, type checking, polymorphism, and pattern matching. Type inference means that many variable types do not have to be specified programmatically; instead SML can interpret basic types and also offers a mechanism for a programmer to extend variable types as needed. ML uses the context of an expression to determine the types of the operands. Using this mechanism it can infer the types of the arguments and the type of the return result. The basic SML types include integer, real, string, character, and Boolean.

SML also does type checking, meaning that the type is verified before an expression is evaluated. A type constructor mismatch error occurs when operators are paired with arguments of the incorrect type. The benefits of type checking include reduced debugging, as mistakes can be caught earlier in the development process, and faster execution.

SML supports polymorphism of data types and functions. A declaration of data type list could be used to represent lists of strings, integers, or characters. Similarly, a declaration of function order_list could be used to order lists of strings, integers, or characters. Polymorphism supports reuse since the same data type or function can be extended for multiple uses.

Pattern matching simplifies the definition of functions in SML. Pattern matching allows functions to be defined in a case format, which uses a format of clauses to indicate possible structures. When evaluating the expression, each clause is tried in the order of presentation. The first successful match is taken if more than one matches.

Additional features of SML include an error and exception handling mechanism and a portable standard basis library that defines a rich collection of common types and routines. This library contains functions for data manipulation, string handling, and interfacing with the operating system.

SML can be used interactively from the command line or in a program that has been written and saved to a file. When SML commands are entered, the interpreter knows to begin evaluating the expressions when it sees a semicolon. The interpreter returns the value of the result.

Other Implementations of ML

There are two other implementations of ML that are similar to SML. Moscow ML is a lightweight implementation of SML, meaning that it contains some of the features of SML but is less complex. EML is an extension of SML; it has most of the characteristics of SML plus some additional features. In practice both Moscow ML and EML programs look very similar to SML programs.

This is the complete article, containing 718 words (approx. 2 pages at 300 words per page).

 
Copyrights
Ml from World of Computer Science. ©2005-2006 Thomson Gale, a part of the Thomson Corporation. All rights reserved.

Join BookRagslearn moreJoin BookRags




About BookRags | Customer Service | Report an Error | Terms of Use | Privacy Policy