Giter VIP home page Giter VIP logo

book's Introduction

Real World OCaml v2

This is the source code for the Real World OCaml 2nd edition, which is still a work in progress. The original edition was written by Yaron Minsky, Anil Madhavapeddy and Jason Hickey, and the revised edition is being lead by Yaron Minsky and Anil Madhavapeddy. There have been significant contributions to the revised tooling from Ashish Agarwal, Jeremy Yallop, Frederic Bour, and Sander Spies.

An online snapshot of the development book is available from https://dev.realworldocaml.org. There is a Feedback pane on each chapter which leads to a dedicated section on the OCaml discussion forum where you can register broader feedback. More specific issues such as typos can be reported on the issue tracker.

Repository layout

The book is structured as HTML sources that are transformed into the online site via OCaml scripts. Code fragments are evaluated and inserted into the book via custom <link> tags in the source code.

If you wish to build the book yourself, then you will need to be familiar with the opam pinning workflow.

There are three main repositories for the book:

  • https://github.com/realworldocaml/scripts contains the rwo opam package which provides the binaries for build and dependency analysis of the book sources. These scripts are currently unreleased and so need to be pinned to master via opam. The working branch is currently the v2 branch.
  • https://github.com/realworldocaml/examples contain the source code fragments which are evaluated and inserted into this book. They can be checked out separately for easy building by readers. The code fragments are evaluted by the rwo tool by using the ocaml-topexpect toplevel parser. The working branch is currently the v2 branch.
  • https://github.com/realworldocaml/book is this repository, whic uses the scripts and examples repositories to compile the HTML site online.

All of the code and examples are built using OCaml 4.06.1.

Building

Here are the commands to build the website:

Installing Dependencies

To install the dependencies needed for the book and the code examples:

opam pin add rwo . -n
opam install rwo --deps-only

Generating the HTML

The contents of the pages is split between:

To generate the HTML pages:

make

The HTML pages are created in _build/default/static/. Open _build/default/static/index.html to start browsing the freshly built version of the book.

Testing the code examples

It is possible to automatically test that the the code examples files work fine. To check that shell scripts and .ml files do what they are expected:

make test

This will run all the tests in "determinitic mode", which is suitable for the CI and it will display the diff between what is expected and what is produced.

To accept the changes:

make promote

Testing non-deterministic examples

A few code examples are not deterministic: for instance benchmarks. In this case, there is a special command to run:

make test-all

To accept the changes:

make promote

book's People

Contributors

agarwal avatar andyoram avatar avsm avatar chrishearse avatar constfun avatar cxa avatar etianen avatar hrittich avatar indexpro avatar jyh avatar kamilchm avatar kevinji avatar let-def avatar lpw25 avatar nbuonin avatar samoht avatar sanderspies avatar xvilka avatar yallop avatar yminsky avatar yminsky-janestreet avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.