From INRIA (who created O’Caml) you can get the O’Caml compiler and runtime system, but this is usually not enough to develop applications. You also need libraries, and there are many developers all over the world providing them; you can go and pick them up. But it is a lot of work to build and install them.

GODI is a system that simplifies this task: It is a framework that automatically builds the O’Caml core system, and additionally installs a growing number of pre-packaged libraries. For a number of reasons GODI is a source-code based system, and there are no precompiled libraries, but it makes it very simple for everybody to compile them.

GODI is available for O’Caml-3.10 and 3.11. It runs on Linux, Solaris, FreeBSD, NetBSD, Windows (Cygwin and MinGW), HP-UX, MacOS X.

]]>https://www.wisdomandwonder.com/link/5707/programming-pic-microcontrollers-with-objective-caml/feed0Stalin Scheme vs OCamlhttps://www.wisdomandwonder.com/link/5360/stalin-scheme-vs-ocaml
https://www.wisdomandwonder.com/link/5360/stalin-scheme-vs-ocaml#commentsSat, 06 Nov 2010 22:25:12 +0000https://www.wisdomandwonder.com/?p=5360Here is an old post comparing Stalin Scheme to OCaml, among a few other languages. Here is the article on Jon’s page.

Stalin seems pretty amazing.

]]>https://www.wisdomandwonder.com/link/5360/stalin-scheme-vs-ocaml/feed3Enhanced Ocaml Documentation Version 3.12https://www.wisdomandwonder.com/link/5310/enhanced-ocaml-documentation-version-3-12
https://www.wisdomandwonder.com/link/5310/enhanced-ocaml-documentation-version-3-12#respondSat, 25 Sep 2010 02:47:28 +0000https://www.wisdomandwonder.com/?p=5310Continue reading "Enhanced Ocaml Documentation Version 3.12"]]>The Enhanced Ocaml Documentation is provided by Hendrik Tews; basically it visually highlights any difference between the previous and current version of the documentation. Here is how he does it:

I diff the txt versions of the reference manual and change the html version by hand. For the grammar rule index I use a tool and manual editing.

]]>https://www.wisdomandwonder.com/link/5310/enhanced-ocaml-documentation-version-3-12/feed0Resources for Learning CamlP4https://www.wisdomandwonder.com/link/5302/resources-for-learning-camlp4
https://www.wisdomandwonder.com/link/5302/resources-for-learning-camlp4#respondSat, 25 Sep 2010 02:42:51 +0000https://www.wisdomandwonder.com/?p=5302= 3.10) Camlp4, you may be interested in Jake Donham’s blog post series “Reading Camlp4” : http://ambassadortothecomputers.blogspot.com/search/label/camlp4 You will also find valuable (though incomplete) information on the camlp4 wiki : http://brion.inria.fr/gallium/index.php/Camlp4 The older version of camlp4 (< 3.10, now called camlp5) also provides a documentation http://caml.inria.fr/pub/docs/tutorial-camlp4/index.html , and you … Continue reading "Resources for Learning CamlP4"]]>

Shameless self-plug, but I wrote a blog post this summer about my experience figuring out how to do it. I provide a walk-through and explanation of a minimal syntax extension which adds lazy list pattern matching support based on Batteries. The URL:

I do assume a basic knowledge of parsing context-free grammars, but a generic tutorial on parsing with a tool such as Yacc can fill in that gap. The Wikipedia article[1] may also be helpful.

Once you’ve lept the hurdle of figuring out what pieces you need to write and build a syntax extension, the remaining tricky part is to figure out what pieces of the grammar you need to extend to accomplish your objective. For that, I consult the definition of the OCaml parser in Camlp4OCamlParser.ml in the OCaml source tree.
1. http://en.wikipedia.org/wiki/Context-free_grammar

— Michael Ekstrand

If you consider yourself as a n00b, don’t start by camlp4. This is probably the most difficult part of OCaml — and to program camlp4 you need to use OCaml standard syntax (or revised syntax, it depends if you
use antiquotations).

If you still want to follow the hard path, as suggested elsewhere, Jake Donham’s blog posts are very good:

]]>https://www.wisdomandwonder.com/link/5302/resources-for-learning-camlp4/feed0Objective Caml for Multicore Architectureshttps://www.wisdomandwonder.com/link/5238/objective-caml-for-multicore-architectures
https://www.wisdomandwonder.com/link/5238/objective-caml-for-multicore-architectures#respondMon, 13 Sep 2010 12:31:25 +0000https://www.wisdomandwonder.com/?p=5238Efforts being made on one of the biggest criticisms of OCaml.

(via Caml-list)

]]>https://www.wisdomandwonder.com/link/5238/objective-caml-for-multicore-architectures/feed0Unison on the iPhonehttps://www.wisdomandwonder.com/link/5208/unison-on-the-iphone
https://www.wisdomandwonder.com/link/5208/unison-on-the-iphone#respondSat, 11 Sep 2010 20:13:37 +0000https://www.wisdomandwonder.com/?p=5208Here is how to get Unison running on the iPhone. Nice.

The library delimcc implements shift/reset, prompt/control, shift0,
control0 delimited continuation operators with multiple, arbitrarily
typed prompts. The delimcc implementation is direct: it copies only
the relevant fragment of the OCaml stack. The implementation is fully
integrated with OCaml exceptions: exception handlers may be captured
in delimited continuations (and re-instated when the captured
continuation is installed); exceptions remove the prompts along the
way. The implementation has no typing problems, no bizarre ‘a cont
types, and no use for magic.

The library delimcc does *no* patching of the OCaml system and is a
regular (static or dynamically-loaded) library. The library is
therefore _perfectly_ compatible with any existing OCaml code, source
or binary.

The native- and byte-code versions of the library implement the
identical interface, described in delimcc.mli. Furthermore, the OCaml
code for the two versions is identical. Only the C code files,
implementing scAPI, differ for native-code.

Using the native-code version is identical to the byte-code version of
delimcc. No source code has to be changed; it has to be compiled using
ocamlopt rather than ocamlc.

This is the first release of the library, for OCaml 3.11. It has been
tested on i386 (x86_32) platform, on FreeBSD and Linux. The library
could perhaps be used on other platforms (on which stack grows
downwards); x86_32 is the only platform available to me. At any write,
the library contains no custom-written assembly code (although I
couldn’t avoid reading a lot of assembly code).

This is the first release of the native-code version, hence stressing
correctness at the expense of performance. A notable performance drain
is emulating data types with a custom GC scanning
function. Custom-scanned data types are possible without any changes
to OCaml, thanks to the provided GC hooks. Alas, the emulation doesn’t
seem to be efficient. A co-operation from the OCaml system would be
greatly appreciated. I have a hunch that custom-scan data types could
be useful for many other applications, for heap-allocating structures
with OCaml values intermixed with unboxed data.

It should be noted that the very operation of capturing and
reinstalling a delimited continuations will always be faster in
byte-code than in the native code. First of all, the byte-code
delimited continuation is smaller. Second, it is a uniform a sequence
of values or code pointers. In contrast, the corresponding captured
native-code delimited continuation — the portion of the C stack — is
not only bigger, but also contains unboxed values. We have to use
frame tables to figure out which stack slots contain live heap
pointers. Saving native-code delimited continuation is inherently more
complex. In fact, all the complexity of the native-code delimcc was
tidying the stack to please GC.

One should keep in mind the fundamental limitation of native-code
delimited continuations — the limitation that also holds for Scheme
and other systems with delimited control. The limitation concerns
capturing continuations in the OCaml code invoked as a call-back from
C code, which was, in turn, called from OCaml. It is safe to capture a
delimited continuation in the callback _provided_ the extent of the
captured continuation is limited to the call-back. The continuation
captured in the callback may be resumed within the call-back or after
the call-back has exited. One must not capture the continuation
through the C code that invoked the call-back. In short, no C frames
may be captured in delimited continuations. The library detects C
frames in captured continuations, and throws a run-time error. Such a
behavior of delimcc is consistent with the behavior of native-code
Scheme systems.