fast functional flexible programming with ocaml
play

Fast, Functional, Flexible Programming with OCaml Gemma Gordon - PowerPoint PPT Presentation

Fast, Functional, Flexible Programming with OCaml Gemma Gordon (speaker) , Anil Madhavapeddy (speaker), with contributions from the OCaml Labs team of David Allsopp, Stephen Dolan, Jeremy Yallop, Thomas Gazagnaire, and KC Sivaramakrishnan


  1. Fast, Functional, Flexible Programming with OCaml Gemma Gordon (speaker) , 
 Anil Madhavapeddy (speaker), with contributions from the OCaml Labs team of David Allsopp, Stephen Dolan, Jeremy Yallop, Thomas Gazagnaire, and KC Sivaramakrishnan QCon London March 2018

  2. "Old Languages Made New" • Why ML is important among programming languages • What uses have driven the recent resurgence ? • What we are doing to grow the community ! • A look forward to the exciting developments coming.

  3. A Brief Intro to ML

  4. Background OCaml is a industrial grade, mixed-style functional and imperative language. From the ML heritage of programming languages (Milner, Stanford/Edinburgh/Cambridge) Originally the metalanguage for LCF , a theorem prover developed in the 1980s. Caml: 1987 , Caml Light: 1990 , OCaml: 1997 https://dev.realworldocaml.org/00-prologue.html

  5. OCaml: a quick primer let x = 1 let y = "world" let fn a = Printf .sprintf "%s %d %s" a x y let _ = print_endline (fn "hello") val x : int val y : string val fn : string -> string

  6. OCaml: a quick primer let x = 1 let y = "world" Variable names let fn a = bound with “let” Printf .sprintf "%s %d %s" a x y let _ = print_endline (fn "hello") fn takes a string argument and returns a string Then we just print the result of calling fn

  7. OCaml: a quick primer let x = 1 Every value let y = "world" (functions or let fn a = Printf .sprintf "%s %d %s" a x y constants) has a let _ = print_endline (fn "hello") static type Mixing types up val x : int val y : string results in a val fn : string -> string compile time error # x + y;; Error: This expression has type string but an expression was expected of type int

  8. OCaml: Features Language type t = Apple | Orange Pattern Matching | Pear Algebraic Data let is_apple fruit = Types match fruit with | Apple -> true Type Inference | Orange -> false First Class Warning 8: this pattern- Functions matching is not exhaustive Static type Here is an example of a checking case that is not matched: Pear Parametric Polymorphism

  9. OCaml: Features Runtime Language Fast Foreign Pattern Matching Functions Algebraic Data Static Linking Types Garbage Type Inference Collection First Class Fast Native Code Functions Static type Multiarchitecture checking Parametric Portable Bytecode Polymorphism

  10. OCaml: Features Runtime Language Influenced Fast Foreign Pattern Matching Functions JavaScript F# Algebraic Data Static Linking Common Types Lisp Rust Garbage Type Inference Collection C# C++ First Class Elm Fast Native Code Functions Java Scala Static type Multiarchitecture checking Parametric Portable Bytecode Polymorphism

  11. What has driven the resurgence of ML?

  12. OCaml: Features Runtime Language Flexibility Fast Foreign Pattern Matching Functions JavaScript Wasm Algebraic Data Static Linking Types FPGAs Microcontrollers Garbage Type Inference Collection Unix Mobile First Class Fast Native Code Functions Unikernels Containers Static type Multiarchitecture checking Proof Static Parametric Assistants Analysis Portable Bytecode Polymorphism

  13. OCaml: Features Runtime Language Flexibility Fast Foreign Pattern Matching Functions JavaScript Wasm Algebraic Data Static Linking Types Garbage Type Inference Collection https://reasonml.github.io First Class Fast Native Code Reason lets you write Functions simple, fast and quality Static type type safe code while Multiarchitecture checking leveraging both the JavaScript & OCaml Parametric ecosystems. Portable Bytecode Polymorphism

  14. OCaml: Features Runtime Language Flexibility Fast Foreign Pattern Matching Functions Algebraic Data Static Linking Types FPGAs Microcontrollers Garbage Type Inference Collection HardCaml is a structural hardware design DSL embedded in Ocaml. First Class The library can be used for front end Fast Native Code Functions design tasks up to the synthesis stage where a VHDL or Verilog netlist is generated. Libraries for fast Static type simulation using LLVM, waveform Multiarchitecture checking viewing and co-simulation with Icarus Verilog are provided. Parametric HardCaml-RiscV is a simple Portable Bytecode Polymorphism pipelined RV32I core, targetted towards a FPGA implementation and built with HardCaml.

  15. OCaml: Features Runtime Language Flexibility Fast Foreign Pattern Matching Functions Algebraic Data Static Linking Types Garbage Type Inference Collection Unix Mobile First Class Fast Native Code Functions Unikernels Containers Static type Multiarchitecture checking https://mirage.io Parametric Portable Bytecode Polymorphism

  16. OCaml: Features Runtime Language Flexibility Fast Foreign Pattern Matching Functions Algebraic Data Static Linking Types Garbage Type Inference Collection First Class Fast Native Code Functions Static type https://flow.org Multiarchitecture checking Proof Static Parametric Assistants Analysis Portable Bytecode Polymorphism

  17. OCaml: Features Runtime Language Flexibility Fast Foreign Pattern Matching Functions JavaScript Wasm Algebraic Data Static Linking Types FPGAs Microcontrollers Garbage Type Inference Collection Unix Mobile First Class Fast Native Code Functions Unikernels Containers Static type Multiarchitecture checking Proof Static Parametric Assistants Analysis Portable Bytecode Polymorphism

  18. OCaml: Features Runtime Language Fast Foreign The working Pattern Matching Functions programmer Algebraic Data needs a lot more Static Linking Types than just a nice Garbage Type Inference language these Collection days! First Class Fast Native Code Functions Static type Multiarchitecture checking Parametric Portable Bytecode Polymorphism

  19. OCaml: Features Runtime Language Ecosystem Fast Foreign Libraries? Pattern Matching Functions Algebraic Data Static Linking Packages? Types Garbage Type Inference Sharing? Collection First Class Fast Native Code Editors? Functions Static type Multiarchitecture Documentation? checking Parametric Portable Bytecode Tests? Polymorphism

  20. CODE BUILD TEST EXPLAIN PACKAGE What is the OCaml Platform? The OCaml Platform combines the OCaml compiler toolchain with a coherent set of tools for build, documentation, testing and IDE integration. The project is a collaborative effort across the OCaml community, tied together by the OCaml Labs group in Cambridge, and OCamlPro in Paris. The requirements of the Platform are guided by large industrial users such as Jane Street, Citrix, Docker, Facebook, Microsoft and LexiFi, as well as accrued feedback from the opam project.

  21. CODE BUILD TEST EXPLAIN PACKAGE What is the OCaml Platform? Users with production deployments driving growth The OCaml Platform combines the OCaml compiler toolchain with a coherent set of tools for build, documentation, testing and IDE integration. The project is a collaborative effort across the OCaml community, tied together by the OCaml Labs group in Cambridge, and OCamlPro in Paris. The requirements of the Platform are guided by large industrial users such as Jane Street, Citrix, Docker, Facebook, Microsoft and LexiFi, as well as accrued feedback from the opam project.

  22. CODE BUILD TEST EXPLAIN PACKAGE The requirements of the Platform are guided by large industrial users such as Jane Street , Citrix, Docker, Microsoft, Facebook and LexiFi, as well as accrued feedback from the opam project. Trading Platform (trillions of dollars)

  23. CODE BUILD TEST EXPLAIN PACKAGE The requirements of the Platform are guided by large industrial users such as Jane Street , Citrix, Docker, Microsoft, Facebook and LexiFi, as well as accrued feedback from the opam project. Real World OCaml Trading Platform O'Reilly Associates (trillions of dollars) dev.realworldocaml.org Published millions of lines of production OCaml basic libraries as open source code

  24. CODE BUILD TEST EXPLAIN PACKAGE The requirements of the Platform are guided by large industrial users such as Jane Street , Citrix, Docker, Microsoft, Facebook and LexiFi, as well as accrued feedback from the opam project. Trading Platform Static Driver Verifier XenServer (trillions of dollars) (millions of lines of code) management stack (billions of VMs) Hack, Flow, Infer, ReasonML, ... Docker for Mac and Windows (billions of users) (millions of developers)

  25. CODE BUILD TEST EXPLAIN PACKAGE The requirements of the Platform are guided by large industrial users such as Jane Street, Citrix, Docker, Microsoft, Facebook and LexiFi, as well as accrued feedback from the opam project. A relatively small number of users with huge codebases and mission-critical uses . An unusual combination!

  26. CODE BUILD TEST EXPLAIN PACKAGE <2008 ocamlfind omake ocamldoc godi 2009 ounit odb 2010 oasis 2011 mirage 2012 3 hour G Every "tutorial" at project an conference The island wilderness years

Recommend


More recommend