From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!x6YkKUCkj2qHLwbKnVEeag.user.46.165.242.91.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada versus Pascal Date: Fri, 22 Oct 2021 17:47:59 +0200 Organization: Aioe.org NNTP Server Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: gioia.aioe.org; logging-data="36519"; posting-host="x6YkKUCkj2qHLwbKnVEeag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:63055 List-Id: 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