From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: Five Years After Date: Wed, 24 Jan 2018 19:06:50 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <942235344.537649945.074508.laguest-archeia.com@nntp.aioe.org> <288039467.538377555.666858.laguest-archeia.com@nntp.aioe.org> <62033550-4044-450b-9010-beba11f99f4e@googlegroups.com> Injection-Date: Wed, 24 Jan 2018 19:06:50 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="6aafd71d3587d19c33549efd012e2398"; logging-data="14720"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KdHuAQ70kwiZpHMneT/z46qfYBBSPCfs=" User-Agent: slrn/0.9.8.1 (VMS/Multinet) Cancel-Lock: sha1:uXgrDkzgG+RtY+mfRxPJxU2QNFw= Xref: reader02.eternal-september.org comp.lang.ada:50116 Date: 2018-01-24T19:06:50+00:00 List-Id: On 2018-01-24, Shark8 wrote: > On Wednesday, January 24, 2018 at 8:12:51 AM UTC-7, Mehdi Saada wrote: >> > There's serious potential for a good small language that could serve >> > as an easily implemented C language replacement. It's possible that >> > a subset of Ada with just the core features implemented and hence >> > without vast amounts of required runtime library support could >> > serve that purpose. >> >> > Think of something that had the kind of functionality of a beefed up >> > version of Oberon with all of the Ada type safety features imported >> > into it for example. >> >> I'm a in position to talk, and I know peanuts about Oberon, but can I ask you something... What is "core" for you ? Is tasking part of it ? Full-featured generics ? Support for exceptions or clause representations ? Class-wide programming and interfaces ? Or what do you not feel as essential ? >> I'm sure there's a bunch others would deem essential and "core". But I am sure too, those things put together already make for a big piece of work for compiler designers. >> Remove any of it, Ada will feel hollow... Or I just found myself a purist :-P >> Plus, if it's only for having a safer and nicer equivalent to D or Rust, it's not worth the effort, and I doubt people will even consider. > > I rather agree; but if there was a small "core" replacement for C, I think it would have to be (1) representation clauses, (2) tasking, and (3) generics. Tasking is a really big problem here - it requires a lot of RTL/OS support. The overall goal for me would be to bring the advantages of Ada to areas where it is not currently used for various reasons. That means a number of practical tradeoffs need to be made. The language is great but the compiler situation is absolutely _horrible_. The compilers are only available for a limited number of platforms, code written in the freely available Adacore compiler (not FSF compiler) is subject to mandatory licencing under the GPL, and the full language is so heavy that writing a full Ada compiler from scratch is a massive undertaking. There is however a small core in the Ada language that could bring benefits elsewhere but without all the overhead of a full blown Ada implementation. When talking about a C replacement, you need: 1) Something that can easily generate code to run on bare metal without OS support and on a wide range of targets in general. 2) Compilers that are easily portable to a wide range of environments. [Note that the environment the compiler runs on may not be the same as the environment it generates code for so this is different from 1) above.] 3) Compilers that are a lot easier to write than a current Ada compiler is. 4) The ability to write library code without the caller needing to know that it is calling code written in Ada. 5) There must be no licence restrictions on what the user can do with the generated code. Notice that none of the above items talk about the language features. They do however talk about some of the various practical reasons why Ada is not used more than it currently is. Oh, and about item (4). Apart from needing to call adainit/adafinal, there's this little gem taken from: https://gcc.gnu.org/onlinedocs/gnat_ugn/Binding-with-Non-Ada-Main-Programs.html |Currently the GNAT run time requires a FPU using 80 bits mode precision. Under |targets where this is not the default it is required to call |GNAT.Float_Control.Reset before using floating point numbers (this include |float computation, float input and output) in the Ada code. A side effect is |that this could be the wrong mode for the foreign code where floating point |computation could be broken after this call. Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world