1 / 9

OCaml

OCaml. What is OCaml ?. OCaml : Objective Caml Caml : Categorical Abstract Macine Language on CAM ML: meta-language Derived Languages: F#( ms ), SML, MetaOCaml , AtomCaml. OCaml Simple Examples. print_endline "Hello World!". OCaml Imperative. let rec gcd a b =

mercury
Download Presentation

OCaml

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. OCaml

  2. What is OCaml? OCaml: Objective Caml Caml : Categorical Abstract Macine Language on CAM ML: meta-language Derived Languages: F#(ms), SML, MetaOCaml, AtomCaml

  3. OCaml Simple Examples print_endline"Hello World!" OCaml Imperative let rec gcd a b = if a=0 then b else if a>b then gcd b a else gcd (b mod a) a Python defgcd(a,b): if a == 0: return b if a > b: return gcd(b,a) return gcd(b % a, a) OCaml functional let rec gcd a b = match a with 0 -> b | x when x > b -> gcd b a | _ -> gcd (b mod a) a

  4. OCaml • Inventors: Xavier Leroy, JérômeVouillon, Damien Doligez, Didier Rémy and others • Maintainer: INRIA (法国国立计算机及自动化研究院) • Type: Static, Strong, Inferred • Paradigm: imperative, functional, object-oriented • OCaml is not a pure functional language • OCaml does have for and while loops, but I won’t show them here

  5. Features, Supports & Libraries? The goal of the OCaml-Java project is to…Objective Camlis an excellent language but it sometimes lacks the library for a given task. On the other hand, Java is a weaker language but benefits from a tremendous community, and this manpower is able to deliver libraries for almost any task… • Interpreter & Compiler • Camlp4: parser. Extend Ocaml • ocamllex, ocamlyacc • debugger • doc generator • profiler

  6. Multithread • OCamlbytecode and native code programs can be written in a multithreaded style, with preemptive context switching. However, because the garbage collector of the INRIA OCaml system (which is the only currently available full implementation of the language) is not designed for concurrency, symmetric multiprocessing is not supported.OCamlthreads in the same process execute by time sharing only. There are however several libraries for distributed computing such as Functory and ocamlnet/Plasma (blog).

  7. Who use Ocaml? • Unikernels: Library Operating Systems for the Cloud (ASPLOS 2013)

  8. Thanks!

More Related