Christopher Oliver | 4 Aug 20:38 1998

Marshalling of floats

In writing some signal processing software, I ran across a few
problems with Marshall.  I'd like ideas about how OCAML might
address these.

First, floats are simply written in increasing byte order OCAML
makes no attempt to rearrange based on endianness.  I think byte
order is discovered on configuration when building the system.
Should OCAML swap byte orders on some hardware to try to compen-
sate, or should we make no attempt to record floating point
portably between the major architectures?  The change in byterun/
intern.c and byterun/extern.c to handle byte swapping is fairly
trivial provided we include the config.h

Harder, does anyone have any good ideas besides conversion to
and from lists for marshalling floating arrays between bytecode
and native OCAML programs?  Without this sort of thing, one must
walk structures by hand if there are variant types with floating
arrays.

The reason for all this noise is that marshalling is ostensibly
to provide an external representation for non-code structured
data, but to be thorough, must we not try to be portable?

Ideas?

--

-- 
Christopher Oliver                     Traverse Internet
Systems Coordinator                    223 Grandview Pkwy, Suite 108
oliver <at> traverse.net                    Traverse City, Michigan, 49684
let magic f = fun x -> x and more_magic n f = fun x -> f ((n f) x);;
(Continue reading)

Xavier Leroy | 5 Aug 10:00 1998
Picon
Picon

Re: Marshalling of floats

> First, floats are simply written in increasing byte order OCAML
> makes no attempt to rearrange based on endianness.

Floats are written in "native" endianness (the natural endianness of
the machine writing the file), but along with a flag telling which
endianness is used.  input_value, then, swaps bytes if it runs on a
processor whose endianness does not match that used to create the
file.  This is more efficient than converting to and from a fixed
endianness in the frequent case where the data is read back on the
same machine that wrote it.

> Should OCAML swap byte orders on some hardware to try to compen-
> sate, or should we make no attempt to record floating point
> portably between the major architectures?  The change in byterun/
> intern.c and byterun/extern.c to handle byte swapping is fairly
> trivial provided we include the config.h

input_value/output_value is already portable across all platforms that
use IEEE floats.  The byte-swapping code is already in byterun/intern.c.

> Harder, does anyone have any good ideas besides conversion to
> and from lists for marshalling floating arrays between bytecode
> and native OCAML programs?  Without this sort of thing, one must
> walk structures by hand if there are variant types with floating
> arrays.

The next release of OCaml will use the same format for float arrays in
native-code and in bytecode, thus solving this problem.

Regards,
(Continue reading)

Philip A. Viton | 5 Aug 16:30 1998
Picon

hevea latex to html translator under ocaml / windows nt

Could I persaude anyone to give me some clues about getting this working
under windows NT? (I tried contacting the author, but no response).  
Basically, I'd be really grateful for a sequence of steps which would
allow me to compile the verious files into a bytecode executable "by
hand" using the ocaml command-line tools.  This distribution does come
with a MAKEFILE, but I've been unable to get it to work for me (I have
the cygnus (win-nt) version of make: do a need a speical one for
objective caml?)

Philip A. Viton
------------------
City Planning, Ohio State University
pviton <at> magnus.acs.ohio-state.edu

Christopher Oliver | 5 Aug 10:13 1998

Re: Marshalling of floats

> Floats are written in "native" endianness (the natural endianness of
> the machine writing the file), but along with a flag telling which
> endianness is used.

Ouch!  That will teach me to read only one piece of code.  My common
work usually has me dealing with standardized network representations,
so I missed this strategy completely.  [Chris sticks head in bucket.]

> > Harder, does anyone have any good ideas besides conversion to

> The next release of OCaml will use the same format for float arrays in
> native-code and in bytecode, thus solving this problem.

Both compact I hope.  Any idea on when this might happen?

--

-- 
Christopher Oliver                     Traverse Internet
Systems Coordinator                    223 Grandview Pkwy, Suite 108
oliver <at> traverse.net                    Traverse City, Michigan, 49684
let magic f = fun x -> x and more_magic n f = fun x -> f ((n f) x);;

Alain Frisch | 6 Aug 12:32 1998

Implémentation de printf

Bonjour à tous,

je cherche à créer une fonction du genre :

let affiche format arg = mon_affichage (sprintf format arg);;

mais qui accepte des formats avec plusieurs paramètres. Est-ce
possible (j'utilise Caml Light 0.7).

D'autre part, en consultant le code source de printf (version 0.6),
il me vient quelques questions : que sont les fonctions magic, 
is_block, repr, obj_tag ?
Est-il possible de créer soi même une fonction du style printf
(ie:  nombre et type d'arguments variable suivant la valeur d'un 
paramètre) ?

Merci.

Alain FRISCH
alfie2 <at> mygale.org
yala.frisch <at> wanadoo.fr
http://www.mygale.org/05/alfie2/
ICQ#:16299088

Sven LUTHER | 10 Aug 16:50 1998

Re: logiciels libres

[is ocaml licence compatible with debian and 'open source' ?)

Le 7 janvier, vous avez ecris :

> Attention aux citations hors contexte. Les paragraphes precedents de
> la license permettent explicitement:
> - la redistribution sous forme source ou binaire du logiciel non modifie;
> - la modification sans redistribution de versions modifiees;
> - la distribution de version modifiees sous forme de "patches".

> La seule chose qui demande donc permission de l'INRIA est la
> redistribution de versions modifiees sous d'autres forme que des patches. 
> Le but de cette restriction est d'etablir clairement qui est l'auteur
> de quoi.

> Une telle restriction est parfaitement compatible avec la definition
> de logiciel libre de Debian (point 4 de leur blabla).

Il me semble qu'il y a malentendu ici, en effet, la license ocaml ne
permet pas
la distribution de versions modifier sous forme __binaire__, uniquement
sous forme
de patches et du source original.

Est-ce que cela est voulu ? ou est-ce une erreur ? il me semble que sous
cette licence,
la distribution de l'archive debian dans non-free est illegale, car il
modifie un peu le
source (ajout des fichiers debian/control, changelog, etc ...) et
eventuellement quelques
(Continue reading)

Markus Mottl | 12 Aug 12:36 1998
Picon

Useful Makefile for Ocaml

Bonjour - Hello!

English version:

To make development of complex Ocaml-projects in a UNIX-environment a bit
easier, I have written a "Makefile" which automates a lot of processes:

  * generation of dependencies
  * code-generation from "ocamllex"- and "ocamlyacc"-files
  * creation of libraries or executables
  * output in byte- or native code

In general, the user only has to put the sources he wants to compile
into a variable, name the result and call "make" with the appropriate
action name.

E.g.:
  put "foo.ml my_scanner.mll my_parser.mly" into variable "SOURCES"
  put "my_executable" into "RESULT"
  call (e.g.): "make lib" to have a native code library...
               "make bc" to have a byte code executable...
               "make bclib" -> byte code library...
               "make" -> native code executable...

All dependencies will be correctly computed, so if you have to remake
your project, only the necessary parts will be rebuilt (which is also
true for the dependencies themselves!)

For further information consult the "README" that comes with the
distribution.
(Continue reading)

Xavier Leroy | 14 Aug 16:23 1998
Picon
Picon

Re: logiciels libres

> [is ocaml licence compatible with debian and 'open source' ?]

> Il me semble qu'il y a malentendu ici, en effet, la license ocaml ne
> permet pas la distribution de versions modifier sous forme
> __binaire__, uniquement sous forme de patches et du source original.
> Est-ce que cela est voulu ? ou est-ce une erreur ?

C'est voulu.  L'INRIA souhaite conserver un droit de regard sur
d'éventuels produits distribués qui reprendraient des morceaux du
source d'OCaml.  Par exemple, nous ne souhaitons pas retrouver sans
notre consentement la machine abstraite d'OCaml dans une
implémentation de Standard ML, ni les générateurs de code natif dans
un compilateur Java...

Tant que de tels "produits dérivés" sont distribués sous forme de
patches à appliquer au source d'OCaml, l'emprunt à OCaml est évident
et ne nous pose pas problème.  En revanche, une distribution sous
forme binaire d'un produit dérivé ne révèle pas clairement les
origines du produit dérivé, et ouvre la porte à des "récupérations"
abusives à nos yeux.

Il est à noter que la distribution binaire d'un produit dérivé n'est
pas interdite, mais seulement soumise à autorisation de l'INRIA.  Il
suffit d'écrire une lettre à la direction de l'INRIA Rocquencourt.
Les quelques demandes raisonnables de ce type reçues jusqu'ici ont
toujours été accordées.

> il me semble que sous cette licence, la distribution de l'archive
> debian dans non-free est illegale, car il modifie un peu le source
> (ajout des fichiers debian/control, changelog, etc ...) et
(Continue reading)

Aline Baggio | 17 Aug 15:14 1998
Picon
Picon

Re: Libc & oCaml questions

Sorry for the previous incomplete mail...
--

Hi,

Maybe it's a known issue but I'm experiencing some compilation
problems with a modified version of oCaml 1.07 VM (as well as the
original one). When using with libc.so.5.4.4 (or libc.so.5.4.44), the
compilation (make world) stuck at 'boot/ocamlyacc parsing/parser.mly'.
This is OK when using my old libc (libc.so.5.2.18).
Is that a normal behavior?

I also have a non technical question: is there a place (www or ftp
site) where we can find (all/many) software packages and contributions
that use oCaml or Caml (i.e. application/contribution sources or
links to their home site)? I mean: not only INRIA Caml contribution.

Thanks.
Best regards,
                                                 Aline Baggio

------------------------------------------------------------------------
Désolée pour le mail précédent...
--

Bonjour,

Peut être est-ce un problème connu, mais j'ai rencontré quelques
petites difficultés de compilation avec des versions de la VM oCaml :
une version modifiée (Jocaml) et la version originale (oCaml 1.07). En
(Continue reading)

Xavier Leroy | 19 Aug 10:26 1998
Picon
Picon

Objective Caml 2.00 released

It is my pleasure to announce the release of Objective Caml 2.00.

In addition to a number of enhancements and bug fixes (see detailed
list below), the main novelty of this release is the introduction of a
new class language (designed and implemented by Jérôme Vouillon).

The driving idea is to have a small language of class expressions to
manipulate classes, just like we have a small language of module
expressions to manipulate base modules (structures).

Class expressions are generated from base classes (definitions of
methods and instance variables) by adding initialization parameters,
applying (partially) those initialization parameters, putting class
type constraints to hide certain methods and instance variables, etc.

(Similarly, module expressions are generated from base modules
struct...end by functor abstraction, functor application, signature
constraints, etc.)

In addition to making the handling of classes more regular and
logical, the new class language is much more convenient than the OCaml
1.0 classes for controlling class initialization.

For more information on the new class language, see the tutorial
at http://caml.inria.fr/ocaml/htmlman/node3.html and the
reference manual at http://caml.inria.fr/ocaml/htmlman/node5.10.html

The downside of all this is that OCaml 2.00 is not upwards compatible
with OCaml 1.07 (hence the new major version number): the syntax of
classes has changed significantly, requiring some intervention on your
(Continue reading)


Gmane