Re: RAD vs. performance



Dr Jon D Harrop wrote:
Curtis W wrote:
If you didn't design for it, you've got quite a bit of work to do.
However, the static type system will pick up on all of your type errors
while you're developing, so it won't take long to make the alterations.

Ah, but you see, that wouldn't even be necessary if the standard
library was written correctly in the first place.

How is OCaml's stdlib relevant here and what do you mean by
"correctly"?
This problem would've been solved before even having arised had the
standard library been written in an extensible fashion using objects.

How do you mean? A lot of the duplication in the stdlib is done for
performance reasons, not because it is good abstract design. Indeed,
abstracting numbers in OCaml is extremely costly in terms of
performance (up to 20x slower).

That's only partly true. Even with a generic standard library, it
would've been possible to completely negate the cost through proper
inference in the compiler.

No. The performance cost of abstraction in OCaml has nothing to do with
inference.
First, yes it does. Second, I mistated that. I meant to say something
along the lines of:

it would've been possible to completely negate the cost most of the
time through proper inference in the compiler. It's completely possible
to infer when variants are and aren't needed most of the time; when
it's not possible, e.g. in circumstances in which complete compilation
would be necessary to find it, the generic case would be used. If it
turns out to be a bottleneck, the language could allow the programmer
to force a specific case, e.g. with a type declaration.

Unfortunately, rather than doing this, the
compiler writers and language designers simply pushed it off onto the
programmer to do, manually.

What are you talking about? What does the programmer have to do
manually?
Pick the correct function/operator to use.

.



Relevant Pages

  • Re: This is not the robocar I wanted!
    ... but it still has a cost. ... the compiler can emit very good code if it ... can only understand some looping construct or other and substute ... program a bit longer would have saved months of programmer time. ...
    (rec.arts.sf.written)
  • Re: Big integer arithmetic
    ... > get a programmer to make me a project which can compile ... For MSVC it should cost you nothing:) There's someone who ported GMP across ... The GMP++ ... classes work somewhat (after a few trivial changes to stop the compiler ...
    (comp.programming)
  • Re: Big integer arithmetic
    ... > get a programmer to make me a project which can compile ... For MSVC it should cost you nothing:) There's someone who ported GMP across ... The GMP++ ... classes work somewhat (after a few trivial changes to stop the compiler ...
    (sci.crypt)
  • Re: RAD vs. performance
    ... of run-time type dispatch when using parametric polymorphism. ... certainly have nothing to do with inference. ... time through proper inference in the compiler. ... turns out to be a bottleneck, the language could allow the programmer ...
    (comp.lang.misc)
  • Re: C90 penetration
    ... them to invest in a C compiler. ... He will be told to use PL/1 or assembler etc ... The time it would take me to do the task you describe would cost my company a lot more money than buying a C compiler. ... If that's not the case for you and your company, that implies that you're either very under-paid, or a much better assembler programmer than I am. ...
    (comp.lang.c)