caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Functors ...
@ 1998-06-15 18:07 William Chesters
  1998-06-23 10:03 ` Functors Xavier Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: William Chesters @ 1998-06-15 18:07 UTC (permalink / raw)
  To: caml-list

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]

J'ai récemment dû faire un logiciel en C++, et j'ai saisi l'occasion
de me renseigner sur le librairie "STL".  Il était facile une fois que
je m'étais rendu compte que les templates sont essentiellement
identiques aux "functors" ML :).

---Alors, me dis-je, pourquoi ne pas écrire la même utilitaire en ML,
et peut-être le logiciel entier?  (Il s'agit d'une librairie petite
pour manipuler les "sparse vectors" au moyen des "iterators" .)

Mais il semble que ocaml implément les functors au moyen des
"dispatch tables"; ça marche donc un peu lentement.  Est-ce qu'il y a
une raison pour laquelle les fonctions dans les functors ne peuvent
pas être mise "inline"?




I recently had to write a program in C++, and I took the opportunity
to learn about the STL.  It was easy once I realised that templates
are essentially identical to ML functors :).

"OK", I thought, "why not write the same utility in ML, and perhaps
the whole program?"  (It's a little library for manipulating sparse
vectors using iterators.)

But it seems that ocaml implements functors with dispatch tables, so
it runs a bit slowly.  Is there some reason why functors cannot be
treated as normal code, much as C++ treats templates, and functions
from functors treated as candidates for inlining?





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

end of thread, other threads:[~1998-06-25 23:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-06-15 18:07 Functors William Chesters
1998-06-23 10:03 ` Functors Xavier Leroy
1998-06-23 17:00   ` Functors Thorsten Ohl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).