OCaml Development Yoann Padioleau [email protected] December 29, 2009

c 2010 Facebook Copyright Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3.

1

Short Contents 1 Introduction

4

2 Installing OCaml

5

3 Your First Program

6

4 Your First Project

7

5 Debugging

8

6 Emacs

9

7 Libraries

10

8 Pitfalls

11

9 Tricks

12

10 Documentation

13

11 Coding style

14

2

Contents 1 Introduction 1.1 OCaml vs Other Programming Languages . . . . . . . . . . . . . 1.2 Toolset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4 4 4

2 Installing OCaml 2.1 From source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Godi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Pad Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5 5 5 5

3 Your First Program 3.1 foo.ml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Command line arguments . . . . . . . . . . . . . . . . . . . . . . 3.3 A Simple Makefile . . . . . . . . . . . . . . . . . . . . . . . . . .

6 6 6 6

4 Your First Project 4.1 Project Organization . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Makefile Template . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 main.ml template . . . . . . . . . . . . . . . . . . . . . . . . . . .

7 7 7 7

5 Debugging 5.1 Displaying complex values . . . . . . . . . . . . . . . . . . . . . . 5.2 Breaking points . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 Time traveling . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8 8 8 8

6 Emacs 6.1 Tuareg mode . . . . . . 6.2 Type Inference Feedback 6.3 Debugging Under Emacs 6.4 project.el Template . 6.5 Addons . . . . . . . . .

9 9 9 9 9 9

. . . . . . . . under Emacs . . . . . . . . . . . . . . . . . . . . . . . .

7 Libraries

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

10

3

8 Pitfalls 11 8.1 Ugly Stuff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 8.2 Syntax Memento . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 9 Tricks

12

10 Documentation 13 10.1 OCaml Books . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 10.2 Functional programming . . . . . . . . . . . . . . . . . . . . . . . 13 10.3 OCaml Cookbook . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 11 Coding style 14 11.1 Coding Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 14 11.2 Do’s and Don’t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4

Chapter 1

Introduction 1

OCaml is a powerful language, trust me.

1.1

OCaml vs Other Programming Languages

1.2

Toolset

1 NOTE:

convention: use we/you, but try to limit their use

5

Chapter 2

Installing OCaml 2.1

From source

2.2

Godi

2.3

Pad Installation

6

Chapter 3

Your First Program 3.1

foo.ml

3.2

Command line arguments

3.3

A Simple Makefile

7

Chapter 4

Your First Project 4.1

Project Organization

4.2

Makefile Template

4.3

main.ml template

8

Chapter 5

Debugging Amazing debugger. Can go back in time.

5.1

Displaying complex values

5.2

Breaking points

5.3

Time traveling

9

Chapter 6

Emacs 6.1

Tuareg mode

6.2

Type Inference Feedback under Emacs

6.3

Debugging Under Emacs

6.4

project.el Template

6.5

Addons

10

Chapter 7

Libraries

11

Chapter 8

Pitfalls 8.1

Ugly Stuff

8.2

Syntax Memento

12

Chapter 9

Tricks

13

Chapter 10

Documentation 10.1

OCaml Books

10.2

Functional programming

10.3

OCaml Cookbook

14

Chapter 11

Coding style 11.1

Coding Conventions

11.2

Do’s and Don’t

15

Bibliography [1]

George Necula, CIL, CC. http://manju.cs.berkeley.edu/cil/

16

OCaml Development - GitHub

Dec 29, 2009 - OCaml is a powerful language, trust me. 1.1 OCaml vs Other Programming Languages. 1.2 Toolset. 1NOTE: convention: use we/you, but try to ...

85KB Sizes 10 Downloads 304 Views

Recommend Documents

Commons OCaml Library - GitHub
Dec 29, 2009 - reverse [x]. = [x]. )ig let b = laws "app " (fun (xs,ys) -> reverse (xs++ys) ...... implemented in OCaml, using the standard example of a calculator.".

Nullable Type Inference - OCaml
Dec 11, 2002 - [1] Apple (2014): Swift, a new programming language for iOS and. OS X. Available at https://developer.apple.com/swift. [2] Facebook (2014): ...

Nullable Type Inference - OCaml
Dec 11, 2002 - Imperative programming languages, such as C or Java deriva- tives, make abundant ... In languages using the ML type discipline, the option type type α option ..... //docs.hhvm.com/manual/en/hack.nullable.php. [3] Facebook ...

Development manual - GitHub
BUSMASTER is located in a Git repository on the open source hosting platform ... version of the installer, e.g. Git-1.7.7-preview20111014.exe (as of 2011-10-26).

Linux Kernel Development - GitHub
Page 10 .... Android's “life of a patch” flowchart. Gerrit is only one tiny part in the middle. Replace that one part with email, and everything still works, and goes ...

Open MPI development - GitHub
Jan 29, 2015 - (ad d_ co… om pi_sh ow. _a ll_m ca_ pa rams op al_p rog ress_ set_e ... 1.0E+01. 1.0E+02. 1.0E+03. 1.0E+04. M emory. Inc rease in. M. C. A. _P. M. L_ ..... Express. PCI. Express. Comm. Engine. (Packet. Processing). Comm.

Child theme Development - GitHub
Apr 7, 2014 - So the only HTML you have to write in on the position of

Development Guide - GitHub
Development Guide. A basic understanding of Git is required ... (3400 and 3500). All changes should build and boot Linux on all the targets described in the wiki.

Development Plan - GitHub
aragon.one. Page of. 1 15 ... Aragon organizations will be able to opt-in into the Aragon Network, which will provide services like upgradeability and a decentralized court arbitration system for Aragon organizations. For more information ...

ocaml tutorial pdf
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. ocaml tutorial pdf. ocaml tutorial pdf. Open. Extract. Open with.

OpenCMIS Server Development Guide - GitHub
Nov 6, 2013 - introduction and is available as a free pdf download at Manning's site here: ... the 10 minute video introducing this tool if you are not already familiar with it here: ... of this exercise is to demonstrate the server framework on top

Mobile SDK Development Guide - GitHub
Jul 20, 2017 - Page 1 ..... Chapter 11: Files and Networking . ..... services. Salesforce provides the Salesforce App Cloud to address this need. This cloud ...

Relational Conversion for OCaml - ML Family Workshop
preters (Programming Pearl) // Proceedings of the 2012 Work- shop on Scheme and Functional Programming (Scheme '12). [5] Henk Barendregt. Lambda ...

Packer Jaccard Index Future Development Experimental ... - GitHub
Well-known AV signature. 328 byte length ... Moreover changing the encryption key produces a completely diffe- ... lowed by the encrypted virus body. Memorial.

Test-driven development in C++ - GitHub
Richard Thomson. Senior Software Engineer. Fusion-io. @LegalizeAdulthd http://LegalizeAdulthood.wordpress.com [email protected] ...

FASIDS development and dependency summary - GitHub
FASIDS development and dependency summary. System Components ... Web Framework Implementation. Software Tool: ... Landscape application. GET.

ocaml for scientists pdf
Page 1 of 1. File: Ocaml for scientists pdf. Download now. Click here if your download doesn't start automatically. Page 1 of 1. ocaml for scientists pdf. ocaml for ...

ocaml for scientists pdf
ocaml for scientists pdf. ocaml for scientists pdf. Open. Extract. Open with. Sign In. Main menu. Displaying ocaml for scientists pdf.

Development Process of Distributed Embedded Systems ... - GitHub
Overture Technical Report Series. No. TR-006. September ... Month. Year Version Version of Overture.exe. April. 2010. 0.2. May. 2010 1. 0.2. February. 2011 2 .... 3.6.1 Introducing the BaseThread and TimeStamp Classes . . . . . . . . . . . . 69.

VOCAL – A Verified OCAml Library - ML Family Workshop
Libraries are the basic building blocks of any realistic programming project. It is thus of utmost .... verification of object-oriented programs. In 21st International ...

VOCAL – A Verified OCAml Library - ML Family Workshop
OCaml is the implementation language of systems used worldwide where stability, safety, and correctness are of ... An overview of JML tools and applications.

Compiling Links Effect Handlers to the OCaml Backend
The University of Edinburgh .... of intermediate representations (IRs), where the top representation is known as Lambda. .... Methods in Computer Science, 2013.