Previous week   Up   Next week
Hello,

Here is the latest Caml Weekly News, week 19 to 26 february, 2002. 

Summary:
1) Bytecode size-RFC (Embedded  ocaml)
2) Osiris 1.0 Released
3) XML Light 

======================================================================
1) Bytecode size-RFC (Embedded  ocaml)
----------------------------------------------------------------------
Christian Gillot wondered:

Hi,

  Because of its inherent safety I think Ocaml is a good candidate
for embedded Linux (ie 32bit processor and good memory size,
not hard embedded applications, by example the iPAQ).
  I've setup a cross-compiler and apart some problems on floats
(hopefully resolved thanks to Xavier) it works great.
  There's a problem though : the code size. It's not a big deal,
because run time consume 150k and standards dlls (dllunix.so,
etc.) another 150k.
  If you compile a hello world program you get a 10k program (that's OK)
  If you compile a hello world program that use a Unix module function
you get a 50k program (not so OK)
  And if you compile a lablgtk hello world program you get a 250k
(that's not OK).

Note that if you use a function or more of a module it does not
really increase the code size of the program.

So AFAIK there's two solution :
  1. at the compilation time get off all the functions of a module
that aren't used. (I'm not really sure that Ocaml links all
the functions of .cma in a program but it seems so.)
  2. Dynamically load ocaml-side of modules. It seems to be the
right solution but far more difficult to implement than the first one.
At the run time the program would load all the required functions
of a module from the .cma. At compilation time one must sign in
a way all the dynamic module functions. This could be done by
using as a signature the whole qualified name of the function, by
example Unix.getenv. (but would put UnixLabels if the programmer
would have put a module Unix = UnixLabels. What matters is the
whole qualified name for the runtime). To insure safety a module
could include a version number, so that bytecode doesn't need
to include type information.

I'm not asking Ocaml implementors to do it but rather :
- is there somebody working on such issue ?
- how could it be done in theory ? (Request For Comments ,o)

I'm willing to do it and would appreciate any hint.
Note that embedded linux would definitely be a nice playground for ocaml
IMHO.

======================================================================
2) Osiris 1.0 Released
----------------------------------------------------------------------
Warp announced:

Hi all !

Osiris is a set of very-easy-to-use Class Wrappers for the Win32 Controls
API.
The main goal of Osiris is to enable RAD (Rapid Application Developpement)
of user interfaces.
You can now get sources & precompiled binaries at http://warplayer.free.fr

Sample :
(* file : sample.ml *)
open Osiris;;
let my_wnd = new_window() in
  my_wnd#caption "My Window Caption";
  let lpan = new_panel my_wnd#container in
    lpan#align AlLeft;
  let lbutton = new_button lpan#container in
 lbutton#align AlCenter;
    lbutton#caption "Click Me !";
    lbutton#on_click (fun x -> message_box (x#get_caption^" Clicked"));
  my_wnd#state Normal;
  my_wnd#update;
  while my_wnd#process do
    ()
  done

Requirements :
- OCaml 3.04 - for dynlink purpose
- Windows 95/98/NT/2K/Me/...
- A recent version of the Win32 OCaml API by Harry Chomsky ( can be found at
www.chomsky.net )
  (dynamic binaries are included in the current distribution)   

======================================================================
3) XML Light 
----------------------------------------------------------------------
Warp announced:

Hi all. 

I just released XML Light, a very light XML parser based on ocamllex /   
ocamlyacc. It compiles under Unix and Win32.

It can be use by people who only needs a minimalist XML description
( comments and <? ... ?> are discarded,  TEXT nodes are invalid, read
README for more informations ) and also as a good sample for people
who wants tolearn usage of lex & yacc.

http://warplayer.free.fr

======================================================================

Alan Schmitt