[MLton] Conversions and the Basis Library
Vesa Karvonen
vesa.a.j.k at gmail.com
Wed Nov 28 13:02:32 PST 2007
On Nov 28, 2007 10:11 PM, Wesley W. Terpstra <wesley at terpstra.ca> wrote:
> On Nov 28, 2007, at 8:36 PM, Vesa Karvonen wrote:
> > On Nov 28, 2007 8:04 PM, Wesley W. Terpstra <wesley at terpstra.ca>
> > wrote:
> >> On Nov 28, 2007, at 6:25 PM, Vesa Karvonen wrote:
[on conversions to/from FixedInt]
> You've convinced me that this is a good thing to add. My last comment
> is a pragmatic one: is it easier to advocate a change to the basis or
> to patch MLton's optimizer?
>
> I know your answer; you've already undertaken to rewrite the basis.
Well, I'm not exactly rewriting it. I would say that I'm
*experimenting* with extending it with stuff that I have, at some
point, considered potentially useful enough to be added to the Basis.
Some of the extensions probably are worth adding to the Basis while
some are not. If given enough of it, time will tell.
> I've come to consider the later easier.
I'm not at all certain how easy it is to get stuff into the Basis
spec. John Reppy didn't seem completely opposed to the idea of
additions at/after the ML workshop. I believe that the addition of
conversions to/from FixedInt fits the criteria, or at least my mental
model of the criteria, he mentioned. At any rate, I'm certainly
willing to do some of the work. I could submit patches for initial
(not necessarily optimal) implementations of the additional
conversions to a number of compilers. In fact, I think that best
course of action would be to implement the extension in a couple of
compilers and measure the actual speedup and the complexity of the
implementation. If, as I believe, it turns out to be relatively easy
to implement and gives a significant speedup, it should certainly give
a reason for adding it to the Basis spec.
> >> Weren't you the one talking about the Genius Tailor? ;-)
[...]
> I thought the lesson was that a language shouldn't force programmers
> to distort code to fit it.
That is part of the lesson, and the story is tilted that way, but the
problem (which is told after the story (at least in the book)) is that
it is can be difficult to know whether the observed "distortion" is
ultimately good or bad. Witness the static vs dynamic typing debate,
for example. Is typing a limitation that makes you crouch or a
blessing that helps you run more safely? And that *is* a rhetorical
question! :-)
-Vesa Karvonen
More information about the MLton
mailing list