comp.lang.ada
 help / color / mirror / Atom feed
* Re: Announce: The Ultimate SI Units Cracker
@ 2002-09-13  5:34 Grein, Christoph
  0 siblings, 0 replies; 20+ messages in thread
From: Grein, Christoph @ 2002-09-13  5:34 UTC (permalink / raw)


From: Jeffrey Creem <jeff@thecreems.com>

> 50 Hz...Luxury  :)
> I've yet to work on anything slower than 100Hz and some are 3.2 KHz..

Cool... But let me nitpick: Kilo is abbreviated with lower case k: 3.2 kHz



^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: Announce: The Ultimate SI Units Cracker
@ 2002-09-13  4:53 Grein, Christoph
  2002-09-13 14:34 ` Ira Baxter
  2002-09-13 15:41 ` Wes Groleau
  0 siblings, 2 replies; 20+ messages in thread
From: Grein, Christoph @ 2002-09-13  4:53 UTC (permalink / raw)


From: Wes Groleau <wesgroleau@despammed.com>
> 
> Since Ada has a 'special' meaning for attribute, perhaps
> 'component' or 'discriminant' would be better.

Perhaps 'component', but not 'discriminant', since only one variant really uses 
discriminants.
I decided against component, because the type is private and you do not see 
components. I used attribute since the OO community likes to call what Ada does 
with components, instance attributes.

> Anyway, looks nice.  I once implemented a package with
> the 'derived types' approach, and I agree that creating
> all the operations is a pain.  I had a generic for each operator,
> but it was Ada 83, so the instantiations had to be in the spec,
> making the spec over 4,000 lines long.  Someone with a little
> authority thought a 4,000 line spec was unacceptable, so he
> rewrote it non-generic, reducing the spec down to "only" 3,000
> lines (and increasing the body from less than 50 to over 5,000).

And what's most unsatisfactory is that despite all these overloadings, you 
cannot get

  function "**" (Base: SI_Unit; Exp: Rational) return SI_Unit;

> I like the discriminant approach, but it does have another
> disadvantage in that a lot of numeric operations are lost.
> 
> You can't query 'First, 'Last, 'Small, etc.  But maybe when
> dealing with physical units those don't really matter much.
> And of course the package can provide substitutes.
> 
> You also can't provide such a type as a generic formal
> where a float or fixed is expected.  (Speaking of which,
> perhaps a fixed-point version of SI would be useful to someone.)
>
> ... [text omitted]
> 
> What I'm getting at is the ability to define a private type
> so that it has all the attributes and operations of a numeric
> type and can be use as a generic parameter to a numeric package.

That would be really cool, perhaps with some Ada0Y features...
But then it's not clear what e.g. a generic should do with the non-numeric 
components. It could just ignore them. But then how should a function know what 
to return if the actual for the formal T is SI_Unit?

generic
  type T is digits <>;
function F (X, Y: T) return T;

Perhaps this could work only for a private type that is tagged. Would this be a 
proposal for Ada0Y? If so, we would need a convincing example for the ARG of a 
problem that can be solved with such a new feature that cannot be solved nicely 
without it...



^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: Announce: The Ultimate SI Units Cracker
@ 2002-09-12 11:59 Grein, Christoph
  0 siblings, 0 replies; 20+ messages in thread
From: Grein, Christoph @ 2002-09-12 11:59 UTC (permalink / raw)


> Also note that the page seems to make the somewhat incorrect assumption
> that hard real-time implies "fast".
> 
> Hard real-time just means you can never miss a deadline (where soft
> real-time
> means that you can sometimes miss some deadlines but not often).
> 
> While these terms vary from author to author, it has been my experience that
> these are pretty close to the generally accepted definitions.

As I have always heard the term being used, hard RT meant short cycle times (50Hz), 
soft RT meant long times (weather forecast _is_ time-critical, but the limit is 
one day or so).

I'm in the avionics business and we always call our system hard-real time.
OK, it must not miss a deadline, and it must be fast. So it fulfills both 
definitions.



^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: Announce: The Ultimate SI Units Cracker
@ 2002-09-12 11:51 Grein, Christoph
  0 siblings, 0 replies; 20+ messages in thread
From: Grein, Christoph @ 2002-09-12 11:51 UTC (permalink / raw)


> On Thu, 12 Sep 2002 10:11:43 +0200 (MET DST), Grein, Christoph wrote:
> > 
> > See <http://home.T-Online.de/home/Christ-Usch.Grein/Ada/SI.html>
> > 
> > It has been released under GMGPL. Enjoy...
> 
> I cannot find any download link in the URL above.
> 

Oops, I'll check it this evening when I'm at home. It should be near to the 
bottom of the page.

Anyway, the download file is

<http://home.T-Online.de/home/Christ-Usch.Grein/Ada/SI.zip>



^ permalink raw reply	[flat|nested] 20+ messages in thread
* Announce: The Ultimate SI Units Cracker
@ 2002-09-12  8:11 Grein, Christoph
  2002-09-12 10:14 ` Preben Randhol
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Grein, Christoph @ 2002-09-12  8:11 UTC (permalink / raw)


The ultimate SI Units cracker is there!

There has always been a demand to be able to compute with physical items where 
correctness of dimensions is checked, but to me, all previous attempts seemed 
unsatisfactory (and there were many) - now it's there, in full generality, 
including arbitrary powers and roots.

Yes - it's run-time consuming since the dimension is an attribute
No  - it's not precluded from being used for hard real-time systems
Yes - it can be applied under hard real-time conditions if it's done correctly
Yes - it's easy to switch off dimensions - only pure numerics remains

See <http://home.T-Online.de/home/Christ-Usch.Grein/Ada/SI.html>

It has been released under GMGPL. Enjoy...

                                 o     _      _          _
 --------- __o       __o      /\_    _ \\o   (_)\__/o   (_)
 ------- _`\<,_    _`\<,_    _>(_)  (_)/<_     \_| \    _|/' \/
 ------ (_)/ (_)  (_)/ (_)  (_)         (_)    (_)     (_)'  _\o_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mein Radunfall
My bike accident


Christoph Grein
Mitglied von Ada-Deutschland
Member of Ada Germany
http:/www.ada-deutschland.de

http://home.T-Online.de/home/Christ-Usch.Grein
eMail: Christ-Usch.Grein@T-Online.de



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

end of thread, other threads:[~2002-09-16 10:22 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-13  5:34 Announce: The Ultimate SI Units Cracker Grein, Christoph
  -- strict thread matches above, loose matches on Subject: below --
2002-09-13  4:53 Grein, Christoph
2002-09-13 14:34 ` Ira Baxter
2002-09-13 20:50   ` Stephen Leake
2002-09-16 10:22   ` Fraser Wilson
2002-09-13 15:41 ` Wes Groleau
2002-09-12 11:59 Grein, Christoph
2002-09-12 11:51 Grein, Christoph
2002-09-12  8:11 Grein, Christoph
2002-09-12 10:14 ` Preben Randhol
2002-09-12 10:50 ` Jeffrey Creem
2002-09-12 14:06 ` Wes Groleau
2002-09-12 17:06   ` Randy Brukardt
2002-09-13 15:20     ` Wes Groleau
2002-09-13 20:54       ` Randy Brukardt
2002-09-13 22:09   ` Dmitry A.Kazakov
2002-09-13 15:26     ` Wes Groleau
2002-09-15  6:21       ` Dmitry A.Kazakov
2002-09-15  0:24         ` Mark Biggar
2002-09-16  1:35           ` Dmitry A.Kazakov

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