comp.lang.ada
 help / color / mirror / Atom feed
* Ada versus Pascal
@ 2021-10-22  3:29 711 Spooky Mart
  2021-10-22  6:18 ` ldries46
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: 711 Spooky Mart @ 2021-10-22  3:29 UTC (permalink / raw)


The little snippets of Ada code I've seen look _alot_ like Pascal.

What degree of learning curve is there to learn Ada, coming from a
Pascal background? What kind of rough timeframes to get comfortable with
programming without always looking to the manuals?

Where is the best starting point for a Pascal programmer to get up and
running with Ada?

-- 
  ┏━━━━┓──┏━━┓───┏━━┓──  ┌────────────────────────┐ ┌────────┐
  ┗━━┓─┃──┗┓─┃───┗┓─┃──  │ Spooky Mart [chan] 711 │ │ always │
  ───┃─┃──┏┛─┗┓──┏┛─┗┓─  │ https://bitmessage.org │ │  open  │
  ───┗━┛──┗━━━┛──┗━━━┛─  └────────────────────────┘ └────────┘



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

* Re: Ada versus Pascal
  2021-10-22  3:29 Ada versus Pascal 711 Spooky Mart
@ 2021-10-22  6:18 ` ldries46
  2021-10-22  9:59   ` 711 Spooky Mart
  2021-10-22  6:40 ` Paul Rubin
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: ldries46 @ 2021-10-22  6:18 UTC (permalink / raw)


Op 22-10-2021 om 5:29 schreef 711 Spooky Mart:
> The little snippets of Ada code I've seen look _alot_ like Pascal.
>
> What degree of learning curve is there to learn Ada, coming from a
> Pascal background? What kind of rough timeframes to get comfortable with
> programming without always looking to the manuals?
>
> Where is the best starting point for a Pascal programmer to get up and
> running with Ada?
>
I have learned programming in 1966/1967 in Algol 60. As seen i the Algol 
report that can be found on internet Algol 60 is mostly a language for 
defining algorithms. It does not defines Input and Output procedures. 
Pascal is one of the languages that have Algol 60 as a predecessor as is 
Ada. I did learn Pascal  from some course and later on I did learn Ada, 
the latter by just reading the book "Software Engineering with Ada" by 
Grady Booch. That was Ada 85. The first version of Ada. Ada is stricter 
than other languages and is meant to have NO Operating system dependant 
items, so if you cannot go around something there must be a package on 
each operating system having the same interface everywhere.

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

* Re: Ada versus Pascal
  2021-10-22  3:29 Ada versus Pascal 711 Spooky Mart
  2021-10-22  6:18 ` ldries46
@ 2021-10-22  6:40 ` Paul Rubin
  2021-10-22  8:57 ` Niklas Holsti
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 23+ messages in thread
From: Paul Rubin @ 2021-10-22  6:40 UTC (permalink / raw)


711 Spooky Mart <711@spooky.mart> writes:
> What degree of learning curve is there to learn Ada, coming from a
> Pascal background? What kind of rough timeframes to get comfortable with
> programming without always looking to the manuals?

Ada is not that hard to get started with, but it has orders of magnitude
more stuff in it than Pascal does, and getting familiar with all the
intricacies is a big task.  I've fooled with Ada a little, I consider
myself a language geek, I've been following this newsgroup on and off
for years, but I can't understand that many of the discussions I see
here.

If I wanted to do something serious with Ada, I'd start by working
through an in-depth textbook rather than just an intro or tutorial.

For just getting started, I used "Ada Distilled" (easy to find online).
It is pretty good, but there is an enormous amount of material that it
doesn't cover.

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

* Re: Ada versus Pascal
  2021-10-22  3:29 Ada versus Pascal 711 Spooky Mart
  2021-10-22  6:18 ` ldries46
  2021-10-22  6:40 ` Paul Rubin
@ 2021-10-22  8:57 ` Niklas Holsti
  2021-10-22 11:49 ` Jeffrey R.Carter
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 23+ messages in thread
From: Niklas Holsti @ 2021-10-22  8:57 UTC (permalink / raw)


On 2021-10-22 6:29, 711 Spooky Mart wrote:
> The little snippets of Ada code I've seen look _alot_ like Pascal.


Yes. Pascal syntax had a lot of influence on Ada syntax. But, as others 
have said, (current) Ada has a lot more features than (original) Pascal.

Very roughly speaking, and off the cuff, Ada has evolved as follows, 
which also gives you a list of the main things to learn, in addition to 
the Pascal base:

- Ada 83: Pascal + much improved type system + modules (packages) + 
exception handling + generic programming + concurrency (tasks)

- Ada 95: added modular (unsigned) integer types, object-oriented 
programming (classes = tagged types), package hierarchies (child 
packages), and asynchronous inter-task communication (protected objects)

- Ada 2005: added Java-like interface types (limited multiple 
inheritance), a standard container library, and further standard libraries

- Ada 2012: added support for program proof and logical run-time checks 
(preconditions, postconditions, type predicates), more forms of 
expressions (if expressions, case expressions, quantified expressions), 
and more standard libraries.

- Ada 2022 (upcoming): adds fine-grained parallel execution, extends the 
ability to do static (compile-time) computations, adds library packages 
for arbitrary-precision and arbitrary-range integer and real arithmetic 
("bignums"), and makes lots of sundry improvements.


> What degree of learning curve is there to learn Ada, coming from a
> Pascal background? What kind of rough timeframes to get comfortable with
> programming without always looking to the manuals?


As you can see from the list above, there is quite a lot to learn before 
you know _all_ of Ada. A Pascal-like subset should not be hard to learn, 
and if you learn the rest of the features in more or less the same order 
as they were added to Ada, you will pass from one consistent, working 
language subset to a larger such subset at each step.

The only point where I suggest to learn features in a different order is 
in inter-task communication: asynchronous communication via protected 
objects is much easier than was the original, synchronous rendez-vous 
method in Ada 83 (but which is of course still supported).


> Where is the best starting point for a Pascal programmer to get up and
> running with Ada?


I think this depends a lot on how you like to learn - by reading 
technical text (manuals) or by experimentation. I'm a "read the manual" 
type (I learned Ada from the Ada 83 Reference Manual) so perhaps I would 
start with the Ada Wikibook at 
https://en.m.wikibooks.org/wiki/Ada_Programming, which extends up to the 
2012 Ada standard (or so it claims, I haven't really read it, but I've 
heard good reports of it).

Perhaps you could take one of your smaller Pascal programs and translate 
it to Ada as a first step? As the next step, you could divide that 
program into packages, then add exception handling. And then take a new 
problem and write an Ada program from scratch.

Ask for help here, or in some other Ada forum, whenever in doubt about 
something.

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

* Re: Ada versus Pascal
  2021-10-22  6:18 ` ldries46
@ 2021-10-22  9:59   ` 711 Spooky Mart
  2021-10-22 15:12     ` Niklas Holsti
  0 siblings, 1 reply; 23+ messages in thread
From: 711 Spooky Mart @ 2021-10-22  9:59 UTC (permalink / raw)


On 10/22/21 1:18 AM, ldries46 wrote:

[...]

> Ada is stricter
> than other languages and is meant to have NO Operating system dependant
> items, so if you cannot go around something there must be a package on
> each operating system having the same interface everywhere.

By this do you mean the same syntax and libs will run on all target
systems without fiddling with {IFDEF} and architecture compiler switch
woo foo for USES and repetitive cross-arch boilerplate?

One thing I can't stand about Pascal is the totally different functions
and logic from several operating systems that MUST be re-written several
times in the same code base to do the same job. This drives me mad. In
fact it irks me so much I was thinking of writing some libraries for
things I do that would handle this all automatically across arches.
There would go a couple months of Sundays.

Think IPC with Pascal. Get a good IPC routine going for Linux in your
app, then you have to re-write it for MAC and Windows, and even some
other flavors of *nix.

So am I to understand that the Ada compiler has somehow eliminated this
problem, by ensuring every target OS has a syntactically conformant
package to execute its methods using the same statements?

If I'm understanding you rightly, even though Ada sounds like a much
more complex language than Pascal, it also sounds like it would have
less surprises across arches.

Please elaborate if I'm misunderstanding. And thanks to everyone else
who has responded.

711

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

* Re: Ada versus Pascal
  2021-10-22  3:29 Ada versus Pascal 711 Spooky Mart
                   ` (2 preceding siblings ...)
  2021-10-22  8:57 ` Niklas Holsti
@ 2021-10-22 11:49 ` Jeffrey R.Carter
  2021-10-22 17:05 ` Dennis Lee Bieber
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 23+ messages in thread
From: Jeffrey R.Carter @ 2021-10-22 11:49 UTC (permalink / raw)


On 10/22/21 05:29, 711 Spooky Mart wrote:
> 
> What degree of learning curve is there to learn Ada, coming from a
> Pascal background? What kind of rough timeframes to get comfortable with
> programming without always looking to the manuals?

Pascal was the starting point for the Green language, which became Ada 
in 1980 (and also for the Blue, Red, and Yellow languages, which did 
not). Ada is firmly in the ALGOL family of languages.

There is a sequential subset of Ada that Pascal users can learn very 
quickly: the sequential language + packages (packages [modules] are 
fundamental to Ada, and you can't do anything useful without them). One 
should then quickly learn generics, as much of the standard library is 
generic. Ada's features are mostly orthogonal, so one can use this 
subset without surprises from the other aspects of the language.

One can then learn programming by type extension (tagged types and 
interfaces) and concurrent programming (tasks and their friends) to 
complete your understanding of the language.

I generally recommend /Ada Distilled/ 
(https://www.adaic.org/wp-content/uploads/2010/05/Ada-Distilled-24-January-2011-Ada-2005-Version.pdf) 
to those familiar with another imperative language. It's ISO/IEC 
8652:2007 Ada, but you can easily pick up the new Ada-12 features when 
you've finished. (There's also now an Ada-12 version available on Amazon.)

-- 
Jeff Carter
"Make it right before you make it faster."
"Keep it right when you make it faster."
"Make it clear before you make it faster."
Elements of Programming Style
197

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

* Re: Ada versus Pascal
  2021-10-22  9:59   ` 711 Spooky Mart
@ 2021-10-22 15:12     ` Niklas Holsti
  2021-10-22 15:47       ` Dmitry A. Kazakov
                         ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Niklas Holsti @ 2021-10-22 15:12 UTC (permalink / raw)


On 2021-10-22 12:59, 711 Spooky Mart wrote:
> On 10/22/21 1:18 AM, ldries46 wrote:
> 
> [...]
> 
>> Ada is stricter
>> than other languages and is meant to have NO Operating system dependant
>> items, so if you cannot go around something there must be a package on
>> each operating system having the same interface everywhere.
> 
> By this do you mean the same syntax and libs will run on all target
> systems without fiddling with {IFDEF} and architecture compiler switch
> woo foo for USES and repetitive cross-arch boilerplate?


I'm not ldries46, but here is an answer: Ada standardizes _some_ 
functions for which some other languages use "OS" services, principally 
threading, which in Ada is the "tasking" feature. Indeed Ada tasking 
works in the same way whichever OS is used, and also in the "bare 
board", no-OS situation. This is very useful for developing 
multi-threaded embedded SW, because the Ada tasking code can be tested 
on desk-top workstations and then executed on the target system 
unchanged. (and no "ifdefs").

But real operating systems (as opposed to simpler real-time kernels) 
provide many services that are not standardized in Ada, for example 
inter-process communication.


> One thing I can't stand about Pascal is the totally different functions
> and logic from several operating systems that MUST be re-written several
> times in the same code base to do the same job. This drives me mad. In
> fact it irks me so much I was thinking of writing some libraries for
> things I do that would handle this all automatically across arches.
> There would go a couple months of Sundays.
> 
> Think IPC with Pascal. Get a good IPC routine going for Linux in your
> app, then you have to re-write it for MAC and Windows, and even some
> other flavors of *nix.


Indeed.


> So am I to understand that the Ada compiler has somehow eliminated this
> problem, by ensuring every target OS has a syntactically conformant
> package to execute its methods using the same statements?


Sadly no.

However, there are some rudiments:

- There is a standardized Ada interface (binding) to POSIX services. 
This is implemented in an Ada library called Florist. If you find or 
make a Florist implementation for the OSes you use, your Ada program can 
use the same OS service interfaces on all those OSes.

- The gcc-based Ada compiler GNAT comes with a GNAT-specific library 
that provides some OS services with the same Ada API on any OS that GNAT 
supports. This includes some IPC, but I don't know exactly how far that 
goes, and the library may of course change from one GNAT version to the 
next.

- There is an Ada library called Win32Ada that provides an extensive set 
of Microsoft Windows services, but it is a "thin binding" meaning that 
even the API is Windows-specific.

The Ada applications I have created and worked with have needed only a 
few OS services, basically some IPC: text in and out via pipes to and 
from a child process. We implemented our own binding to the required OS 
services (pipe and process creation and destruction). The interface 
consisted of a package declaration (.ads file) that was basically the 
same for all the supported OSes (Windows, Linux, Mac OS X) but had 
different OS-specific package body files (implementations, .adb files). 
In practice I think the Linux and Mac OS X implementations were the same 
and used direct binding to fork() and pipe() etc. The Windows 
implementation used Win32Ada.

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

* Re: Ada versus Pascal
  2021-10-22 15:12     ` Niklas Holsti
@ 2021-10-22 15:47       ` Dmitry A. Kazakov
  2021-10-23  7:13       ` ldries46
  2021-10-23 14:08       ` Simon Wright
  2 siblings, 0 replies; 23+ messages in thread
From: Dmitry A. Kazakov @ 2021-10-22 15:47 UTC (permalink / raw)


On 2021-10-22 17:12, Niklas Holsti wrote:

> I'm not ldries46, but here is an answer: Ada standardizes _some_ 
> functions for which some other languages use "OS" services, principally 
> threading, which in Ada is the "tasking" feature. Indeed Ada tasking 
> works in the same way whichever OS is used, and also in the "bare 
> board", no-OS situation. This is very useful for developing 
> multi-threaded embedded SW, because the Ada tasking code can be tested 
> on desk-top workstations and then executed on the target system 
> unchanged. (and no "ifdefs").
> 
> But real operating systems (as opposed to simpler real-time kernels) 
> provide many services that are not standardized in Ada, for example 
> inter-process communication.

Ada 83 predates threads. Initially a task meant to be either scheduled 
internally or mapped onto system processes. It is not late now. One 
could allow the pragma Import for tasks (and protected objects) in order 
to communicate to an external process using rendezvous and protected 
actions.

> However, there are some rudiments:
> 
> - There is a standardized Ada interface (binding) to POSIX services. 
> This is implemented in an Ada library called Florist. If you find or 
> make a Florist implementation for the OSes you use, your Ada program can 
> use the same OS service interfaces on all those OSes.
> 
> - The gcc-based Ada compiler GNAT comes with a GNAT-specific library 
> that provides some OS services with the same Ada API on any OS that GNAT 
> supports. This includes some IPC, but I don't know exactly how far that 
> goes, and the library may of course change from one GNAT version to the 
> next.

It provides sockets and serial I/O, one or both are vital for many 
applications.

> - There is an Ada library called Win32Ada that provides an extensive set 
> of Microsoft Windows services, but it is a "thin binding" meaning that 
> even the API is Windows-specific.

- There is the annex E providing RPC and shared objects. Unfortunately 
it is very vague and underdocumented. I failed to provide an 
implementation of for a GNAT compiler.

- The simple components library provides inter-process communication 
primitives: mutexes, events, streams, pools, RPCs etc.

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

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

* Re: Ada versus Pascal
  2021-10-22  3:29 Ada versus Pascal 711 Spooky Mart
                   ` (3 preceding siblings ...)
  2021-10-22 11:49 ` Jeffrey R.Carter
@ 2021-10-22 17:05 ` Dennis Lee Bieber
  2021-10-23  0:29   ` Paul Rubin
  2021-10-22 20:00 ` Gautier write-only address
  2021-10-24  4:33 ` Jerry
  6 siblings, 1 reply; 23+ messages in thread
From: Dennis Lee Bieber @ 2021-10-22 17:05 UTC (permalink / raw)


On Thu, 21 Oct 2021 22:29:15 -0500, 711 Spooky Mart <711@spooky.mart>
declaimed the following:

>The little snippets of Ada code I've seen look _alot_ like Pascal.
>
	No surprise. The teams that took part in the DoD competition to design
a language to replace the mish-mash of languages being used in the 70s
tended to choose Pascal as the starting point (Modula-2 hadn't escaped
ETH-Zurich yet <G>).

	The main difference is that Ada incorporated block closing syntax at
the base, finding Pascal (and C) [begin/end, {/} respectively] usage
error-prone (dangling else, etc.) along with using ; as a terminator
instead of separator. Oh, and using (/) for both function arguments and
array indexing (back then, most US keypunches didn't support [/] or {/} ).

	Declarations do not have a defined sequence (type, constant, variable).

	Also, Pascal of the era typically did not support separate compilation
and/or include files -- programs were all single monolithic files, any
change required recompiling the entire program.

	Pascal also had a relatively limited I/O system -- with the bad quirk
that it did "pre-reads" of files. Made interactive/console programs
difficult (or required special handling by the run-time startup) --
starting a program would result in stdin reading at the least one
character, if not one line, into the file buffer variable... But the
program may not want the data until after lots of initialization and
prompts.

>What degree of learning curve is there to learn Ada, coming from a
>Pascal background? What kind of rough timeframes to get comfortable with
>programming without always looking to the manuals?
>
	If all one is writing is "Pascal" type applications, without using
complex data types (ie; defining specific types for each "concept") -- it
shouldn't take too long.

	Tasking, rendezvous, protected objects (not to be confused with private
objects), and generics, may take longer to get comfortable with.

	The appendices of the LRM will tend to get lots of usage; there are
many subtleties to the standard libraries.


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/

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

* Re: Ada versus Pascal
  2021-10-22  3:29 Ada versus Pascal 711 Spooky Mart
                   ` (4 preceding siblings ...)
  2021-10-22 17:05 ` Dennis Lee Bieber
@ 2021-10-22 20:00 ` Gautier write-only address
  2021-10-24  4:33 ` Jerry
  6 siblings, 0 replies; 23+ messages in thread
From: Gautier write-only address @ 2021-10-22 20:00 UTC (permalink / raw)


> What degree of learning curve is there to learn Ada, coming from a 
> Pascal background? What kind of rough timeframes to get comfortable with 
> programming without always looking to the manuals? 

You don't need to read more manuals than you were used for Pascal (so, it can be a wide range, depending on your way of learning).
The most outstanding difference between both languages is the degree of unification.

Here a couple of links, with a Pascal-then-Ada perspective, that could be useful:
http://p2ada.sourceforge.net/pascada.htm
http://p2ada.sourceforge.net/

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

* Re: Ada versus Pascal
  2021-10-22 17:05 ` Dennis Lee Bieber
@ 2021-10-23  0:29   ` Paul Rubin
  2021-10-23  1:17     ` Randy Brukardt
  2021-10-23 17:24     ` Dennis Lee Bieber
  0 siblings, 2 replies; 23+ messages in thread
From: Paul Rubin @ 2021-10-23  0:29 UTC (permalink / raw)


Dennis Lee Bieber <wlfraed@ix.netcom.com> writes:
> 	Also, Pascal of the era typically did not support separate
> compilation and/or include files -- programs were all single
> monolithic files, any change required recompiling the entire program.

I thought Ada was originally like that too.  The program could be split
into multiple files, but they were expected to all be compiled together.

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

* Re: Ada versus Pascal
  2021-10-23  0:29   ` Paul Rubin
@ 2021-10-23  1:17     ` Randy Brukardt
  2021-10-23 17:24     ` Dennis Lee Bieber
  1 sibling, 0 replies; 23+ messages in thread
From: Randy Brukardt @ 2021-10-23  1:17 UTC (permalink / raw)



"Paul Rubin" <no.email@nospam.invalid> wrote in message 
news:87ilxod1nd.fsf@nightsong.com...
> Dennis Lee Bieber <wlfraed@ix.netcom.com> writes:
>> Also, Pascal of the era typically did not support separate
>> compilation and/or include files -- programs were all single
>> monolithic files, any change required recompiling the entire program.
>
> I thought Ada was originally like that too.  The program could be split
> into multiple files, but they were expected to all be compiled together.

No. Some implementations were like that, but most supported fully separate 
compilations from the beginning. Janus/Ada certainly did (once we got 
packages implemented, and Ada without packages really isn't Ada at all). You 
might have been thinking about the original permission to require generic 
bodies to be available when compiling an instantiation, but that only 
applied to generic units, never "regular" units. And some compilers (like 
Janus/Ada) never used that permission.

                                 Randy.


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

* Re: Ada versus Pascal
  2021-10-22 15:12     ` Niklas Holsti
  2021-10-22 15:47       ` Dmitry A. Kazakov
@ 2021-10-23  7:13       ` ldries46
  2021-10-23 14:08       ` Simon Wright
  2 siblings, 0 replies; 23+ messages in thread
From: ldries46 @ 2021-10-23  7:13 UTC (permalink / raw)


Op 22-10-2021 om 17:12 schreef Niklas Holsti:
> On 2021-10-22 12:59, 711 Spooky Mart wrote:
>> On 10/22/21 1:18 AM, ldries46 wrote:
>>
>> [...]
>>
>>> Ada is stricter
>>> than other languages and is meant to have NO Operating system dependant
>>> items, so if you cannot go around something there must be a package on
>>> each operating system having the same interface everywhere.
>>
>> By this do you mean the same syntax and libs will run on all target
>> systems without fiddling with {IFDEF} and architecture compiler switch
>> woo foo for USES and repetitive cross-arch boilerplate?
>
>
> I'm not ldries46, but here is an answer: Ada standardizes _some_ 
> functions for which some other languages use "OS" services, 
> principally threading, which in Ada is the "tasking" feature. Indeed 
> Ada tasking works in the same way whichever OS is used, and also in 
> the "bare board", no-OS situation. This is very useful for developing 
> multi-threaded embedded SW, because the Ada tasking code can be tested 
> on desk-top workstations and then executed on the target system 
> unchanged. (and no "ifdefs").
>
> But real operating systems (as opposed to simpler real-time kernels) 
> provide many services that are not standardized in Ada, for example 
> inter-process communication.
>
Of course there are system functions that are in OS that are not 
implemented in standard Ada. That type users must implement themselves. 
In fact some users are doing that and are present these solutions to the 
world. For these packages the latter line of my earlier comment is 
applicable.

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

* Re: Ada versus Pascal
  2021-10-22 15:12     ` Niklas Holsti
  2021-10-22 15:47       ` Dmitry A. Kazakov
  2021-10-23  7:13       ` ldries46
@ 2021-10-23 14:08       ` Simon Wright
  2 siblings, 0 replies; 23+ messages in thread
From: Simon Wright @ 2021-10-23 14:08 UTC (permalink / raw)


Niklas Holsti <niklas.holsti@tidorum.invalid> writes:

> Indeed Ada tasking works in the same way whichever OS is used, and
> also in the "bare board", no-OS situation.

Most bare-board runtimes use a subset (the Ravenscar profile) of full
Ada's tasking facilities. That said, code intended for the bare-board
can be developed on the desktop.

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

* Re: Ada versus Pascal
  2021-10-23  0:29   ` Paul Rubin
  2021-10-23  1:17     ` Randy Brukardt
@ 2021-10-23 17:24     ` Dennis Lee Bieber
  2021-10-24  7:04       ` J-P. Rosen
  1 sibling, 1 reply; 23+ messages in thread
From: Dennis Lee Bieber @ 2021-10-23 17:24 UTC (permalink / raw)


On Fri, 22 Oct 2021 17:29:26 -0700, Paul Rubin <no.email@nospam.invalid>
declaimed the following:

>Dennis Lee Bieber <wlfraed@ix.netcom.com> writes:
>> 	Also, Pascal of the era typically did not support separate
>> compilation and/or include files -- programs were all single
>> monolithic files, any change required recompiling the entire program.
>
>I thought Ada was originally like that too.  The program could be split
>into multiple files, but they were expected to all be compiled together.

	No... Pretty much every build system for Ada focused on only rebuilding
the parts affected by a changed file -- by following WITH statements to
find required units (see the LRM for what a "unit" comprises) /and/
determining if that unit requires compilation. Timestamps or intermediate
files may be used in that determination. Changes in implementation (body)
require the body to be recompiled, but if the specification did not change,
then units WITHing the specification don't need to be compiled -- they just
need relinking with the updated body.

	GNAT's build system -- using the host OS filesystem as the "database"
-- required that separate files are generated for each unit. (cf: GNATCHOP)
All-in-One was the optional source file format accepted by some compilers
-- but other than the early language reference manuals, I haven't
encountered any text books that use that means of presenting code examples
(unless it is discussing the use of GNATCHOP itself <G>).

https://www.adahome.com/History/Stoneman/stoneman.htm
is the requirements document that DoD used to define the desired
environment around Ada development.
"""
4.E	APSE TOOLSET REQUIREMENTS
4.E.1	The tools in an APSE shall support the development of programs in
the Ada language as defined by the Ada reference manual. In particular an
APSE shall support the separate compilation features of the language.
"""
NOTE the last sentence


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/

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

* Re: Ada versus Pascal
  2021-10-22  3:29 Ada versus Pascal 711 Spooky Mart
                   ` (5 preceding siblings ...)
  2021-10-22 20:00 ` Gautier write-only address
@ 2021-10-24  4:33 ` Jerry
  2021-10-24  6:32   ` ldries46
  2021-10-24 16:51   ` Gautier write-only address
  6 siblings, 2 replies; 23+ messages in thread
From: Jerry @ 2021-10-24  4:33 UTC (permalink / raw)


This thread began as a comparison of Ada and original Pascal. So how does Ada compare to Free Pascal Compiler and Delphi which have gone far past original Pascal?

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

* Re: Ada versus Pascal
  2021-10-24  4:33 ` Jerry
@ 2021-10-24  6:32   ` ldries46
  2021-10-24 16:51   ` Gautier write-only address
  1 sibling, 0 replies; 23+ messages in thread
From: ldries46 @ 2021-10-24  6:32 UTC (permalink / raw)


Op 24-10-2021 om 6:33 schreef Jerry:
> This thread began as a comparison of Ada and original Pascal. So how does Ada compare to Free Pascal Compiler and Delphi which have gone far past original Pascal?
You can also ask can you compile a Free Pascal program in Delphi or in 
the other direction. Ada was intended to do so and to keep it that way

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

* Re: Ada versus Pascal
  2021-10-23 17:24     ` Dennis Lee Bieber
@ 2021-10-24  7:04       ` J-P. Rosen
  0 siblings, 0 replies; 23+ messages in thread
From: J-P. Rosen @ 2021-10-24  7:04 UTC (permalink / raw)


Le 23/10/2021 à 19:24, Dennis Lee Bieber a écrit :
> https://www.adahome.com/History/Stoneman/stoneman.htm
> is the requirements document that DoD used to define the desired
> environment around Ada development.

Please don't provide links to adahome, this site is frozen since 1998, 
and there are copyrigh issues with the owner.

Stoneman can be obtained from:
https://en.wikisource.org/wiki/Stoneman_requirements

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52
https://www.adalog.fr

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

* Re: Ada versus Pascal
  2021-10-24  4:33 ` Jerry
  2021-10-24  6:32   ` ldries46
@ 2021-10-24 16:51   ` Gautier write-only address
  2021-10-24 23:24     ` 711 Spooky Mart
  1 sibling, 1 reply; 23+ messages in thread
From: Gautier write-only address @ 2021-10-24 16:51 UTC (permalink / raw)


Le dimanche 24 octobre 2021 à 06:33:15 UTC+2, Jerry a écrit :
> This thread began as a comparison of Ada and original Pascal. So how does Ada compare to Free Pascal Compiler and Delphi which have gone far past original Pascal?

You find a very partial answer in the comparison here:
http://p2ada.sourceforge.net/pascada.htm#tables
Made around year 2000, so ~30 after original Pascal but ~20 years ago.

Note that both FPC and Delphi descend from Turbo Pascal, which is itself completely different from other extensions like ISO Extended Pascal.
In a nutshell, Pascal is an extreme example of fragmentation of a language into dialects.
Ada is on the other extremity: you can build the same source sets (I mean exactly the same sources, without preprocessing gimmicks) on completely different compilers & OSes.

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

* Re: Ada versus Pascal
  2021-10-24 16:51   ` Gautier write-only address
@ 2021-10-24 23:24     ` 711 Spooky Mart
  2021-10-25  8:23       ` Niklas Holsti
  0 siblings, 1 reply; 23+ messages in thread
From: 711 Spooky Mart @ 2021-10-24 23:24 UTC (permalink / raw)


On 10/24/21 11:51 AM, Gautier write-only address wrote:
> Le dimanche 24 octobre 2021 à 06:33:15 UTC+2, Jerry a écrit :
>> This thread began as a comparison of Ada and original Pascal. So how does Ada compare to Free Pascal Compiler and Delphi which have gone far past original Pascal?
> 
> You find a very partial answer in the comparison here:
> http://p2ada.sourceforge.net/pascada.htm#tables
> Made around year 2000, so ~30 after original Pascal but ~20 years ago.
> 
> Note that both FPC and Delphi descend from Turbo Pascal, which is itself completely different from other extensions like ISO Extended Pascal.
> In a nutshell, Pascal is an extreme example of fragmentation of a language into dialects.
> Ada is on the other extremity: you can build the same source sets (I mean exactly the same sources, without preprocessing gimmicks) on completely different compilers & OSes.

I think that answers the important original query.

Does modern Ada have facility for writing boot loaders, inline Assembly,
kernels, etc.?

-- 
──┏━━━━┓──┏━━┓───┏━━┓──  ┌────────────────────────┐ ┌────────┐
──┗━━┓─┃──┗┓─┃───┗┓─┃──  │ Spooky Mart [chan] 711 │ │ always │
─────┃─┃──┏┛─┗┓──┏┛─┗┓─  │ https://bitmessage.org │ │  open  │
─────┗━┛──┗━━━┛──┗━━━┛─  └────────────────────────┘ └────────┘

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

* Re: Ada versus Pascal
  2021-10-24 23:24     ` 711 Spooky Mart
@ 2021-10-25  8:23       ` Niklas Holsti
  2021-10-25  8:40         ` Luke A. Guest
  0 siblings, 1 reply; 23+ messages in thread
From: Niklas Holsti @ 2021-10-25  8:23 UTC (permalink / raw)


On 2021-10-25 2:24, 711 Spooky Mart wrote:


> Does modern Ada have facility for writing boot loaders, inline Assembly,
> kernels, etc.?


In-line assembly is supported by most of the Ada compilers I have used, 
but the syntax may differ across compilers.

The run-time systems (real-time kernels) associated with Ada compilers 
for bare-board embedded systems are typically written in Ada, with minor 
amounts of assembly language inserted for the very HW-specific parts 
such as HW context saving and restoring.

I'm not very familiar with boot loaders, but I see no reason why a boot 
loader could not be written in Ada. However, usually (and as for other 
languages) there will be a small start-up routine in assembly language 
to initialize the processor, set up a stack, and so forth. The "Ada Bare 
Bones" project is doing something like this, I believe: 
https://wiki.osdev.org/Ada_Bare_bones.

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

* Re: Ada versus Pascal
  2021-10-25  8:23       ` Niklas Holsti
@ 2021-10-25  8:40         ` Luke A. Guest
  2021-10-25 13:34           ` Luke A. Guest
  0 siblings, 1 reply; 23+ messages in thread
From: Luke A. Guest @ 2021-10-25  8:40 UTC (permalink / raw)



On 25/10/2021 09:23, Niklas Holsti wrote:
> On 2021-10-25 2:24, 711 Spooky Mart wrote:
> 
> 
>> Does modern Ada have facility for writing boot loaders, inline Assembly,
>> kernels, etc.?
> 

Boot loaders and kernels are just another application area any general 
purpose language can target, even Ada.

> I'm not very familiar with boot loaders, but I see no reason why a boot 
> loader could not be written in Ada. However, usually (and as for other 

If you're talking x86 on PC's, then you'll need to read up on the x86 
boot process in which x86 starts up in 16-bit (real) mode, then has to 
be taken into protected and then long modes. You would need a GCC that 
can target all those modes.

> languages) there will be a small start-up routine in assembly language 
> to initialize the processor, set up a stack, and so forth. The "Ada Bare 
> Bones" project is doing something like this, I believe: 
> https://wiki.osdev.org/Ada_Bare_bones.

Thanks for pointing out my project :) It's out of date and doesn't build 
as is any more, but others have written Ada pages on that site since.

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

* Re: Ada versus Pascal
  2021-10-25  8:40         ` Luke A. Guest
@ 2021-10-25 13:34           ` Luke A. Guest
  0 siblings, 0 replies; 23+ messages in thread
From: Luke A. Guest @ 2021-10-25 13:34 UTC (permalink / raw)


On 25/10/2021 09:40, Luke A. Guest wrote:

> Thanks for pointing out my project :) It's out of date and doesn't build 
> as is any more, but others have written Ada pages on that site since.

IIRC, the changes that need to happen is that gprbuild 
--target=arm-<whatever> be used instead of arm-<whatever>-gprbuild.

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

end of thread, other threads:[~2021-10-25 13:34 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22  3:29 Ada versus Pascal 711 Spooky Mart
2021-10-22  6:18 ` ldries46
2021-10-22  9:59   ` 711 Spooky Mart
2021-10-22 15:12     ` Niklas Holsti
2021-10-22 15:47       ` Dmitry A. Kazakov
2021-10-23  7:13       ` ldries46
2021-10-23 14:08       ` Simon Wright
2021-10-22  6:40 ` Paul Rubin
2021-10-22  8:57 ` Niklas Holsti
2021-10-22 11:49 ` Jeffrey R.Carter
2021-10-22 17:05 ` Dennis Lee Bieber
2021-10-23  0:29   ` Paul Rubin
2021-10-23  1:17     ` Randy Brukardt
2021-10-23 17:24     ` Dennis Lee Bieber
2021-10-24  7:04       ` J-P. Rosen
2021-10-22 20:00 ` Gautier write-only address
2021-10-24  4:33 ` Jerry
2021-10-24  6:32   ` ldries46
2021-10-24 16:51   ` Gautier write-only address
2021-10-24 23:24     ` 711 Spooky Mart
2021-10-25  8:23       ` Niklas Holsti
2021-10-25  8:40         ` Luke A. Guest
2021-10-25 13:34           ` Luke A. Guest

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