Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* compilation
@ 1997-02-13 15:24 Jean-Christophe Filliatre
  1997-02-18 15:26 ` compilation David Monniaux
  1997-02-18 16:53 ` compilation Xavier Leroy
  0 siblings, 2 replies; 4+ messages in thread
From: Jean-Christophe Filliatre @ 1997-02-13 15:24 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text, Size: 1586 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: compilation
@ 1997-02-19  8:12 Franck Cassez
  0 siblings, 0 replies; 4+ messages in thread
From: Franck Cassez @ 1997-02-19  8:12 UTC (permalink / raw)
  To: Jean-Christophe.Filliatre; +Cc: caml-list

Bonjour Jean-Christophe,

	concernant les evaluations a la compilation,
j'avais pose une question similaire a Pierre Weis 
l'annee derniere (mon but etait
d'``accelerer'' un programme): je pense que l'exemple suivant
peut t'interesser.

A+

Franck.

- Franck.Cassez@univ-brest.fr - Departement d'Informatique  - 
-- Universite de Bretagne Occidentale  6, Avenue Le Gorgeu --
----   BP 809  ----   29285 Brest Cedex  ----   FRANCE   ----
-- tel: (+33) 02 98 01 69 59 -- fax: (+33) 02 98 01 69 56  --

dixit Pierre :
Je m'explique soit la fonction f:

let f a x = if a then (x + 1) else (x - 1);;

alors f true est la fonction x -> if true then (x + 1) else (x - 1) et non
pas la fonction x -> x + 1

On obtient une petite acce'le'ration en e'crivant:

let f a = if a then (fun x -> x + 1) else (fun x -> x - 1);;

car alors f true est (fun x -> x + 1). Cependant cette propagation des
constantes par le compilateur du (me'ta)-langage n'est pas de bonne
me'thodologie (elle n'est pas efficace). Pour beaucoup gagner il faut
re'aliser un ve'ritable compilateur qui analyse les programmes sources
du langage a` compiler et les optimise lui-me^me.







^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-02-19  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-13 15:24 compilation Jean-Christophe Filliatre
1997-02-18 15:26 ` compilation David Monniaux
1997-02-18 16:53 ` compilation Xavier Leroy
1997-02-19  8:12 compilation Franck Cassez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox