comp.lang.ada
 help / color / mirror / Atom feed
* Simplest Ada program
@ 2016-11-21  8:22 Mr. Man-wai Chang
  2016-11-21  8:25 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 19+ messages in thread
From: Mr. Man-wai Chang @ 2016-11-21  8:22 UTC (permalink / raw)



Can someone here write one?


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

* Re: Simplest Ada program
  2016-11-21  8:22 Simplest Ada program Mr. Man-wai Chang
@ 2016-11-21  8:25 ` Dmitry A. Kazakov
  2016-11-21  8:27   ` Mr. Man-wai Chang
  0 siblings, 1 reply; 19+ messages in thread
From: Dmitry A. Kazakov @ 2016-11-21  8:25 UTC (permalink / raw)


On 21/11/2016 09:22, Mr. Man-wai Chang wrote:
>
> Can someone here write one?

procedure Simplest is
begin
    null;
end Simplest;

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


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

* Re: Simplest Ada program
  2016-11-21  8:25 ` Dmitry A. Kazakov
@ 2016-11-21  8:27   ` Mr. Man-wai Chang
  2016-11-21  8:41     ` Dmitry A. Kazakov
  0 siblings, 1 reply; 19+ messages in thread
From: Mr. Man-wai Chang @ 2016-11-21  8:27 UTC (permalink / raw)


On 21/11/2016 4:25 PM, Dmitry A. Kazakov wrote:
> On 21/11/2016 09:22, Mr. Man-wai Chang wrote:
>>
>> Can someone here write one?
>
> procedure Simplest is
> begin
>    null;
> end Simplest;

Thanks, Master! How much time is needed to run this program?

BTW, this syntax really looks like Pascal if not Delphi!

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

* Re: Simplest Ada program
  2016-11-21  8:27   ` Mr. Man-wai Chang
@ 2016-11-21  8:41     ` Dmitry A. Kazakov
  2016-11-21  8:57       ` Mr. Man-wai Chang
  0 siblings, 1 reply; 19+ messages in thread
From: Dmitry A. Kazakov @ 2016-11-21  8:41 UTC (permalink / raw)


On 21/11/2016 09:27, Mr. Man-wai Chang wrote:
> On 21/11/2016 4:25 PM, Dmitry A. Kazakov wrote:
>> On 21/11/2016 09:22, Mr. Man-wai Chang wrote:
>>>
>>> Can someone here write one?
>>
>> procedure Simplest is
>> begin
>>    null;
>> end Simplest;
>
> Thanks, Master! How much time is needed to run this program?

Which time? Programmer's time? CPU time? Compiler tool-chain time?

> BTW, this syntax really looks like Pascal if not Delphi!

Pascal was a common ancestor of both Ada and Delphi.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


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

* Re: Simplest Ada program
  2016-11-21  8:41     ` Dmitry A. Kazakov
@ 2016-11-21  8:57       ` Mr. Man-wai Chang
  2016-11-21  9:17         ` Dmitry A. Kazakov
  0 siblings, 1 reply; 19+ messages in thread
From: Mr. Man-wai Chang @ 2016-11-21  8:57 UTC (permalink / raw)


On 21/11/2016 4:41 PM, Dmitry A. Kazakov wrote:
>>> procedure Simplest is
>>> begin
>>>    null;
>>> end Simplest;
>>
>> Thanks, Master! How much time is needed to run this program?
>
> Which time? Programmer's time? CPU time? Compiler tool-chain time?

Good point!!!! Let's talk CPU time.

> Pascal was a common ancestor of both Ada and Delphi.

I wasn't aware of this when I was taught about it.


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

* Re: Simplest Ada program
  2016-11-21  8:57       ` Mr. Man-wai Chang
@ 2016-11-21  9:17         ` Dmitry A. Kazakov
  2016-11-21 11:38           ` Mr. Man-wai Chang
  0 siblings, 1 reply; 19+ messages in thread
From: Dmitry A. Kazakov @ 2016-11-21  9:17 UTC (permalink / raw)


On 21/11/2016 09:57, Mr. Man-wai Chang wrote:
> On 21/11/2016 4:41 PM, Dmitry A. Kazakov wrote:
>>>> procedure Simplest is
>>>> begin
>>>>    null;
>>>> end Simplest;
>>>
>>> Thanks, Master! How much time is needed to run this program?
>>
>> Which time? Programmer's time? CPU time? Compiler tool-chain time?
>
> Good point!!!! Let's talk CPU time.

   OS loader/linker time
+ Ada run-time elaboration time
+ 0 execution time
+ Ada run-time finalization time
+ OS finalization time

If you need figures you must measure it yourself.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

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

* Re: Simplest Ada program
  2016-11-21  9:17         ` Dmitry A. Kazakov
@ 2016-11-21 11:38           ` Mr. Man-wai Chang
  2016-11-21 14:41             ` Dmitry A. Kazakov
  0 siblings, 1 reply; 19+ messages in thread
From: Mr. Man-wai Chang @ 2016-11-21 11:38 UTC (permalink / raw)


On 21/11/2016 5:17 PM, Dmitry A. Kazakov wrote:
>   OS loader/linker time
> + Ada run-time elaboration time
> + 0 execution time
> + Ada run-time finalization time
> + OS finalization time

So the linker of your Ada compiler can predict execution time of an Ada 
program? What is it?

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

* Re: Simplest Ada program
  2016-11-21 11:38           ` Mr. Man-wai Chang
@ 2016-11-21 14:41             ` Dmitry A. Kazakov
  2016-11-21 14:57               ` G.B.
  2016-11-21 14:58               ` Mr. Man-wai Chang
  0 siblings, 2 replies; 19+ messages in thread
From: Dmitry A. Kazakov @ 2016-11-21 14:41 UTC (permalink / raw)


On 21/11/2016 12:38, Mr. Man-wai Chang wrote:
> On 21/11/2016 5:17 PM, Dmitry A. Kazakov wrote:
>>   OS loader/linker time
>> + Ada run-time elaboration time
>> + 0 execution time
>> + Ada run-time finalization time
>> + OS finalization time
>
> So the linker of your Ada compiler can predict execution time of an Ada
> program?

Loader is a part of OS. E.g. ld under Linux.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

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

* Re: Simplest Ada program
  2016-11-21 14:41             ` Dmitry A. Kazakov
@ 2016-11-21 14:57               ` G.B.
  2016-11-21 14:58               ` Mr. Man-wai Chang
  1 sibling, 0 replies; 19+ messages in thread
From: G.B. @ 2016-11-21 14:57 UTC (permalink / raw)


On 21.11.16 15:41, Dmitry A. Kazakov wrote:
> On 21/11/2016 12:38, Mr. Man-wai Chang wrote:
>> On 21/11/2016 5:17 PM, Dmitry A. Kazakov wrote:
>>>   OS loader/linker time
>>> + Ada run-time elaboration time
>>> + 0 execution time
>>> + Ada run-time finalization time
>>> + OS finalization time
>>
>> So the linker of your Ada compiler can predict execution time of an Ada
>> program?
>
> Loader is a part of OS. E.g. ld under Linux.

Consequently, when more control over run-time requirements is
possible, such as when bootstrapping a statically bound sequential
program that does nothing, then the only time it takes is placing
the program where it becomes ready for executing its 0 instructions...

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

* Re: Simplest Ada program
  2016-11-21 14:41             ` Dmitry A. Kazakov
  2016-11-21 14:57               ` G.B.
@ 2016-11-21 14:58               ` Mr. Man-wai Chang
  2016-11-21 22:20                 ` Niklas Holsti
  1 sibling, 1 reply; 19+ messages in thread
From: Mr. Man-wai Chang @ 2016-11-21 14:58 UTC (permalink / raw)


On 21/11/2016 10:41 PM, Dmitry A. Kazakov wrote:
>
> Loader is a part of OS. E.g. ld under Linux.
>

Could you compile your simplest Ada programs in other platforms and run 
loaders to time each executable?

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

* Re: Simplest Ada program
  2016-11-21 14:58               ` Mr. Man-wai Chang
@ 2016-11-21 22:20                 ` Niklas Holsti
  2016-11-24 19:26                   ` Jacob Sparre Andersen
  2016-11-25  9:04                   ` Mr. Man-wai Chang
  0 siblings, 2 replies; 19+ messages in thread
From: Niklas Holsti @ 2016-11-21 22:20 UTC (permalink / raw)


On 16-11-21 16:58 , Mr. Man-wai Chang wrote:
> On 21/11/2016 10:41 PM, Dmitry A. Kazakov wrote:
>>
>> Loader is a part of OS. E.g. ld under Linux.
>>
>
> Could you compile your simplest Ada programs in other platforms and run
> loaders to time each executable?

Of course one could do that, but why? The "simplest Ada program" is not 
useful for anything, so why is its start-up time of interest? Any real 
program will have a different (probably larger) start-up time, plus the 
time it takes to actually do something.

What do you _really_ want to know?

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .

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

* Re: Simplest Ada program
  2016-11-21 22:20                 ` Niklas Holsti
@ 2016-11-24 19:26                   ` Jacob Sparre Andersen
  2016-11-25  9:04                   ` Mr. Man-wai Chang
  1 sibling, 0 replies; 19+ messages in thread
From: Jacob Sparre Andersen @ 2016-11-24 19:26 UTC (permalink / raw)


Niklas Holsti wrote:

> Of course one could do that, but why? The "simplest Ada program" is
> not useful for anything, so why is its start-up time of interest? Any
> real program will have a different (probably larger) start-up time,
> plus the time it takes to actually do something.

I have a non-trivial program (it does something useful), which starts in
1.25e-6 seconds.

> What do you _really_ want to know?

That's a good question.

Greetings,

Jacob
-- 
<URL: small-talk://work/hallway-meeting/...>

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

* Re: Simplest Ada program
  2016-11-21 22:20                 ` Niklas Holsti
  2016-11-24 19:26                   ` Jacob Sparre Andersen
@ 2016-11-25  9:04                   ` Mr. Man-wai Chang
  2016-11-25  9:19                     ` Dmitry A. Kazakov
  2016-11-25 22:53                     ` Niklas Holsti
  1 sibling, 2 replies; 19+ messages in thread
From: Mr. Man-wai Chang @ 2016-11-25  9:04 UTC (permalink / raw)


On 22/11/2016 6:20 AM, Niklas Holsti wrote:
>> Could you compile your simplest Ada programs in other platforms and run
>> loaders to time each executable?
>
> Of course one could do that, but why? The "simplest Ada program" is not
> useful for anything, so why is its start-up time of interest? Any real
> program will have a different (probably larger) start-up time, plus the
> time it takes to actually do something.

It should give you the minimum amount of time to run an Ada program in a 
one-user operating system?

> What do you _really_ want to know?

How do you benchmark real-time Ada programs? ;)


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

* Re: Simplest Ada program
  2016-11-25  9:04                   ` Mr. Man-wai Chang
@ 2016-11-25  9:19                     ` Dmitry A. Kazakov
  2016-11-25  9:24                       ` Mr. Man-wai Chang
  2016-11-25 22:53                     ` Niklas Holsti
  1 sibling, 1 reply; 19+ messages in thread
From: Dmitry A. Kazakov @ 2016-11-25  9:19 UTC (permalink / raw)


On 25/11/2016 10:04, Mr. Man-wai Chang wrote:

> How do you benchmark real-time Ada programs? ;)

Real-time means "on time", not earlier or later, not "as soon as possible".

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


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

* Re: Simplest Ada program
  2016-11-25  9:19                     ` Dmitry A. Kazakov
@ 2016-11-25  9:24                       ` Mr. Man-wai Chang
  2016-11-25 16:23                         ` Chris Moore
  0 siblings, 1 reply; 19+ messages in thread
From: Mr. Man-wai Chang @ 2016-11-25  9:24 UTC (permalink / raw)


On 25/11/2016 5:19 PM, Dmitry A. Kazakov wrote:
> On 25/11/2016 10:04, Mr. Man-wai Chang wrote:
>
>> How do you benchmark real-time Ada programs? ;)
>
> Real-time means "on time", not earlier or later, not "as soon as possible".

Was US airports using real-time software written in Ada?

FYI:
Delayed take-off: Further hold up for HK$1.5 billion Raytheon AutoTrac 
III air traffic control system
http://www.scmp.com/news/hong-kong/politics/article/1930053/delayed-take-further-hold-hk15-billion-raytheon-autotrac-iii

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

* Re: Simplest Ada program
  2016-11-25  9:24                       ` Mr. Man-wai Chang
@ 2016-11-25 16:23                         ` Chris Moore
  2016-11-25 16:29                           ` Mr. Man-wai Chang
  0 siblings, 1 reply; 19+ messages in thread
From: Chris Moore @ 2016-11-25 16:23 UTC (permalink / raw)


On 25/11/2016 09:24, Mr. Man-wai Chang wrote:
> On 25/11/2016 5:19 PM, Dmitry A. Kazakov wrote:
>> On 25/11/2016 10:04, Mr. Man-wai Chang wrote:
>>
>>> How do you benchmark real-time Ada programs? ;)
>>
>> Real-time means "on time", not earlier or later, not "as soon as
>> possible".
>
> Was US airports using real-time software written in Ada?
>
> FYI:
> Delayed take-off: Further hold up for HK$1.5 billion Raytheon AutoTrac
> III air traffic control system
> http://www.scmp.com/news/hong-kong/politics/article/1930053/delayed-take-further-hold-hk15-billion-raytheon-autotrac-iii

Nothing in the article mentions Ada specifically but "The system itself, 
in terms of reliability and safety, is free of problems" suggests that 
it is.  Sometimes problems with complex systems aren't with the language 
it was programmed in.  In this case training people to use the system 
seems to be the issue.  Next?


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

* Re: Simplest Ada program
  2016-11-25 16:23                         ` Chris Moore
@ 2016-11-25 16:29                           ` Mr. Man-wai Chang
  0 siblings, 0 replies; 19+ messages in thread
From: Mr. Man-wai Chang @ 2016-11-25 16:29 UTC (permalink / raw)


On 26/11/2016 12:23 AM, Chris Moore wrote:
> Nothing in the article mentions Ada specifically but "The system itself,
> in terms of reliability and safety, is free of problems" suggests that
> it is.  Sometimes problems with complex systems aren't with the language
> it was programmed in.  In this case training people to use the system
> seems to be the issue.  Next?

Thank you, Master. I wondered whether it's written in C on a modified 
Linux... :)


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

* Re: Simplest Ada program
  2016-11-25  9:04                   ` Mr. Man-wai Chang
  2016-11-25  9:19                     ` Dmitry A. Kazakov
@ 2016-11-25 22:53                     ` Niklas Holsti
  2016-11-26 11:58                       ` Mr. Man-wai Chang
  1 sibling, 1 reply; 19+ messages in thread
From: Niklas Holsti @ 2016-11-25 22:53 UTC (permalink / raw)


On 16-11-25 11:04 , Mr. Man-wai Chang wrote:
> On 22/11/2016 6:20 AM, Niklas Holsti wrote:
>>> Could you compile your simplest Ada programs in other platforms and run
>>> loaders to time each executable?
>>
>> Of course one could do that, but why? The "simplest Ada program" is not
>> useful for anything, so why is its start-up time of interest? Any real
>> program will have a different (probably larger) start-up time, plus the
>> time it takes to actually do something.
>
> It should give you the minimum amount of time to run an Ada program in a
> one-user operating system?

And why do you want to know that? This program does nothing.

But ok, ok, so I did this:

- Compiled the following program:

    procedure Nothing
    is
    begin
       null;
    end Nothing;

- Timed this command as 3.176 sec:

    seq 1000 | while read x; do x=""; ./nothing; done

- Subtracted the time of the corresponding command with the
   ./nothing removed, which was 0.031 s

- Divided by 1000 to get an average time of 3.145 ms per execution
   of ./nothing.

This was on a MacBook Air, 2.13 GHz Intel Core 2 Duo, 4 GB 1067 MHz DDR 
RAM, SSD.

>> What do you _really_ want to know?
>
> How do you benchmark real-time Ada programs? ;)

"Benchmark"?

Real-time Ada programs in my area run in embedded machines, bare-board 
or with an Ada RTS. They start up from EEPROM and then run "forever". We 
analyse the code statically for worst-case time, or measure on the 
target board. Start-up time on a personal computer OS is irrelevant.

"Benchmarks" in the sense of standard programs that one compiles and 
executes in order to gauge the relative speeds of different target 
systems or the efficiency of the code generated by different compilers 
are not very relevant in this area, IMO. The hot spots of processor 
loading are often application-specific and then do not match typical 
benchmarks.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .

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

* Re: Simplest Ada program
  2016-11-25 22:53                     ` Niklas Holsti
@ 2016-11-26 11:58                       ` Mr. Man-wai Chang
  0 siblings, 0 replies; 19+ messages in thread
From: Mr. Man-wai Chang @ 2016-11-26 11:58 UTC (permalink / raw)


On 26/11/2016 6:53 AM, Niklas Holsti wrote:
>>
>> It should give you the minimum amount of time to run an Ada program in a
>> one-user operating system?
>
> And why do you want to know that? This program does nothing.
>
> But ok, ok, so I did this:
 >
> ... computer laboratory report ...

Thank you, Master! ;)


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

end of thread, other threads:[~2016-11-26 11:58 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-21  8:22 Simplest Ada program Mr. Man-wai Chang
2016-11-21  8:25 ` Dmitry A. Kazakov
2016-11-21  8:27   ` Mr. Man-wai Chang
2016-11-21  8:41     ` Dmitry A. Kazakov
2016-11-21  8:57       ` Mr. Man-wai Chang
2016-11-21  9:17         ` Dmitry A. Kazakov
2016-11-21 11:38           ` Mr. Man-wai Chang
2016-11-21 14:41             ` Dmitry A. Kazakov
2016-11-21 14:57               ` G.B.
2016-11-21 14:58               ` Mr. Man-wai Chang
2016-11-21 22:20                 ` Niklas Holsti
2016-11-24 19:26                   ` Jacob Sparre Andersen
2016-11-25  9:04                   ` Mr. Man-wai Chang
2016-11-25  9:19                     ` Dmitry A. Kazakov
2016-11-25  9:24                       ` Mr. Man-wai Chang
2016-11-25 16:23                         ` Chris Moore
2016-11-25 16:29                           ` Mr. Man-wai Chang
2016-11-25 22:53                     ` Niklas Holsti
2016-11-26 11:58                       ` Mr. Man-wai Chang

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