From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,604e0f87aa06eab6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-25 08:44:28 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.isc.org!sjc70.webusenet.com!c03.atl99!news.webusenet.com!diablo.voicenet.com!newsfeed.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Imitation is the sincerest form of flattery Date: 25 Mar 2003 11:44:27 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <7eee7v4hpvj0i5s345uonlen5315rhiau8@4ax.com> <4dkea.75440$gi1.38045@nwrdny02.gnilink.net> <5115eb96.0303220201.44527637@posting.google.com> <5115eb96.0303232053.2fcc7d78@posting.google.com> <5115eb96.0303242148.57027600@posting.google.com> <6Y_fa.5102$kU.534@nwrdny01.gnilink.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1048610667 9417 199.172.62.241 (25 Mar 2003 16:44:27 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 25 Mar 2003 16:44:27 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:35688 Date: 2003-03-25T11:44:27-05:00 List-Id: "Frank J. Lhota" writes: > If there is a way to get the effect of tagged scalar types without a big hit > on efficiency, however, it would certainly be helpful. Well, I think efficiency per se is irrelevant to language design. What matters is distributed overhead -- you don't want to pay an efficiency cost for features you don't use. If a feature is useful, then presumably implementers will implement it in the most efficient way that's reasonable. It doesn't make sense to leave out a feature purely because it is inherently slow -- if it's useful, then programmers will have to implement it themselves, and it will *still* be slow. It makes sense to leave out a feature if it makes *other* features slower than they would otherwise need to be. So the question is whether a language can provide extensible scalars with dispatching calls without slowing code that doesn't need that power. I think the answer is yes: don't store the tag with every object. Instead, gin it up when calling a class-wide operation. So "+" on normal (non-class-wide) integers can be a single machine instruction, and integers can be stored as a single word. The compiler can determine when to gin up a tag -- no need for explicit boxing operations. - Bob