Version 9 of OCaml

Updated 2008-12-14 20:25:34 by schlenk

OCaml stands for Objective Caml [L1 ].

It is a strict functional programming language of ML family. It features modular structure, polymorphic typing with type inference and has pretty wide set of libraries and tools. Also, it is simple, fast, has very fast compiler and pretty compact.

And one can note, that it can use Tk for GUIs (labltk module).

Given that Ocaml can be used to create share libraries [L2 ], just like C, it should not be that difficult to use with Tcl - in the classic Tcl as glue for another language fashion.


schlenk It is not too difficult to wrap an OCaml library as a Tcl extension, but there are some small issue one has to be aware off.

  * The library should be created as native code, not OCaml Bytecode.
  * When trying to bridge OCaml Objects to Tcl_Obj representations on needs to be aware of differences 
    like the CAR/CON semantics of OCaml lists vs. the C array style reps of Tcl_ListObj, so you need
    to study the boxing/unboxing of OCaml Values to make it work, e.g. recursive creation of OCaml lists
    from Tcl_ListObj.
    Its easier to work via the String interfaces.