1 / 12

ML: the metalanguage

ML: the metalanguage. Drew Wyborski Programming Languages. Introduction. Originally conceived to develop proof tactics Automatically infers types Focus on developing programs through a logical approach Used as the basis for several other languages and dialects. Functional Programming.

Télécharger la présentation

ML: the metalanguage

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ML: the metalanguage Drew Wyborski Programming Languages

  2. Introduction • Originally conceived to develop proof tactics • Automatically infers types • Focus on developing programs through a logical approach • Used as the basis for several other languages and dialects

  3. Functional Programming • Logical analysis is simple and easy • No reassignment or modification of types • Can prove assertions about a program with ease • Difficult to write programs that are illogical • Lend themselves well of parallel execution • Still retain all the useful components of a traditional language

  4. Functional vs. Imperative • Development Cycle • Development Language • Run-time System • FORTRAN, Pascal, C • ML, Hope, Lisp

  5. Language Overview • Call-by-value evaluation strategy • Automatic memory allocation through garbage collection • Parametric polymorphism • Static typing • Exception handling • Pattern matching

  6. Development and Creation • Developed by Robin Milner in 1973 at Edinburgh University • The goal behind ML • The perfect language

  7. Standard ML • Standard ML ’90 & Standard ML ‘97 • Changes from original Edinburgh ML • Standard ML-New Jersey • Other popular versions • Moscow ML • ML Kit • MLton • PolyML

  8. Characteristics • Safety through the type-checker • Structures and signatures • Flexibility of functions • Call-by-value evaluation • Polymorphism • Compile-time type checking • Type inference

  9. Characteristics • Garbage collection • Exemption handling • Immutable data types • Updating references • Abstraction • Parametric modules • Formal definition • Proof of completeness

  10. Data Type/Operators • Operators and types similar to C++/Java • int, string, bool and real remain the same • Operators have slight differences • Additional Boolean types are included showing the rational/logical basis • andalso & orelse

  11. Syntax • Input is placed into user’s implementation • Machine responds with result of expression • Specified layout for entry and output • 3 + 4; • val it = 7 : int • If an error is made in entry, the machine responds with an appropriate error • The unit data type

  12. Definitions • Global constants • val PI = 3.4; • Help increase readability • Functions • fun succ n = n+1; • val succ = fn : int  int • Extensions • if…then…else functions • Multiple input/output functions

More Related