Re: RAD vs. performance
- From: "Curtis W" <cwarren89@xxxxxxxxx>
- Date: 28 Jun 2006 17:31:28 -0700
Jon Harrop wrote:
Curtis W wrote:The pattern matching required by the variants.
No. The performance cost of abstraction in OCaml has nothing to do
with inference.
First, yes it does.
In what way? I'm thinking of lack of inlining across functors and the
cost of run-time type dispatch when using parametric polymorphism. These
reasons certainly have nothing to do with inference.
The standard library is a prime example. It's completely conceivable
for the compiler to eliminate the dynamic dispatch 99% of the time
through code analysis and inference.
What dynamic dispatch? Do you mean the polymorphism in Array.map, for
example?
Well, standard library and operators :) I'd like to be able to write:ML programmers don't use variants when they're not needed.
Which is why the standard library is so rigid.
How would using variants more make OCaml's stdlib more flexible? What would
you like the stdlib to do that it doesn't do already?
-------
let double x = x*2;;
let xs = [1; 2; 3.0];;
let doubles = List.map double xs;;
-------
Even better, I'd like to be able to use the standard library arithmetic
functions with my custom float implementation.
Well, that's better than the language forcing me to tell it whether orYou'll need a more expressive type system if you want to express the use
of a subset of a variant type. Even then, why not just get rid of the
boxing in the ML implementation? You're not going to work to box
everything unnecessarily only to declare that you didn't need to.
Who says I'm using ML?
So you're using a dynamically typed language that is doing unnecessary
boxing and you can't tell it to stop so you want to extend the language to
allow you to tell it when boxing is unnecessary? You should be using
ML. ;-)
not to box every. single. value.
Well, using an actual object system would be better, but overloadingPick the correct function/operator to use.
You always have to pick the correct function/operator to use in any
language. Or are you going back to the numeric tower and saying that if
you have a smaller choice (e.g. if you overload / for int and float
division) then your life is somehow easier.
How is removing code repetition not a benefit?
How are you proposing to remove code repetition? Overloading?
would be an improvement.
Scroll up?Honestly, I don't get
your point. You've already stated that the standard library is like
that for speed. Are you trying to say it's somehow "better" now, too?
Hehe.
I don't understand how OCaml's stdlib is relevant here either.
.
- Follow-Ups:
- Re: RAD vs. performance
- From: Jon Harrop
- Re: RAD vs. performance
- References:
- Re: RAD vs. performance
- From: Curtis W
- Re: RAD vs. performance
- From: Jon Harrop
- Re: RAD vs. performance
- From: Curtis W
- Re: RAD vs. performance
- From: Jon Harrop
- Re: RAD vs. performance
- From: Curtis W
- Re: RAD vs. performance
- From: Jon Harrop
- Re: RAD vs. performance
- From: Curtis W
- Re: RAD vs. performance
- From: Jon Harrop
- Re: RAD vs. performance
- From: Curtis W
- Re: RAD vs. performance
- From: Dr Jon D Harrop
- Re: RAD vs. performance
- From: Curtis W
- Re: RAD vs. performance
- From: Dr Jon D Harrop
- Re: RAD vs. performance
- From: Curtis W
- Re: RAD vs. performance
- From: Jon Harrop
- Re: RAD vs. performance
- From: Curtis W
- Re: RAD vs. performance
- From: Jon Harrop
- Re: RAD vs. performance
- Prev by Date: Re: RAD vs. performance
- Next by Date: Re: RAD vs. performance
- Previous by thread: Re: RAD vs. performance
- Next by thread: Re: RAD vs. performance
- Index(es):
Relevant Pages
|