Xavier Leroy | 1 Sep 17:24 1997
Picon
Picon

Re: Thread library for ocamlopt?

> > * Available only on Unix systems that provide fully conformant
> > Posix 1003.1c threads, e.g. Solaris 2.5, Digital Unix 4.0, or
> > Linux with LinuxThreads, but not HPUX, SunOS, nor earlier
> > versions of Digital Unix, for instance.
> 
> Couldn't the implementation on the latter three OSs emulate the
> semantics (without the performance benefit, of course) with the old
> threads?

The two thread libraries (the bytecode-level one and the one built on
top of Posix threads) have the same API and (hopefully) the same
semantics, so, as you say, the bytecode-level library can still be
used as a fallback solution on operating systems that do not provide
Posix threads.

> Then programs would remain portable and users of
> multiprocessor machines running the former three OSs could start
> chasing around the FORTRAN crowd :-).

The only remaining problem is that the OCaml code is still essentially
single-threaded -- by lack of a suitable GC, we can't have more than
one thread executing Caml code at any given time.  So, the Caml code
can't exploit a multiprocessor.  I/O operations and code written in C
can still run concurrently with the Caml code, though.

Overall, the Caml thread libraries won't make your code run faster;
they are mainly useful to facilitate overlapping I/O and other forms
of asynchronous communications.

> > * Preemption of long-running threads can only occur at
(Continue reading)

Picon

Pretty-printer and tabulation boxes

Bonjour,

Travaillant `a la r'ealisation d'un pretty-printer en Objective Caml,
je souhaiterais utiliser toutes les possibilit'ees offertes par le
module "Format". Je suis `a la recherche de quelques exemples
d'impl'ementation de pretty-printer mettant en oeuvre -si possible-
les   bo^ites de tabulation (c'est `a dire utilisant 'open_tbox' et
'close_tbox'). 

N.B: je poss`ede la documentation et le manuel utilisateur de "The
Objective Caml system release 1.05".

Merci d'avance.

-----------

Hello,

Working at the realisation in Objective Caml of a Pretty-Printer, I
would like to use all possibilities provided by the "Format"
module. I'm looking for some existing pretty-printer examples. I'm
interesting in finding a few which use the tabulation boxes (i.e
invoking the functions  'open_tbox' and 'close_tbox').

N.B: I already have the documentation and the user's manual of "The
Objective Caml system release 1.05".

Thanks.

--

-- 
(Continue reading)

Pierre Weis | 2 Sep 20:16 1997
Picon
Picon

Re: Pretty-printer and tabulation boxes

> Bonjour,
> 
> Travaillant `a la r'ealisation d'un pretty-printer en Objective Caml,
> je souhaiterais utiliser toutes les possibilit'ees offertes par le
> module "Format". Je suis `a la recherche de quelques exemples
> d'impl'ementation de pretty-printer mettant en oeuvre -si possible-
> les   bo^ites de tabulation (c'est `a dire utilisant 'open_tbox' et
> 'close_tbox'). 

Il y a des exemples d'imprimeurs dans la FAQ de caml 
(http://pauillac.inria.fr/caml/FAQ/format-fra.html).

Malheureusement, il n'y a pas d'exemples avec les boi^tes de
tabulation. Ces boi^tes ne sont pas destine'es a` l'impression
d'arbres mais a` l'impression simple de structures plus line'aires
(tableaux de chiffres par exemple).

De plus, les boi^tes de tabulation obe'issent a` une logique
diffe'rente des boi^tes d'impression habituelles, avec lesquelles
elles ne doivent pas e^tre me'lange'es. (Autrement dit, le module
format imple'mente ces deux types de boi^tes ``en paralle`le'', sans
donner le moyen de les utiliser simultane'ment).

> -----------
> 
> Hello,
> 
> Working at the realisation in Objective Caml of a Pretty-Printer, I
> would like to use all possibilities provided by the "Format"
> module. I'm looking for some existing pretty-printer examples. I'm
(Continue reading)

Isidro Jimenez Ovelar | 5 Sep 23:49 1997

huffman compresion


I am new in this group, I am a student of informatic at
Politecnica of Madrid University. I have to use caml to make
a practice and I 'd be very pleased if someone of you
could help a little bit.

        This the job:  Huffman compression

The functions I have to do are:

Frecuency1: (* File -> (int ,float) Tabla *)
(* this function read a file in binary mode and give one
table with the frecuencies of each simbol *)

Maketree: (* (`symbol , float) Table -> `symbol list -> symbol Huftree

(* This function take the table of relatives frecuencies and the
list of symbols of the file and gives a Huffman tree *)

Compress (* int Hufftree -> file -> file -> unit *)
¦
¦        (* This function takes the name of a file to compress and the
compressed
¦        filed and inteprets the data byte to byte *)
¦
¦        UnCompress (*int Hufftree -> File -> File -> unit *)
¦        (*This function makes the opposite of Compress*)
¦
¦        I use these types:
¦
(Continue reading)

Olivier Bouyssou | 10 Sep 10:17 1997
Picon

camlex/camlyacc + threads problem

English translation below.

J'ai un probleme lorsque j'utilise une fonction de parsing dans plusieurs 
threads

Voici l'exemple qui parse une liste de crenaux horaires :

Le lexer :

--
{
open Horloge_parser
} 
rule token = parse
   [' ' '\t' '\n']          { token lexbuf }
|  ['0'-'9']['0'-'9']       { INT(int_of_string(Lexing.lexeme lexbuf) }
|  ['0'-'9']                { INT(int_of_string(Lexing.lexeme lexbuf) }
|  ':'                      { PP }
|  '-'                      { TIRET }
|  eof                      { EOF }
--

Le parser :

--
%{
exception Incorrect_minute
exception Incorrect_hour
let test_minute m = if m < 0 || m > 59 then raise Incorrect_minute
let test_heure  h = if h < 0 || h > 23 then raise Incorrect_hour
(Continue reading)

Ching-Tsun Chou | 9 Sep 21:50 1997
Picon

BDD in O'Caml?


Hi,

Has anyone interfaced a BDD package with O'Caml?

I'd appreciate any pointers!

- Ching Tsun

========================================================================
  Ching-Tsun Chou                       E-mail: ctchou <at> mipos2.intel.com 
  Intel Corporation, RN6-16             Tel: (408) 765-5468             
  2200 Mission College Blvd.            Fax: (408) 765-6688             
  Santa Clara, CA 95052, U.S.A.         Sec: (408) 653-8849             
========================================================================

michel | 10 Sep 11:37 1997
Picon

Re: BDD in O'Caml?

Attachment: application/octet-stream, 798 bytes
Basile STARYNKEVITCH | 11 Sep 12:58 1997
Picon

Q: Caml for number crunching and/or scripting?


Hello All,

Are there anyone using CAML or Ocaml 

  for numerical/physical/scientific applications (maybe number crunching)

  as an embeddable scripting langage

(both are possible: using CAML as a scripting langage driving low
level -eg Fortran- numerical routines)

................

[French]

Il y a t il des gens qui utilisent CAML

  pour des applications numériques/scientifiques/physiques  

  comme langage de commande embarqué

(les deux sont possibles: utiliser CAML comme langage de commande
pilotant des routines de calcul de bas niveau en Fortran)

................

N.B. Any opinions expressed here are solely mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.

----------------------------------------------------------------------
Basile STARYNKEVITCH   ----  Commissariat à l Energie Atomique 
DRN/DMT/SERMA * CEA/Saclay bat.470 * 91191 GIF/YVETTE CEDEX * France
fax: (33) 01,69.08.85.68; phone: 01,69.08.40.66; home: 01,46.65.45.53
email: Basile . Starynkevitch  <at>  cea . fr  (but remove white space)
I speak french, english, russian. Je parle français, anglais, russe.
----------------------------------------------------------------------

William Chesters | 13 Sep 19:30 1997
Picon
Picon

Re: Q: Caml for number crunching and/or scripting?

Basile Starynkevitch writes:
 > Hello All,
 > 
 > Are there anyone using CAML or Ocaml 
 > 
 > for numerical/physical/scientific applications (maybe number crunching)
 > 
 > as an embeddable scripting langage
 > 
 > (both are possible: using CAML as a scripting langage driving low
 > level -eg Fortran- numerical routines)

Yes, I use it for both actually.

I've used camlp4 (much recommended btw) to extend the syntax of ocaml
so that I can write matrix/tensor calculations using the summation
convention:

	tens v[I J] += w[I K J L] b[K L] + k a[I J]

and have a very efficient loop to do the work inserted automatically,
in C or in ML.

I keep the matrices in Fortran layout so that I can use Lapack
routines on them.  Using ocamlopt's -output-obj option you can even
squeeze in a call initialise the f2c libraries at startup time.

I've also taken to using ocaml for scripting jobs that are more
complicated than Perl can comfortably handle.  It's interesting that
ML's background as a very abstract language gives it some of the
conciseness and convenience of Perl, but without the flakiness.
On the other hand I'd rather have Perl's than emacs's regexps ...

Matti Jokinen | 13 Sep 01:57 1997
Picon
Picon

Preinitialized executables?

I have a program that needs to be initialied by building a large and
fairly complicated data structure.  In Ocaml the fastest method I
have found is to save the data structure in a file with output_value
and then load it into the program with input_value, but even this way
the overhead is considerable.  SML/NJ has a function named exportFn,
which saves the program together with its state into an executable file:
when the program is run from the file, control is transferred to a
function given as a parameter to exportFn.  I wonder if something
similar is possible in Ocaml.

- Matti Jokinen


Gmane