comp.lang.ada
 help / color / mirror / Atom feed
* Re: Fixed-point
  1997-03-28  0:00 Fixed-point Jeff Carter
@ 1997-03-28  0:00 ` Tom Moran
  1997-03-28  0:00 ` Fixed-point Robert Dewar
  1997-03-29  0:00 ` Fixed-point Robert A Duff
  2 siblings, 0 replies; 7+ messages in thread
From: Tom Moran @ 1997-03-28  0:00 UTC (permalink / raw)



> Jack Crenshaw's "Programmer's Toolbox" column in *Embedded Systems
> Programming* has been discussing 
> ...
> fixed-point operations are so slow in Ada
  He apparently once tried Ada in the early '80s and has been repeating
obsolete nonsense ever since.  Clearly if you define a 35 bit fixed
point field, and your compiler lets you, arithmetic will be a bit slow,
just like asm or C++.  But a reasonable size, say 16 or 32 bits, will be
fast.  I've used it often when the target was Intel hardware with no
floating point.  +- are as fast as the corresponding integer operations
and */ are a heck of a lot faster than emulated floating point.  There
are also things, such as RGB values, that cry out to be fixed point
fractions rather than integers from 0 .. 255, or 0 .. 64, or whwatever.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fixed-point
  1997-03-28  0:00 Fixed-point Jeff Carter
  1997-03-28  0:00 ` Fixed-point Tom Moran
@ 1997-03-28  0:00 ` Robert Dewar
  1997-03-29  0:00   ` Fixed-point the one and only real true kibo
  1997-03-29  0:00 ` Fixed-point Robert A Duff
  2 siblings, 1 reply; 7+ messages in thread
From: Robert Dewar @ 1997-03-28  0:00 UTC (permalink / raw)



Jeff Carter asks

<<Jack Crenshaw's "Programmer's Toolbox" column in *Embedded Systems
Programming* has been discussing implementing multiple precision
integers and fixed-point types in C++ for some time. I was wondering
when he'd address why you'd go to the effort, rather than use a language
with fixed-point type support. In the 1997 Apr issue, he does:

"The designers of Ada ... tried to get too fancy. Instead of restricting
the type to words commensurate with the natural word length of the
computer, they gave us a more general definition that allows for words
of any bit length and any resolution. ... [T]he end result was the same:
fixed-point operations are so slow in Ada that few people bother to use
the type, and many Ada shops prohibit their use as a matter programming
style."

Has anyone encountered this phenomenon?>>


Robet replies

I doubt anyone has "encountered this phenomenon" since the quotation
is complete nonsense, and shows that the author knows nothing about
fixed-point in Ada. There are some problems with fixed-point, especially
in Ada 83, but they are essenti9ally fixed in Ada 95. For a detailed
discussion of these problems, see my repot on fixed-point, this was
one of the SEI reports done for the Ada 9X development effort.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Fixed-point
@ 1997-03-28  0:00 Jeff Carter
  1997-03-28  0:00 ` Fixed-point Tom Moran
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jeff Carter @ 1997-03-28  0:00 UTC (permalink / raw)



Jack Crenshaw's "Programmer's Toolbox" column in *Embedded Systems
Programming* has been discussing implementing multiple precision
integers and fixed-point types in C++ for some time. I was wondering
when he'd address why you'd go to the effort, rather than use a language
with fixed-point type support. In the 1997 Apr issue, he does:

"The designers of Ada ... tried to get too fancy. Instead of restricting
the type to words commensurate with the natural word length of the
computer, they gave us a more general definition that allows for words
of any bit length and any resolution. ... [T]he end result was the same:
fixed-point operations are so slow in Ada that few people bother to use
the type, and many Ada shops prohibit their use as a matter programming
style."

Has anyone encountered this phenomenon? In my experience, with modern
compilers, fixed-point operations are not too slow, especially when
using a binary delta. However, I don't have sufficient amunition to
refute this. Perhaps one (or several) of the more knowlegeable out there
would like to take this on.

The editor-in-chief, Lindsey Vereen, is lvereen@mfi.com. Their web site
is www.embedded.com.
-- 
Jeff Carter
Innovative Concepts, Inc.

Now go away, or I shall taunt you a second time.

Unsolicited commercial e-mail will be invoiced at US $500 per piece.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fixed-point
  1997-03-28  0:00 ` Fixed-point Robert Dewar
@ 1997-03-29  0:00   ` the one and only real true kibo
  0 siblings, 0 replies; 7+ messages in thread
From: the one and only real true kibo @ 1997-03-29  0:00 UTC (permalink / raw)



-----BEGIN PGP SIGNED MESSAGE-----

On 28 Mar 1997 16:24:34 -0500 in article <dewar.859584171@merv> posted to comp.lang.ada, Robert Dewar <dewar@merv.cs.nyu.edu> wrote:
> Jeff Carter asks

> <<Jack Crenshaw's "Programmer's Toolbox" column in *Embedded Systems
> Programming* has been discussing implementing multiple precision
> integers and fixed-point types in C++ for some time. I was wondering
> when he'd address why you'd go to the effort, rather than use a language
> with fixed-point type support. In the 1997 Apr issue, he does:

> "The designers of Ada ... tried to get too fancy. Instead of restricting
> the type to words commensurate with the natural word length of the
> computer, they gave us a more general definition that allows for words
> of any bit length and any resolution. ... [T]he end result was the same:
> fixed-point operations are so slow in Ada that few people bother to use
> the type, and many Ada shops prohibit their use as a matter programming
> style."

> Has anyone encountered this phenomenon?>>


> Robet replies

> I doubt anyone has "encountered this phenomenon" since the quotation
> is complete nonsense, and shows that the author knows nothing about
> fixed-point in Ada. There are some problems with fixed-point, especially
> in Ada 83, but they are essenti9ally fixed in Ada 95. For a detailed
> discussion of these problems, see my repot on fixed-point, this was
> one of the SEI reports done for the Ada 9X development effort.

Fuckhead.

I am the only true <A HREF="http://www.dhp.com/~kibo">Kibo</A>.
Finger me for my PGP public key. Check out my home page for the coolest
way to vote on new newsgroup proposals or to issue Usenet cancels.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMz1NsKlPvImbzLKZAQHSEQP/WVx1dIqhZJgCd4cIM5NOFelJzJdS+B99
VdiaC2wE8mZPo/YRZMpNt29r7/goIcKrGG8HowmgsvQsPiQBLVD0JnxXBpjYBxtX
VKpyoT0x6RJVV+RMRfz1mrz0pl7D8WekVRJce2uEt0gtisP1Ai5HA0mCoZYLAytL
cRjXscwDRVk=
=vgk4
-----END PGP SIGNATURE-----




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fixed-point
  1997-03-28  0:00 Fixed-point Jeff Carter
  1997-03-28  0:00 ` Fixed-point Tom Moran
  1997-03-28  0:00 ` Fixed-point Robert Dewar
@ 1997-03-29  0:00 ` Robert A Duff
  1997-03-30  0:00   ` Fixed-point Larry Kilgallen
  2 siblings, 1 reply; 7+ messages in thread
From: Robert A Duff @ 1997-03-29  0:00 UTC (permalink / raw)



In article <333C08A7.446B9B3D@innocon.com>,
Jeff Carter  <carter@innocon.com> wrote:
>"The designers of Ada ... tried to get too fancy. Instead of restricting
>the type to words commensurate with the natural word length of the
>computer, they gave us a more general definition that allows for words
>of any bit length and any resolution. ... [T]he end result was the same:
>fixed-point operations are so slow in Ada that few people bother to use
>the type, and many Ada shops prohibit their use as a matter programming
>style."

Sounds like nonsense, to me.  Implementations of Ada's fixed-point types
*do* use "natural word length" to store data, and do operations.  And
the language definition encourages that.  So what's the problem?

It's probably true that "few people bother to use the type".  But I
don't think that's due to efficiency concerns about "natural word
lengths".

>Has anyone encountered this phenomenon? In my experience, with modern
>compilers, fixed-point operations are not too slow, especially when
>using a binary delta.

I think you mean "binary small".  The small is binary, by default, even
if the delta isn't.

>Now go away, or I shall taunt you a second time.

Heh?  Maybe I don't get the joke.  Your sig just sounds like you don't
want someone to answer your question.

- Bob




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fixed-point
  1997-03-29  0:00 ` Fixed-point Robert A Duff
@ 1997-03-30  0:00   ` Larry Kilgallen
  1997-04-11  0:00     ` Fixed-point Ken Garlington
  0 siblings, 1 reply; 7+ messages in thread
From: Larry Kilgallen @ 1997-03-30  0:00 UTC (permalink / raw)



In article <E7tuts.9D7@world.std.com>, bobduff@world.std.com (Robert A Duff) writes:
> In article <333C08A7.446B9B3D@innocon.com>,
> Jeff Carter  <carter@innocon.com> wrote:
>>"The designers of Ada ... tried to get too fancy. Instead of restricting
>>the type to words commensurate with the natural word length of the
>>computer, they gave us a more general definition that allows for words
>>of any bit length and any resolution. ... [T]he end result was the same:
>>fixed-point operations are so slow in Ada that few people bother to use
>>the type, and many Ada shops prohibit their use as a matter programming
>>style."
> 
> Sounds like nonsense, to me.  Implementations of Ada's fixed-point types
> *do* use "natural word length" to store data, and do operations.  And
> the language definition encourages that.  So what's the problem?

The problem is that while folks on this newsgroup so far unanimously
disagree with the published remarks, for the publication readership
the slam against Ada goes unchallenged. Someone who has experience
with fixed-point types should write a polite rebuttal and send it to
the publication.

Generally I see this soft of "call for rebuttal" on the Team Ada
mailing list, but I suppose finding such uniform opinion on c.l.a
is a good "trial by fire" for the concept of a rebuttal.

Larry Kilgallen




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fixed-point
  1997-03-30  0:00   ` Fixed-point Larry Kilgallen
@ 1997-04-11  0:00     ` Ken Garlington
  0 siblings, 0 replies; 7+ messages in thread
From: Ken Garlington @ 1997-04-11  0:00 UTC (permalink / raw)



Larry Kilgallen wrote:
> 
> In article <E7tuts.9D7@world.std.com>, bobduff@world.std.com (Robert A Duff) writes:
> > In article <333C08A7.446B9B3D@innocon.com>,
> > Jeff Carter  <carter@innocon.com> wrote:
> >>"The designers of Ada ... tried to get too fancy. Instead of restricting
> >>the type to words commensurate with the natural word length of the
> >>computer, they gave us a more general definition that allows for words
> >>of any bit length and any resolution. ... [T]he end result was the same:
> >>fixed-point operations are so slow in Ada that few people bother to use
> >>the type, and many Ada shops prohibit their use as a matter programming
> >>style."
> >
> > Sounds like nonsense, to me.  Implementations of Ada's fixed-point types
> > *do* use "natural word length" to store data, and do operations.  And
> > the language definition encourages that.  So what's the problem?
> 
> The problem is that while folks on this newsgroup so far unanimously
> disagree with the published remarks, for the publication readership
> the slam against Ada goes unchallenged. Someone who has experience
> with fixed-point types should write a polite rebuttal and send it to
> the publication.

Some comments:

(1) One important sentence was left out of this quote
(the last ellipse):

"I've never been quite clear as to whether the problem came
from this very general (and somewhat unrealistic) definition,
or simply from the fact that the compiler builders weren't
interested in fixed-point arithmetic and tended to add it as
an afterthought."

There are certainly some compilers out there that do not
perform fixed-point efficiently. Since Mr. Crenshaw does say
that he's not sure why this is the case, I don't think it's
fair to call his comments "nonsense".

(2) There's some other context that's left out as well. Mr.
Crenshaw's series is on how to do fixed point efficiently
in C/C++. He provides actual C/C++ code to do this. I've been
translating this code into Ada, and I do find it to be quite
efficient - more so that the Ada built-in fixed point type,
for my particular Ada compiler. Any rebuttal should include
actual results comparing Mr. Crenshaw's algorithms to the ones
used in a particular Ada implementation. Of course, Mr.
Crenshaw's algorithms limit the type range, etc. - which I
believe was his point.

(3) Although the article does say that Ada is inefficient,
his remarks should be compared to what he says about other
languages:

"This discussion gives me an excuse to vent one of my major
frustrations against high-order languages like C, C++, and
Pascal. The designers of the CPUs are well aware that the
product of two N-bit numbers is a 2N-bit result. Virtually
every processor that supports multiplication at all provides
for this double-length product. The CPU isn't the problem,
the language that hides that double-length result is....
At least two languages [JOVIAL and Ada] have attempted
to provide for true fixed-point arithmetic... JOVIAL is
now used only for maintaining aerospace software that
hasn't yet been converted to Ada."

(4) Here's some information if anyone wants to write
a letter to the editor:

Embedded Systems Programming
Volume 10, Number 4 (April 1997)
"More on Multiplication," Programmer's Toolbox by
Jack W. Crenshaw.

Mr. Crenshaw can be reached at 72325.1327@compuserve.com.
Editor-in-chief Lindsey Vereen can be reached at
lvereen@mfi.com.

ESP has a web page at www.embedded.com. The April '97
issue is at http://www.embedded.com/97/toc9704.htm
but unfortunately this column isn't included.

> 
> Generally I see this soft of "call for rebuttal" on the Team Ada
> mailing list, but I suppose finding such uniform opinion on c.l.a
> is a good "trial by fire" for the concept of a rebuttal.
> 
> Larry Kilgallen

--
LMTAS - The Fighter Enterprise - "Our Brand Means Quality"
For job listings, other info: http://www.lmtas.com or
http://www.lmco.com




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1997-04-11  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-28  0:00 Fixed-point Jeff Carter
1997-03-28  0:00 ` Fixed-point Tom Moran
1997-03-28  0:00 ` Fixed-point Robert Dewar
1997-03-29  0:00   ` Fixed-point the one and only real true kibo
1997-03-29  0:00 ` Fixed-point Robert A Duff
1997-03-30  0:00   ` Fixed-point Larry Kilgallen
1997-04-11  0:00     ` Fixed-point Ken Garlington

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox