|
ML is a general-purpose functional programming language developed by Robin Milner and others in the late 1970s at the University of Edinburgh, whose syntax is inspired by ISWIM. Historically, ML stands for metalanguage as it was conceived to develop proof tactics in the LCF theorem prover (the language of which ML was the metalanguage is pplambda, a combination of the first-order predicate calculus and the simply-typed polymorphic lambda-calculus). It is known for its use of the Hindley-Milner type inference algorithm, which can infer the types of most values without requiring the extensive annotation often criticised in languages such as Java. A programming paradigm is a paradigmatic style of programming (compare with a methodology, which is a paradigmatic style of doing software engineering). ...
A multiparadigm programming language is a programming language that supports more than one programming paradigm. ...
In computer science, imperative programming, as opposed to declarative programming, is a programming paradigm that describes computation in terms of a program state and statements that change the program state. ...
Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and avoids state and mutable data. ...
1973 (MCMLXXIII) was a common year starting on Monday. ...
Robin Milner is a prominent British computer scientist. ...
The University of Edinburgh, founded in 1582,[4] is a renowned centre for teaching and research in Edinburgh, Scotland. ...
In computer science, a type system defines how a programming language classifies values and expressions into types, how it can manipulate those types and how they interact. ...
On computer science, a datatype (often simply type) is a name or label for a set of values and some operations which can be performed on that set of values. ...
In computing, strongly-typed, when applied to a programming language, is used to describe how the language handles datatypes. ...
A dialect of a programming language is a (relatively small) variation or extension of the language that does not change its intrinsic nature. ...
Standard ML (SML) is a general-purpose, modular, functional programming language with compile-time type checking and type inference. ...
Objective Caml (OCaml) is a general-purpose programming language descended from the ML family, created by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy and others in 1996. ...
F# (pronounced F sharp) is a mixed functional and object oriented programming language for the Microsoft . ...
ISWIM is a programming language devised by Peter J. Landin and first described in his article, The next 700 programming languages, published in the CACM in 1966. ...
Miranda is a non-strict purely functional programming language developed by Professor David Turner as a successor to his earlier programming languages Sasl and KRC, using some concepts from ML and Hope. ...
Haskell is a standardized pure functional programming language with non-strict semantics, named after the logician Haskell Curry. ...
The Cyclone programming language is intended to be a safe dialect of the C programming language. ...
Nemerle logo Nemerle is a high-level statically-typed programming language for the . ...
Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions. ...
Robin Milner is a prominent British computer scientist. ...
The University of Edinburgh, founded in 1582,[4] is a renowned centre for teaching and research in Edinburgh, Scotland. ...
ISWIM is a programming language devised by Peter J. Landin and first described in his article, The next 700 programming languages, published in the CACM in 1966. ...
An interactive theorem prover developed at the universities of Edinburgh and Stanford by Robin Milner and others. ...
First-order predicate calculus or first-order logic (FOL) permits the formulation of quantified statements such as there exists an x such that. ...
In computer science, polymorphism means allowing a single definition to be used with different types of data (specifically, different classes of objects). ...
In mathematical logic and computer science, lambda calculus, also λ-calculus, is a formal system designed to investigate function definition, function application, and recursion. ...
Type inference is a feature predominant in functional programming languages such as Haskell and ML or OCaml. ...
Java is an object-oriented programming language developed by Sun Microsystems in the early 1990s. ...
Overview
ML is often referred to as an impure functional language, because it permits side-effects, and therefore imperative programming, unlike purely functional programming languages such as Haskell. In computer science, a side-effect is a property of a programming language function that it modifies some state other than its return value. ...
In computer science, imperative programming, as opposed to declarative programming, is a programming paradigm that describes computation in terms of a program state and statements that change the program state. ...
Purely functional is a term in computing used to describe algorithms, data structures or programming languages that exclude destructive modifications (updates). ...
Haskell is a standardized pure functional programming language with non-strict semantics, named after the logician Haskell Curry. ...
Features of ML include a call-by-value evaluation strategy, first class functions, automatic memory management through garbage collection, parametric polymorphism, static typing, type inference, algebraic data types, pattern matching, and exception handling. An evaluation strategy (or reduction strategy) for a programming language is a set of (usually deterministic) rules for defining the evaluation of expressions under β-reduction. ...
In computer science, a subroutine (function, procedure, or subprogram) is a sequence of code which performs a specific task, as part of a larger program, and is grouped as one, or more, statement blocks; such code is sometimes collected into software libraries. ...
In computer science, garbage collection (also known as GC) is a form of automatic memory management. ...
In computer science, polymorphism means allowing a single definition to be used with different types of data (specifically, different classes of objects). ...
In computer science, a datatype or data type (often simply a type) is a name or label for a set of values and some operations which one can perform on that set of values. ...
Type inference is a feature present in some strongly statically typed programming languages. ...
In functional programming, new types can be defined, each of which has one or more constructors. ...
Pattern matching is the act of checking for the presence of the constituents of a given pattern. ...
Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of some condition that changes the normal flow of execution. ...
Unlike Haskell, ML uses eager evaluation, which means that all subexpressions are always evaluated. One result of this is that you cannot use infinite lists per se. However, lazy evaluation and hence infinite lists can be simulated, through use of anonymous functions. Eager evaluation is the evaluation model in most traditional programming languages. ...
Today there are several languages in the ML family; the two major dialects are Standard ML and Caml, but others exist, including F# - an open research project that targets the Microsoft .NET platform. Ideas from ML have influenced numerous other languages, such as Haskell, Cyclone, and Nemerle. Standard ML (SML) is a general-purpose, modular, functional programming language with compile-time type checking and type inference. ...
Objective Caml (OCaml) is a general-purpose programming language descended from the ML family, created by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy and others in 1996. ...
F# (pronounced F sharp) is a mixed functional and object oriented programming language for the Microsoft . ...
Haskell is a standardized pure functional programming language with non-strict semantics, named after the logician Haskell Curry. ...
The Cyclone programming language is intended to be a safe dialect of the C programming language. ...
Nemerle logo Nemerle is a high-level statically-typed programming language for the . ...
ML's strengths are mostly applied in language design and manipulation (compilers, analyzers, theorem provers), but it is a general-purpose language also used in bioinformatics, financial systems, and applications including a genealogical database, a peer-to-peer client/server program, etc.
Examples of ML Anatomy of an ML function The "Hello World" of functional languages is the factorial function. Expressed as pure ML: A hello world program is a software program that prints out Hello world! on a display device. ...
The beginning of the sequence of factorials (sequence A000142 in OEIS) In mathematics, the factorial of a number n is the product of all positive integers less than or equal to n. ...
fun fac (0 : int) : int = 1 | fac (n : int) : int = n * fac (n-1) This describes the factorial as a recursive function, with a single terminating base case. It is similar to the descriptions of factorials found in mathematics textbooks. Much of ML code is similar to mathematics in facility and syntax. Part of the definition shown is optional, and describes the types of this function. The notation E : t can be read as expression E has type t. For instance, the argument n is assigned type integer (int), and the result of applying fac to n (fac (n)) also has type integer. The function fac as a whole then has type function from integer to integer (int -> int). Thanks to type inference, the type annotations can be omitted and will be derived by the compiler. Rewritten without the type annotations, the example looks like: Type inference is a feature present in some strongly statically typed programming languages. ...
fun fac 0 = 1 | fac n = n * fac(n-1) The function also relies on pattern matching, an important part of ML programming. Note that parameters of a function are not necessarily in parentheses but separated by spaces. When the function's argument is 0 (zero) it will return the integer 1 (one). For all other cases the second line is tried. This is the recursion, and executes the function again until the base case is reached. Pattern matching is the act of checking for the presence of the constituents of a given pattern. ...
See also Recursion. ...
See also - OCaml, a dialect of ML with support for object-oriented programming
- Standard ML, a dialect of ML with a formal semantics
Objective Caml (OCaml) is a general-purpose programming language descended from the ML family, created by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy and others in 1996. ...
Standard ML (SML) is a general-purpose, modular, functional programming language with compile-time type checking and type inference. ...
External links |