From: William Chesters <williamc@dai.ed.ac.uk>
To: caml-list@inria.fr
Subject: Functors ...
Date: Mon, 15 Jun 1998 19:07:38 +0100 [thread overview]
Message-ID: <23811.199806151807@venus> (raw)
[-- 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?
next reply other threads:[~1998-06-16 0:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-06-15 18:07 William Chesters [this message]
1998-06-23 10:03 ` Functors Xavier Leroy
1998-06-23 17:00 ` Functors Thorsten Ohl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=23811.199806151807@venus \
--to=williamc@dai.ed.ac.uk \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox