Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
ML
Edit
PageHistory
Diff
Info
LikePages
__ML__ is a family of StaticallyTyped functional ProgrammingLanguage~s with StrictEvaluation, PolymorphicTypes, HigherOrderFunctions, a higher-order module system. [ML] can be used interactively for learning, experimentation and testing, or it can be compiled. The two major dialects of [ML] are [OCaml] and [SML]. [SML] is a standardised language with several implementations. [OCaml] has a single OpenSource implementation, it extends [ML] with an [OOP] system. Both major dialects have compilers that produce native code that rival the speed of [C++], and extensive standard and third-party libraries. [Why YOU want to program in ML | http://www.schizomaniac.net/ml.html] gives you a tour of the features of [ML] that make it a good general-purpose programming language. It talks about [SML], but what it says applies to [OCaml] as well. !!!An example of [ML] code: <pre> __fun__ interpret_functionally (program : opcode list) : unit = (* Interprets a parsed [Brainf*ck] program using integers on a strip of TuringMachine tape as the memory. *) __let__ __val__ fresh_tape = Tape.make(0) __fun__ step (tape, op) = __let__ byte = Tape.read(tape) __in__ __case__ op __of__ Inc_ptr n => times(n, Tape.forward, tape) | Dec_ptr n => times(n, Tape.back, tape) | Inc_byte n => Tape.write(byte + n, tape) | Dec_byte n => Tape.write(byte - n, tape) | Putchar => ( putchar(byte) ; tape ) | Getchar => Tape.write(getchar(), tape) | Loop body => __if__ byte = 0 __then__ tape __else__ step (step_sequence (tape, body), op) __end__ __fun__ step_sequence (tape, oplist) = List.foldl(step, tape, oplist) __in__ ignore (step_sequence(fresh_tape, program)) __end__ </pre> (This is in [SML].) ---- CategoryProgrammingLanguages, CategoryFunctionalProgrammingLanguages
8 pages link to
ML
:
OCaml
PolymorphicTypes
SML
APL
HigherOrderFunctions
StaticallyTyped
StrictEvaluation
GarbageCollection