1 Feb 2004 monkeyiq   » (Journeyer)


The next release of ferris will have OCaml language support. I now have a little code snippet working using SWIG for the binding. I'm not entirely happy with the syntax of the OCaml interface though. Also I've got to check if there are mono argument functions which are setup for composition or not, I suspect not. The latter might not be a drama, but the syntax is a annoying issue.

There are some OCaml side tricks that help the syntax but its still obviously non-native. It does do away with the nast C_list construction being everywhere. I might end up making a little shallow object wrapper that uses the SWIG interface but presents a native OCaml object interface to the rest of the ocaml world.

The little snip I have at current for testing is

(* This example was mostly lifted from the guile example directory *)

open Libferrisocaml (* open Example *)

let foo = _getTime ( C_list [] )

let _ = begin print_string "Current time in UNIX epoch seconds..." ; print_int (get_int foo); print_newline () ;

print_string "Current time in human terms..." ; print_string (get_string (_toTimeString( C_list[ foo ] ))); print_newline () ;


let c = _Resolve( C_list[ C_string "/tmp/play/signtest.gpg" ] ) let _ = begin print_string "Context::test " ; print_newline () ;

let earl = (invoke c) "getURL" (C_list [] ) in begin print_string "URL:"; print_string (get_string earl); print_newline () ; print_int (get_int c); print_newline () ;

let md5 = _getStrAttr( C_list [ c; C_string "md5"; C_string "" ] ) in begin print_string "MD5:"; print_string (get_string md5); print_newline () ; end end end


Made another release yesterday, mainly fixing a fix little regressions that I found when writing an article about libferris.

Also converted a few things in configure.in to try to be a little more friendly for systems that are not 100% setup properly for ferris, the nerve of some folks not having a ferris friendly setup :)

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!