Article View: comp.std.c++
Article #697Re: The concept of templates considered ill designed
From: John MAX Skaller
Date: Sun, 11 Oct 1992 13:37
Date: Sun, 11 Oct 1992 13:37
35 lines
2197 bytes
2197 bytes
In article <Eep9xSi00Vp_4391Iw@andrew.cmu.edu> osoelgaultier+@CMU.EDU (Stefan Monnier) writes:
>
>Every advance in languages has been associated with an increased overhead:
>from assembler to C, from C to C++: every time you switch to a higher level
>language you lose some speed.
>
Not true! Consider a language with assertion facilities,
the assertions get included as run-time checks. The program is
now 'correct', although you only get to catch errors at run-time.
Now add an inference engine to the compiler. It might now
PROVE certain assertions, thus eliminating the run-time checks,
the result is faster and smaller. Further more is may show certain
assertions FALSE, thus improving the chances of catching errors
in parts of the code that are not exercised often.
This would be a major advance IMHO, and it results
in faster code as well as earlier error detection.
Now consider virtual functions. If you are losing
speed, dont use a virtual. But you need a virtual? Well,
then virtuals are surely faster than an equivalent handcoded
indirect call.
There are FORTRAN compiler around for which it is claimed
that they produce better code than hand coded assembler. So I think
you have overgeneralised a bit in your claim that advances have
run-time speed costs.
--
;----------------------------------------------------------------------
JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Technical Details
Message-ID:
<1992Oct11.133704.5600@ucc.su.OZ.AU>Path:
arc1-ca.pugleaf.net!sparky!uunet!ukma!darwin.sura.net!sgiblab!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtalReferences:
<UeoW1kS00awV0GbEpY@andrew.cmu.edu> <1992Oct7.170351.16316@genghis.borland.com> <Eep9xSi00Vp_4391Iw@andrew.cmu.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++,comp.lang.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!darwin.sura.net!sgiblab!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) Subject: Re: The concept of templates considered ill designed Message-ID: <1992Oct11.133704.5600@ucc.su.OZ.AU> Sender: news@ucc.su.OZ.AU Nntp-Posting-Host: extro.ucc.su.oz.au Organization: MAXTAL P/L C/- University Computing Centre, Sydney References: <UeoW1kS00awV0GbEpY@andrew.cmu.edu> <1992Oct7.170351.16316@genghis.borland.com> <Eep9xSi00Vp_4391Iw@andrew.cmu.edu> Date: Sun, 11 Oct 1992 13:37:04 GMT Lines: 35