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 8 Downloads 107 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.".

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

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.

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.

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.

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

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.

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.