To receive the Ada User Journal, apply to Ada-Europe at: http://www.ada -europe.org/join ADA Volume 41 USER Number 3 September 2020

JOURNAL Contents Page Editorial Policy for Ada User Journal 120 Editorial 121 Quarterly News Digest 122 Conference Calendar 149 Forthcoming Events 156 Special Contribution J. Cousins “An Overview of Ada 202x” 159 Articles from the 20th International Real-Time Ada Workshop (IRTAW'2020) L. M. Pinho, S. Royuela, . Quiñones “Real-Time Issues in the Ada Parallel Model with OpenMP” 177 J. Garrido, D. Pisonero Fuentes, J. A de la Puente, J. Zamorano “Vectorization Challenges in Digital Signal Processing” 183 Puzzle J. Barnes “The Problem of the Nested Squares” 187 In memoriam: Ian Christopher Wand 188 Ada-Europe Associate Members (National Ada Organizations) 190 Ada-Europe Sponsors Inside Back Cover

Ada User Journal Volume 41, Number 3, September 2020 122 Quarterly News Digest

Alejandro R. Mosteo Centro Universitario de la Defensa de Zaragoza, 50090, Zaragoza, Spain; Instituto de Investigación en Ingeniería de Aragón, Mariano Esquillor s/n, 50018, Zaragoza, Spain; email: [email protected]

I ask for your indulgence for closing this New(?) Intros to Ada and preface with a project I started and Contents actively develop (in collaboration, chiefly, Spark on adacore.com with Fabien Chouteau from AdaCore): Preface by the News Editor 122 Alire (after Ada Library Repository), a From: Paul Rubin Ada in Education 122 package manager for Ada and SPARK Ada-related Resources 125 has entered public beta, and debuts in this Subject: new(?) intros to Ada and Spark on Ada-related Tools 125 issue [4]. As of this writing, Alire indexes adacore.com Ada-related Products 127 130 libraries and executable projects that Date: Wed, 02 Sep 2020 23:50:01 -0700 Ada and Operating Systems 128 you can immediately retrieve and build Newsgroups: comp.lang.ada Ada and Other Languages 130 with GNAT without a care in the world I don't remember seeing these here before. Ada Practice 130 about having to go hunting for They look promising: dependencies. (A technical paper about an https://learn.adacore.com/courses/ early version of Alire was published in courses.html: [Messages without subject/newsgroups AUJ 39.3.) are replies from the same thread. - Introduction to Ada Messages may have been edited for minor Sincerely, - Introduction to SPARK proofreading fixes. Quotations are Alejandro R. Mosteo. - Ada for the C++ or Java Developer trimmed where deemed too broad. [1] “Survey on the Future of GNAT Sender’s signatures are omitted as a Community Edition”, in Ada Practice. - SPARK Ada for the MISRA C general rule. --arm] Developer [2] “Ada 2020 Jupyter Notebooks”, in Ada and Education. - Introduction to GNAT Toolchain Preface by the News [3] “Proposal: Auto-allocation of https://learn.adacore.com/courses/ Editor Indefinite Objects”, in Ada Practice. intro-to-ada/index.html [4] “Repositories of Open Source https://learn.adacore.com/courses/ Dear Reader, Software”, in Ada-related Resources. intro-to-spark/index.html This number brings again important news https://learn.adacore.com/courses/ for Open Source enthusiasts from the Ada_For_The_CPP_Java_Developer/ GNAT front. A survey was conducted by Ada and Education index.html AdaCore to gather feedback on the idea of discontinuing the Community Editions in Ada 2020 Jupyter Notebooks https://learn.adacore.com/courses/ favor of better supporting the FSF- SPARK_for_the_MISRA_C_Developer/ maintained version packaged by various From: Maxim Reznik index.html Linux distributions. You can read reactions about this idea in thread [1]. Subject: Ada 2020 Jupyter notebooks https://learn.adacore.com/courses/ Date: Wed, 2 Sep 2020 06:28:07 -0700 GNAT_Toolchain_Intro/index.html The Jupyter notebooks for Ada by Maxim Newsgroups: comp.lang.ada Reznik (first reported here in AUJ 41.2) I'm going to write a series of Jupyter Solutions to J. McCormick are quickly taking shape: a series of Book interactive tutorials demonstrating new notebooks about Ada 2020 support in GNAT Community Edition 2020. features of Ada 202x is already available From: Werner Aeschbacher on-line, with 10 entries at the time of this First two are there: writing. Find more about these in [2], and - Ada 2020: 'Image attribute for any type Subject: Training Ada of course visit them with your browser to Date: Wed, 23 Sep 2020 11:43:08 -0700 witness their potential first-hand. - Ada 2020: Redefining the 'Image Newsgroups: comp.lang.ada attribute If you would like to go down memory Does anybody have the solutions to the lane, two threads about operating systems https://github.com/reznikmm/ exercises of the book "Building Parallel, (supporting or implemented in Ada) ada-howto/tree/ce-2020 Embedded, and Real-Time Applications contain juicy bits in the Ada and From: Emmanuel Briot with Ada" from John W. McCormick Operating Systems section. Or, if you et al ? prefer to look forward to hypothetical Date: Wed, 2 Sep 2020 23:49:46 -0700 future Ada features, a large discussion From: Paul Rubin emerged from the embers of an old thread Nice idea, this is a nice way to teach Ada proposing solutions to the automatic indeed. Date: Wed, 23 Sep 2020 12:58:45 -0700 storage of indefinite types [3]. Is there a claim that a solution set was published someplace? Your best bet might be to contact the authors.

Volume 41, Number 3, September 2020 Ada User Journal Ada and Education 123

Sometimes with textbooks (say in From: Simon Wright Yes, his JEWL package is great. I used it mathematics), there is a solutions book many times to create Windows GUI apps available only to instructors, so they can Date: Tue, 15 Sep 2020 18:01:56 +0100 and still use it some. I talked to John a assign homework problems from the number of times - he was very helpful. textbook and check students' answers Try here: https://www.dropbox.com/s/ His book is one of the best! 8k4xxpj5a67s752/adacraft.tar.gz?dl=0 against the solutions book. From: Paul Rubin I have the textbook you mention. It looks Nothing like being a pack rat! My hard good but I haven't gotten around to disk copy is dated 2012-8-25, but I don't Date: Tue, 15 Sep 2020 18:23:18 -0700 reading much of it. If there's a particular know when I retrieved it, must have been several computers ago. Internal dates up > [...] there is a very recent one for exercise you're interested in, I might like beginners which I will probably get to to give it a try. to 2001-07-27. Readme says examples tested with GNAT 3.13p! fill in the gaps not covered by "The From: "Randy Brukardt" Craft".https://www.apress.com/gp/book From: Simon Wright /9781484254271 Date: Wed, 23 Sep 2020 16:37:52 -0500 Date: Tue, 15 Sep 2020 18:07:13 +0100 I haven't examined that book directly but > Your best bet might be to contact the based on the preview and blurb, it does authors. Actually, they are at adaic.com: seem to be beginner oriented, thus likely http://archive.adaic.com/docs/craft/ to have gaps of its own. If you're trying to Agreed. John McCormick is still involved craft.html, see the third bullet point. fill gaps, you probably want something in Ada (he was on an ARA meeting this more complete and advanced. morning), so I'd expect he'd be able to From: Jack Davy give you some information. I semi-recently got another book that Date: Tue, 15 Sep 2020 12:03:46 -0700 looks very good, though it's still sitting Solutions to J. English Book @ Ludovic, thanks for the link to around without my having read much of rosettacode; very good source of it: Analysable Real-Time Systems: From: Jack Davy examples. And good to hear that you rate Programmed in Ada, by Andy Wellings the book highly. There don't seem to be and Alan Burns. It is basically an updated Subject: Learning Ada many books on Ada, but there is a very reprint of an older book by the same Date: Tue, 15 Sep 2020 03:36:34 -0700 recent one for beginners which I will authors, self-published in paperback, so it Newsgroups: comp.lang.ada probably get to fill in the gaps not covered is a good value. I've just started learning Ada and am by "The Craft". From: Jack Davy using the book "Ada95: The Craft of https://www.apress.com/gp/book/ Object Oriented Programming", by John 9781484254271 Date: Wed, 16 Sep 2020 00:13:22 -0700 English. I know there are plenty of other @ Simon, thanks, but I already have that @ Gautier, thanks for the links. When I resources such as the one on AdaCore, file. It contains all the code in the book get Windows 7 on VirtualBox I'll give the which covers Ada 2012, but I like the but not the answers to the end of chapter LEA editor a try, I'm not so keen on using style and flow of this book. Anyway, I questions. Wine, it's a bit hit & miss. Also since I was wondering whether anyone in the learned Vim a few years ago no other group has the answers to the end of By the way, I see the author also wrote a editors really do it for me, unless they chapter exercises? The author has now GUI library for Ada called JEWL, the have Vim bindings ;). retired and the link to them is dead. files for which I have also downloaded. Pity it's for Windows only. I'm a Linux @ Paul, I was thinking that the beginner's Thanks in Advance! user although I do have Win XP on Apress book would fill in the gaps From: Anders Wirzenius VirtualBox, but I don't believe the current regarding Ada 2012 specifically, which as GNAT will run on it. I understand it has changed from previous Date: Tue, 15 Sep 2020 17:31:57 +0300 From: Gautier write-only versions mainly in regard to OOP; I'm assuming I won't need to unlearn anything Maybe this helps: Date: Tue, 15 Sep 2020 12:28:20 -0700 if I learn the basics from an Ada 95 book. http://archive.adaic.com/docs/craft/ The real-time stuff would be over my craft.html Other sample sources: head at this point I think, and not really something I had in mind when From: Jack Davy Ada resources: considering Ada, although I do have a - https://sourceforge.net/directory/ background in electronics, and see that Date: Tue, 15 Sep 2020 08:07:07 -0700 language:ada/ there is Ada compiler for AVR on Thanks Anders, but I already found that - https://www.adaic.org/ada-resources/ AdaCore. link. The download has the code for the The more I look at this language the more book, but no answers. I guess it's not Small samples are embedded in the LEA I wonder why it isn't more popular. important, I just thought it would be nice editor (you can run it from Wine): Maybe people just don't like the pascalish to see some sample solutions. https://sourceforge.net/projects/l-e-a/ syntax, but that never put me off because From: Ludovic Brenta From the menu: Action / Code sample. I learned Turbo Pascal at Uni (25 years Choose your sample. Hit F9 for running. ago) and more recently Free Date: Tue, 15 Sep 2020 17:54:35 +0200 Pascal/Lazarus. Never was much of a fan Some samples stem from Rosetta Code of the curly bracket languages. I don't have an answer to your exact BTW :-) question but there is no shortage of From: Jack Davy "sample solutions" in Ada on From: Jerry Petrey https://rosettacode.org/wiki/Category:Ada Date: Tue, 15 Sep 2020 16:00:08 -0700 Date: Wed, 16 Sep 2020 00:32:32 -0700 HTH > By the way, I see the author also wrote I found an impressive list of 'Things to a GUI library for Ada called JEWL [...] like about Ada' posted by a C/C++ career PS. I still consider John English's book to programmer on the AVR freaks forum (in be the best introduction to Ada. reply #13) :

Ada User Journal Volume 41, Number 3, September 2020 124 Ada and Education https://www.avrfreaks.net/forum/ , with the additional advantage for AVR on AdaCore. i-didnt-know-you-could-get-ada-avr of backward compatibility with C, so they won market share. Turbo Pascal was a I don't know the current state of that, but My main reason for wanting to learn Ada contender back then but only on DOS and some years ago it was rather hard to use is the last on his list: "Promotes a Windows, so it ultimately lost to C++, or parts were missing or whatever. These professional, anti-hacker mentality. By possibly in no small part because of days, the AVR is in decline since it is so being unforgiving the language promotes Borland's refusal to abide by any portable limited. Everyone uses ARM or maybe the valuable discipline of specifying and standard. And then Sun marketed Java soon RISC-V processors even for tiny writing code more exactly, without the aggressively with a zero-cost compiler embedded stuff. temptations of slipping into bit-twiddling and promises of ultimate portability, and > The more I look at this language the or other programming habits that subvert stole the show. more I wonder why it isn't more (and often break) the data or code models. popular. Maybe people just don't like When proper programming discipline is The Ada landscape changed dramatically the pascalish syntax not enforced by the language then it must when the first Free Software Ada 95 be voluntary, and in those cases discipline compiler, GNAT, arrived, but the damage Tooling, libraries, language verbosity, etc. can and inevitably will slip, but when the to the reputation of Ada was very hard to As pure language, though, it is still language enforces much of that discipline overcome. An entire generation of mysterious to me what Rust offers that then there are no easy ways to avoid it, military and corporate programmers, Ada doesn't. and the resulting code is higher in quality frustrated by the early compilers, became and faster to develop." managers and dismissed Ada out of hand Today, for most programming, "systems for decades. They and their prejudices languages" including Ada, C, C++, and Maybe that's why Ada isn't more popular have started to retire in the past few years Rust are all imho somewhat niche. Unless - being disciplined isn't easy, and hacking and I think this is one factor in the current you are dealing with specialized problems is more fun. But I've learned the hard way renaissance of Ada. (such as embedded or OS's), computers that it's actually much more satisfying have almost unbounded resources. So it's when your programs are bug-free and From: "Dmitry A. Kazakov" easier to get your work done using work properly the first time you run them. languages with automatic memory Any language which enforces more Date: Wed, 16 Sep 2020 13:09:54 +0200 management, unbounded arithmetic, etc. thinking and less trial-and-error coding is > I wasn't there when it happened but [...] a winner in my book. The main cost is consuming more I mostly agree with your analysis, except machine resources and losing some From: Gautier write-only the last part. The problem is that the timing determinism, but most of the time culture of programming and overall you can live with both of those. Ada is Date: Wed, 16 Sep 2020 02:13:54 -0700 education became so low that it is no best for more demanding applications > @ Gautier, thanks for the links. When I more a race against C++. C++ itself is in which usually involve realtime or high get Windows 7 on VirtualBox I'll give defense and losing against languages and reliability constraints. the LEA editor a try, I'm not so keen on practices so overwhelmingly bad that From: Mart van de Wege using Wine, it's a bit hit & miss. even C looks as a shining beacon. Winter is coming. No worries, you can access the same Date: Fri, 18 Sep 2020 08:53:20 +0200 samples (and the same compiler) without From: "Jeffrey R. Carter" > Ada is a language for engineering LEA, built on your preferred operating software. [...] system. Date: Wed, 16 Sep 2020 17:01:41 +0200 I use it for hobby stuff, for quick solutions >- https://hacadacompiler.sourceforge.io/ > The more I look at this language the (like generating RPG characters). Does (source code here: https://sourceforge.net/ more I wonder why it isn't more not feel like engineering to me. p/hacadacompiler/code/HEAD/tree/, popular. But what I do like is the elegance of the mirrored here: Ada is a language for engineering https://github.com/zertovitch/hac ) language, and the ability to describe my software. Since 98% of developers are problem domain using distinct types. Mutatis mutandis, you get there the unable to do that, Ada will never be "tpc.exe" equivalent, whereas LEA is the popular as long as such people are The 'verbosity' does not bother me. I'm a "turbo.exe" :-) allowed to develop software. fluent touch typist, Using the shift key to From: Paul Rubin type braces slows me more than typing From: Ludovic Brenta out statements to delineate blocks. Date: Wed, 16 Sep 2020 12:55:58 +0200 Date: Wed, 16 Sep 2020 14:29:56 -0700 The only real nit I have with Ada is that it does not have closures. > The more I look at this language the > @ Paul, I was thinking that the more I wonder why it isn't more beginner's Apress book would fill in the From: "Jeffrey R. Carter" popular. [...] gaps regarding Ada 2012 specifically, which as I understand it has changed Date: Fri, 18 Sep 2020 12:00:47 +0200 I wasn't there when it happened but I read from previous versions mainly in that early Ada 83 compilers were buggy, regard to OOP > I use it for hobby stuff, for quick slow and outrageously expensive because solutions (like generating RPG marketed only at one captive customer, I think Ada 95 OOP is not really used characters). Does not feel like the US DoD. (In their defence, Ada is a very much, and the changes in Ada 2012 engineering to me. particularly difficult language to are things like contracts, and built-in SPARK syntax. You could also look at I do similar things, too, but I always have implement well, orders of magnitude a design in mind, and usually start with more so than Pascal or C). The vendors the online book "Ada Distilled" which is about Ada 95. I found it an ok way to get pkg, task, & PO specs and subprogram never really tried to sell Ada development declarations, so I suspect that after doing tools outside the military, despite hype started, though I never really progressed beyond that. this for so long I can engineer simple that Ada was the language of the future. problems in my head. Presumably others At around the same time, C++ used the > I do have a background in electronics, with similar experience or who are better opposite strategy of selling cheap and see that there is an Ada compiler than I do the same.

Volume 41, Number 3, September 2020 Ada User Journal Ada-related Tools 125

[2] http://rosettacode.org/wiki/ There is also now a searchable info index, Ada-related Resources Category:Ada_User containing the entries in the ARM Index. [Delta counts are from Apr 6th to Jul [3] https://github.com/search? From: "Randy Brukardt" 20th. --arm] q=language%3AAda&type=Users [4] https://sourceforge.net/directory/ Date: Sat, 18 Jul 2020 22:40:16 -0500 Ada on Social Media language:ada/ Sounds good, but keep in mind this is a From: Alejandro R. Mosteo [5] https://www.openhub.net/tags? moving target. Draft 26 should be names=ada available next week. :-) Subject: Ada on Social Media [6] https://alire.ada.dev/crates.html From: "Randy Brukardt" Date: Mon, 02 Nov 2020 18:41:21 +0100 To: Ada User Journal readership [7] https://bitbucket.org/repo/all? Date: Fri, 31 Jul 2020 17:55:47 -0500 name=ada&language=ada Ada groups on various social media: [8] https://git.codelabs.ch/? > Sounds good, but keep in mind this is a a=project_index moving target. Draft 26 should be - LinkedIn: 3_025 (+75) members [1] available next week. :-) [9] http://forge.ada-ru.org/adaforge - Reddit: 4_720 (+634) members [2] My primary computer died (now fixed, - Stack Overflow: 1_924 (+60) Language Popularity knock on wood), and we've since had an questions [3] ARG meeting, so this new draft will be Rankings delayed a couple of weeks. Shouldn't be - Freenode: 90 (+2) users [4] From: Alejandro R. Mosteo too far in the future, though. - Gitter: 64 (+8) people [5] Subject: Ada in language popularity - Telegram: 90 (+11) users [6] rankings Ada-related Tools - Twitter: 67 (+14) tweeters [7] Date: Mon, 20 Jul 2020 09:38:21 +0100 To: Ada User Journal readership SweetAda 0.1C-0.1F 92 (+27) unique tweets [7] [From this number on, positive ranking From: [email protected] [1] https://www.linkedin.com/groups/ changes mean to go up in the ranking. Subject: SweetAda 0.1c released 114211/ This issue sees the addition of the PYPL Date: Tue, 7 Jul 2020 14:30:36 -0700 [2] http://www.reddit.com/r/ada/ ranking, which is computed by analyzing Newsgroups: comp.lang.ada how often language tutorials are searched [3] http://stackoverflow.com/questions/ I've just released SweetAda 0.1c. tagged/ada on Google. The IEEE ranking has seen no updates through 2020, and will be likely Windows toolchains now have libstdc++ [4] https://netsplit.de/channels/ dropped soon if this situation persists. included. details.php?room=%23ada&net=freeno --arm] de The RISCV32 and RISCV64 toolchains - TIOBE Index: 39 (+4) 0.35% [5] https://gitter.im/ada-lang are now deprecated, because they end up (+0.07%) [1] the same. So there is now a generic [6] https://t.me/ada_lang - PYPL Index: 19 (new!) 0.62% RISCV toolchain. It behaves like the [7] http://bit.ly/adalang-twitter (+0.3%) [2] other two, you have just to specify the - IEEE Spectrum (general): 43 (=) correct CPU. GCC switches that activate Repositories of Open Source Score: 24.8 [3] the 64-bit mode are "-march=rv64imafdc" and "-mabi=lp64d". Obviously there is the Software - IEEE Spectrum (embedded): 13 (=) correspondent RTS target. Score: 24.8 [3] From: Alejandro R. Mosteo The RISCV support is a little bit usable, if [1] https://www.tiobe.com/tiobe-index/ you pick the QEMU-RISC-V-32 Subject: Repositories of Open Source [2] http://pypl.github.io/PYPL.html platform, it runs Ada code and does some software [3] https://spectrum.ieee.org/static/ primitive I/O in the IOEMU window, Date: Mon, 02 Nov 2020 18:41:21 +0100 stimulating a LED and an 8-bit port. To: Ada User Journal readership interactive-the-top-programming- languages-2019 I've tested Insight and it works very well, [This issue sees a newcomer, the Alire breakpoints and other things seem ok. package manager project, debuting with Ada Reference Manual 130 Ada projects ready to use. --arm] 2020.1 Other minor adjustments here and there. Rosetta Code: 747 (=) examples [1] I saw in the log that many users still try to From: Stephen Leake download from a non-existent directory, 37 (=) developers [2] i.e., sweetada.org/software/.... Please Subject: Ada Reference Manual info format GitHub: 729 (+77) developers [3] update your links, the correct directory is 2020.1 released. sweetada.org/packages/.... Sourceforge: 276 (+1) projects [4] Date: Fri, 17 Jul 2020 10:23:15 -0700 Newsgroups: comp.lang.ada Thanks for your patience, I am also Open Hub: 212 (=) projects [5] working on documentation. ada-ref-man 2020.1 is now available in Alire:130 (new!) crates [6] GNU ELPA. From: [email protected] Subject: SweetAda 0.1e released Bitbucket: 88 (-2) repositories [7] This includes Ada 202x draft 25, as well Date: Wed, 22 Jul 2020 11:03:04 -0700 Codelabs: 52 (+1) repositories [8] as Ada 2012. GNAT Community 2020 Newsgroups: comp.lang.ada has some support for some of the new AdaForge: 8 (=) repositories [9] language features in Ada 202x. Hi all. I've just released SweetAda 01.e. [1] http://rosettacode.org/wiki/ Go to http://www.sweetada.org and Category:Ada download the archive.

Ada User Journal Volume 41, Number 3, September 2020 126 Ada-related Tools

RTS and LibGCC packages are still valid launched executable instead of a alternatives to TASH, unless they are @ 0.1c. "NULL" tag Tcl/Tk bindings. - general cleanup and cosmetics - the parser inside the IOEMU library Thank you in advance. - general infrastructure improvements now expose in the .cfg file a variable (LASTPID) that carries the PID of the [1] http://tcladashell.sourceforge.net/ - QEMU-RISC-V-32 target can do serial last launched executable (see QEMU- index.htm output in a terminal AVR/qemu.cfg) From: mockturtle - IntegratorCP target uses LCD VGA There is also a new release of all QEMU Date: Mon, 3 Aug 2020 02:28:20 -0700 - Malta MIPS target uses a VGA PCI emulators, at version 5.1.0. I am replying to my own post... Deep board Please note that the Linux version is down in the Google results I found a - handling of directories in the cpus linked with the SDL2 library instead of github version of TASH hierarchy, which allows selective unit the previous GTK+3. https://github.com/simonjwright/ overriding You can find everything at tcladashell - Insight can be called as a toolchain http://www.sweetada.org component Despite the different name it seems like the original sourceforge TASH (or a - IOEMU configuration files are now GWindows 31-Jul-2020 fork?) revived on github fully consistent From: [email protected] From: Simon Wright Next days I will concentrate on generic Subject: Ann: GWindows release, 31-Jul- low-level CPU support, documentation, 2020 Date: Mon, 03 Aug 2020 14:38:58 +0100 and restructuring of some redundant units. Date: Fri, 31 Jul 2020 11:01:11 -0700 > Do someone know where I can find the Let me know, feedback is highly Newsgroups: comp.lang.ada appreciated. sources of TASH? GWindows is a full Microsoft Windows From: Gabriele Galeotti I altered the project page on SF to point to Rapid Application Development the new Github site, but forgot about the framework for programming GUIs Subject: SweetAda 0.1f released project web pages. Sorry. (Graphical User Interfaces) with Ada. Date: Wed, 19 Aug 2020 15:40:58 -0700 I've been moving my projects to Github; Newsgroups: comp.lang.ada GWindows works with the GNAT it's a far more pleasant and performant development system (could be made pure Hi all, I've just released the 0.1f version of environment, I find. Ada with some effort). SweetAda. > [1] http://tcladashell.sourceforge.net/ - general cleanup and cosmetics Changes to the framework are detailed in index.htm gwindows/changes.txt or in the News - general infrastructure improvements forum on the project site. This page now points you to - the VGA text driver is now unified https://github.com/simonjwright/ In a nutshell (since last announcement across platforms; it is actually used by tcladashell here): PC-, PC-x86-64 and MIPS Malta From: Simon Wright - a few features from the extensions - the ugly handling of network packets GWindows.Common_Controls. (Amiga/FS-UAE and PC-x86) is re- Date: Mon, 03 Aug 2020 14:40:27 +0100 Ex_List_View and routed to a PBUF FIFO handler (the GWindows.Common_Controls. > Despite the different name it seems like management is still far from ideal, but is Ex_TV_Generic have been moved to the original sourceforge TASH (or a not tied to the ISR like before) parent package and respective parent fork?) revived on github - various I/O have now correct aspect types for broader use specifiers; in particular some hardware I thought it was the same name? - fix: a few records for binding with the registers with specific sizes are now Windows API were erroneously 32-bit Anyway, the project has moved to Github, correctly handled without premature only under the same management :-) optimizations From: [email protected] GWindows Project site: - AVR is now part of SweetAda and so 2 Date: Mon, 3 Aug 2020 06:53:18 -0700 platforms exist: ArduinoUno and a https://sf.net/projects/gnavi/ There is also on GitHub: QEMU emulator (both ATmega328P); GWindows GitHub clone: https://github.com/thindil/tashy ("TASHY https://github.com/zertovitch/gwindows the AVR support is primitive and is short from Tcl Ada SHell Younger"). incomplete, but, with an ArduinoUno board, is sufficient to start up the Ada TASH Sources SI Units Checked and infrastructure and is able to pulse the onboard LED; From: mockturtle Unchecked Subject: TASH sources? note that programming is performed by Date: Mon, 3 Aug 2020 02:16:15 -0700 From: AdaMagica means of the AVRDUDE tool, so you Newsgroups: comp.lang.ada should use a version suitable for your Subject: SI Units Checked and Unchecked - environment; I wanted to try to use the Ada Tcl/Tk Completela overhauled version otherwise you could use the IHEX .hex binding TASH [1], but the download page Date: Thu, 13 Aug 2020 05:24:06 -0700 output file with your preferred tool; has links to www.adatcl.com that sends Newsgroups: comp.lang.ada me to some chinese-written site. I guess the QEMU-AVR platform can be used www.adatcl.com expired? Simplified design now available: with GDB or Insight to trace the execution of code; Does someone know where I can find the http://archive.adaic.com/tools/CKWG/ sources of TASH? Dimension/SI.html - runsweetada and IOEMU library now correctly show in argv dumps the Please note that, for reasons too long to be explained here, I am not interested in

Volume 41, Number 3, September 2020 Ada User Journal Ada-related Products 127

The choice of using dimension checking - The package IEEE_754.Decimal128 the ObjectAda technology. With or not is now made via a generic signature was added. The package implements ObjectAda for Windows version 10.2, the package. The user interface is unchanged. IEEE 754-2008 decimal128 format; ObjectAda compiler conforms to the Ada - An implementation of 128-bit integers Conformity Assessment Test Suite Resource to Source was added to the package IEEE_754; (ACATS) version 4.1Q and adds several new features not present in the previous From: - The package IEEE_754.Edit was added; release (ObjectAda version 10.1 released Subject: Ann: Resource to source - The package provides strings formatting in May 2019) including support for Date: Thu, 27 Aug 2020 12:09:17 -0700 facilities for 128-bit integers; storage subpools and the Newsgroups: comp.lang.ada Default_Storage_Pool pragma, execution - Fallback time zone names changes in the time enforcement of type invariants, and Tool "resource" is available - (MIT package GNAT.Sockets. complete support for new Ada expression License) at: Connection_State_Machine. forms. https://gitlab.com/cpp8/bindata ELV_MAX_Cube_Client.Time_Zones. The new installation approach introduced This tool can take resource files, graphics, Image_Random with ObjectAda for Windows v10.x audio etc. and convert them into Ada (or allows ObjectAda to be used with the C) source code and it can be compiled and From: PragmAda Software Engineering latest releases of Microsoft’s Visual included in the binary. ObjectAda version 10.2 includes version (https://github.com/RajaSrinivasan/assign Subject: [Ann] Image_Random 4.0.0 of the ObjectAda Ada Development ments/blob/master/resource.pdf) but Date: Thu, 3 Sep 2020 17:17:03 +0200 Toolkit (ADT) Eclipse interface which hoping it will be useful to the community. Newsgroups: comp.lang.ada supports Eclipse 2020-03 (4.15) or later. All of these upgrades combined make Image_Random: True random numbers ObjectAda for Windows version 10.2 a Simple Components 4.51 from a digital camera (under Linux with solid, modern, and effective toolset for the GNAT compiler) is now available in development of mission-critical From: "Dmitry A. Kazakov" case anyone finds it useful. application code in the Ada language. Subject: ANN: Simple Components for Ada https://github.com/jrcarter/ ObjectAda version 10.2 supports Ada 95, 4.51 IEEE 754-2008 Decimal Image_Random Ada 2005, and Ada 2012 compiler Date: Mon, 31 Aug 2020 15:28:14 +0200 operation modes to provide compatibility Newsgroups: comp.lang.ada MP Music Player with previous versions. The current version provides From: PragmAda Software Engineering Additional information about ObjectAda implementations of smart pointers, Product Release Announcement which stacks, tables, string editing, unbounded Subject: [Ann] MP can be downloaded from arrays, expression analyzers, lock-free Date: Tue, 15 Sep 2020 22:11:30 +0200 https://www.ptc.com/products/ data structures, synchronization primitives Newsgroups: comp.lang.ada developer-tools/objectada. (events, race condition free pulse events, MP, a Music Player based on the Gnoga Customers with active subscription arrays of events, reentrant mutexes, licenses for ObjectAda for Windows deadlock-free arrays of mutexes), pseudo- audio widget, is available at https://github.com/jrcarter/MP v10.x or ObjectAda64 for Windows v10.x random non-repeating numbers, are entitled to a no-charge upgrade to symmetric encoding and decoding, IEEE v10.2. 754 representations support, streams, multiple connections server/client Ada-related Products If you are not currently using ObjectAda designing tools and protocols and wish to learn more or if you are using implementations. The library is kept PTC ObjectAda V10.2 for an earlier release of ObjectAda and wish conform to the Ada 95, Ada 2005, Ada Windows to upgrade, register your request at 2012 language standards. https://www.ptc.com/en/products/develop [This PTC announcement and the er-tools/objectada/contact-sales. http://www.dmitry-kazakov.de/ada/ following companion were already components.htm published in the previous AUJ number, PTC ApexAda V5.2 Changes (1 September 2020) to the although by date they properly belong in Embedded for version 4.50: this number, so here they are again. --arm] Linux/ARMv8 64-bit - The HTTP client behavior changed not to close connection when keep alive flag From: Shawn Fanning From: Shawn Fanning is set unless the server explicitly requests closing it; Subject: Product Release Announcement – Subject: Product Release Announcement – PTC ObjectAda V10.2 for Windows PTC ApexAda v5.2 Embedded for - Non-standard request headers added to Date: Mon, 27 Jul 2020 16:39:05 -0700 Linux/Armv8 64-bit the HTTP implementation: X- Newsgroups: comp.lang.ada Date: Mon, 27 Jul 2020 16:42:37 -0700 Requested-By, X-Requested-With, X- Newsgroups: comp.lang.ada XSRF-TOKEN, X-CSRF-TOKEN; On July 22, 2020, PTC announced the - The package IEEE_754.Decimal32 was availability of version 10.2 of our On May 19, 2020 PTC announced the added. The package implements IEEE ObjectAda for Windows and release of the PTC ApexAda v5.2 754-2008 decimal32 format; ObjectAda64 for Windows products. This Embedded for Linux/Armv8 64-bit new product release provides full support product. This product is the initial product - The package IEEE_754.Decimal64 was for Ada 2012 language features and offering based on a new 64-bit code added. The package implements IEEE represents the completion of the phased generator for ApexAda for the Armv8 64- 754-2008 decimal64 format; implementation strategy PTC adopted for bit (aarch64) architecture and is our latest Ada 2012 language feature support within

Ada User Journal Volume 41, Number 3, September 2020 128 Ada and Operating Systems release supporting 64-bit embedded 64-bit Arm boards will provide Wasn't aware, thanks! Find that... Very application development. substantial benefits to our customers few refs on the net... looking to modernize existing deployed The host for this product applications while mitigating risks https://dl.acm.org/doi/abs/10.1145/ is x64 Red Hat Enterprise Linux through continued use of the same time- 989798.989799 v7.x/v8.x (or CentOS equivalent) proven and industrial-strength ApexAda From: Jesper Quorning distribution. Using the Linaro GNU cross- compiler technology. The 64-bit Armv8 development toolchain for 64-bit Armv8 (aarch64) processors are now well-known Date: Sat, 25 Jul 2020 07:43:15 -0700 Cortex-A processors on the Linux/Intel64 and proven processors with a long host, PTC ApexAda supports the lifecycle and there are multiple 64-bit > is there a unix like OS written generation of Ada 95 / Ada 2005 Linux distributions available which run completely in Ada? application images that execute on on these processors. Follow-on products ARMv8-A 64-bit (aarch64) processors Do not know if it is unix-like, but this [1] leveraging the new ApexAda 64-bit looks active. Maybe he needs help.. (for example Arm Cortex A53, A57, A72) Armv8 (aarch64) code generation running 64-bit embedded Linux capability for other real-time operating My own dream was to port GNU/Hurd to distributions. Examples of embedded systems are under development with Ada while renaming it to something not Linux distributions which can be prioritization based on customer interest hurding so much. supported are openSUSE Leap v15.1, and requirements. SUSE Linux Enterprise Server for Arm [1] https://github.com/ajxs/cxos v15.1, Ubuntu Server 20.04, Wind River If you would like to receive additional From: Andreas Zuercher Linux and other Yocto-derived Linux information about the new PTC ApexAda distributions with a 64-bit kernel. v5.2 Embedded for Linux/Intel64 to Date: Sat, 25 Jul 2020 12:20:25 -0700 Reference hardware used for the Linux/Armv8 64-bit product or wish to be development and test of ApexAda was the contacted by a PTC Developer Tools sales > is there a unix like OS written Raspberry Pi 3 Model B/B+. (Raspberry representative regarding evaluations, completely in Ada? Pi 4 Model B with its larger 4GB RAM upgrades and associated pricing, register In 1981, there in fact was one that had 2 configuration and other boards such as the your request at public releases with work in progress on VPX-1703 from Curtiss-Wright Defense https://www.ptc.com/en/products/develop Version 3: iMAX-432, depending on how Solutions can also be supported by er-tools/objectada/contact-sales. puritanical one wishes to be about what is ApexAda.) or is not Unix-like. (iMAX-432 was far Included with the 64-bit embedded Ada and Operating more Unix-like than, say, MVS-like or compiler is the PTC® ApexAda v5.2 64- CP/M-like.) bit compiler for Linux native application Systems If anyone has an inside negotiating track development. Also included is the at Intel (or the contracting firm that Intel integrated ApexAda 64-bit C/C++ UNIX OS Written in Ada hired to develop it), perhaps they would compiler which facilitates seamless From: [email protected] be willing to open-source the old development of mixed-language iMAX432 operating system that was applications written in Ada, C, and C++. Subject: is there a version of unix written in Ada released for the iAPX432 processor that ApexAda V5.2 Embedded compilers was designed from the ground up to have provide a complete cross-development Date: Fri, 24 Jul 2020 15:11:47 -0700 Newsgroups: comp.lang.ada an Ada-centric instruction set. Although it toolchain hosted from Linux distributions was more Multics-esque than Unix- including RedHat Enterprise Edition, Is there a UNIX-like OS written esque* and although it was written CentOS, and SUSE. A complete completely in Ada? specifically for the iAPX432 (and thus description of PTC ApexAda v5.2 From: Niklas Holsti had much iAPX432-only assembly Embedded for Linux/Armv8 64-bit is language), it should be relatively easily available within the Product Release Date: Sat, 25 Jul 2020 11:47:35 +0300 transliterable into other ISAs because the Announcement which can be downloaded iAPX432 ISA more closely resembles from https://www.ptc.com/products/ The short answer is "no". Java bytecode, LLVM bitcode, and C# developer-tools/apexada . CIL/MSIL than other rudimentary There have certainly been operating machine codes of that era, due to being The addition of the new code generation systems written in Ada -- the OS for the capability for 64-bit Armv8 processors to object-based/OO-lite in the hardware's Nokia MPS-10 minicomputer is an machine code (which is what doomed the ApexAda opens up a whole new example. landscape for embedded application iAPX432 in the early 1980s: it was so development using ApexAda. PowerPC There are several real-time kernels and complex that it required 3 separate IC dies processors have for a long time been a similar low-level SW components written in 3 separate ceramic packages, and it ran design choice for our aerospace and in Ada, but probably they do not qualify relatively hot). defense customers due to their balance of as "Unix-like", depending on what you * Conversely, both Multics & our modern performance, cost, and power mean by that term. Unix are nowadays birds of the same characteristics. Intel processors have Why do you ask? feather despite the multi-decade offered many of our customers increased dislocation in time from each other, due to performance at a cost of additional From: Stéphane Rivière both having: complexity and power requirements. Date: Sat, 25 Jul 2020 11:36:57 +0200 Driven by the mobile consumer market, 1) multiple threads per address space; See OS section of Arm processors provide high performance 2) multiple DLLs per address-space; and low power advantages over Intel https://github.com/ohenley/awesome-ada processors. We think these advantages > There have certainly been operating 3) multiple memory-mapped files (i.e., combined with the flexibility provided by systems written in Ada -- the OS for the mmap(2) in Unixes versus snapping embedded Linux distributions and the Nokia MPS-10 minicomputer is an segment-files in Multics); availability of low-cost and high- example. 4) IPC based on multiple threads or performance consumer-grade multiple processes pending on a single development boards as well as ruggedized message-queue;

Volume 41, Number 3, September 2020 Ada User Journal Ada and Operating Systems 129

5) soft real-time thread scheduling what is or is not Unix-like. (iMAX-432 In approaching this project again, I would priorities in addition to time-sharing was far more Unix-like than, say, like to know as much as possible about scheduling priorities; MVS-like or CP/M-like.) how far AdaCore's people or helpers have come in their developments for and Very interesting Andreas, thanks for this OpenVMS, what problems they have 6) a GNU-esque long-form whole-words part of Ada and CPU history... dealt with in the GCC upgrades they have and short-form abbreviated-letters of From: Stéphane Rivière resolved, only considered, and those they each hyphenated command-line flag Date: Mon, 27 Jul 2020 09:40:04 +0200 have seen as too difficult and blocking. The question arises as well for the are birds of much the same father, as > The same group recently announced upgrades (with for example around this opposed to 1970s-era spartan Unix that M2OS, which is also in Ada, but not time the transition of the GCC build to abhorred all of these multiplicities, hence Unix-like. C++) as for the evolution of the debug AT&T's uni-based name in AT&T's > https://m2os.unican.es/ management. 1970-divorce-from-MIT's/GE's/AT& Not aware of that, Thanks Jeffrey If the answers raise confidentiality issues, T's/Honeywell's-Project-MAC in defiance I don't want to put anyone in trouble, but of Project MAC's multi-based name, I will test that, the Toolchain is Linux I'm looking for indications on who to because the tongue-in-cheek humor of based and includes GDB... negotiate with. Unix's name as eunuchs is Multics castrated. Eschewing singleton this and From: nobody in particular It's not impossible that AdaCore's people singleton that, Unix nowadays is no were among the last to develop GCC for longer a castrated eunuch, due to Date: Mon, 27 Jul 2020 14:58:36 +0000 OpenVMS Itanium. They may also be reintroducing a cousin-like variant of > If anyone has an inside negotiating able to inform me about the build of the C nearly every multiplicity feature of track at Intel (or the contracting firm and C++ part for GCC OpenVMS. I think Multics other than the multiple rings that Intel hired to develop it), perhaps indeed to associate to my efforts for Ada (unless one counts VM hypervisors they would be willing open-source the the exploration of the availability of a nowadays as reintroducing a cousin of old iMAX432 operating system that C++ GCC for Itanium OpenVMS. that one too). was released for the iAPX432 This resumption of [this] project is quite https://en.wikipedia.org/wiki/IMAX_432 processor that was designed from the at its beginning. My goal is to open as ground up to have an Ada-centric much as possible the work and its results From: Stéphane Rivière instruction set. Date: Sun, 26 Jul 2020 21:45:50 +0200 to a collaborative work, in Open Source I guess it could be worthwhile contacting standards. One of my first tasks will be to > I remember someone was writing an OS Steve Lionel who recently retired from update the current repository to allow in Ada, but I do not remember who Intel after working for DEC, COMPAQ, opened development. was, nor the name of the project, nor if HP, on Fortran compilers. He has a blog From: Andreas Zeurcher it was unix-ish. site, I'll not post the details here so as not In the very old archive to encourage automated spam. Doctor Date: Mon, 17 Aug 2020 11:56:56 -0700 Fortran is his nickname. https://stef.genesix.org/aide/ For those interested, a hobbyist license of aide-src-1.04.zip you will find: Ada on OpenVMS Retake OpenVMS is available from VMS - The last RTEMS 3.2.1 Ada sources Software, Inc., which is the new owners (yes... old RTEMS releases are offered From: gérard Calliet of VMS instead of HPE. There is also a in two flavors: Ada and C) comes with free Alpha emulator for Windows 10 as docs & manuals. Subject: Ada on OpenVMS, where to have a well. new beginning - the Ada sos-os Ada series (based from https://training.vmssoftware.com/hobbyist edu-os in C) Date: Mon, 17 Aug 2020 19:14:17 +0200 Newsgroups: comp.lang.ada From: nobody in particular From: "Jeffrey R. Carter" I participated in a GNAT Ada build for Date: Tue, 18 Aug 2020 18:49:13 +0000 Date: Mon, 27 Jul 2020 00:15:52 +0200 Itanium OpenVMS (https://github.com/ AdaLabs/gnat-vms) a few years ago. It is It is unlikely yet perhaps Steve Lionel > - The last RTEMS 3.2.1 Ada sources based on a GCC 4.7.3 . will have some info on this. Although he (yes... old RTEMS releases are offered was not involved with Ada (to my in two flavors : Ada and C ) comes with I'm coming back to this work to maintain knowledge) he was a fixture in the docs & manuals. it and make it evolve, in a general compiler community for Fortran and approach of making Ada available in probably more, at DEC, COMPAQ, and Marte OS implements Minimal Real- OpenVMS environments (VAX, Alpha, Time POSIX.13 in Ada, so it should be HP over a long period and might be able Itanium, and soon x86). to identify likely suspects to contact. Unix-like. (http://www.vmsadaall.org/index.php/en/) https://marte.unican.es/ This year the VMS port to Intel X86 was For VAX and Alpha we have at least finally completed The same group recently announced DEC Ada and Alsys Ada. On Itanium I M2OS, which is also in Ada, but not have to maintain GNAT Ada on GCC. https://vmssoftware.com/updates/ Unix-like. For x86 I have to base on the GNAT Ada state-of-the-port/ front end for LLVM, since VSI ports https://sciinc.com/remotevms/ https://m2os.unican.es/ VMS to x86 (https://vmssoftware.com/ vms_techinfo/vms_news/ updates/state-of-the-port/) basing the From: Stéphane Rivière OpenVMSOnX86-64.asp Date: Mon, 27 Jul 2020 09:40:05 +0200 compilers on LLVM. I remember a lengthy discussion in the I know that AdaCore dropped commercial > In 1981, there in fact was one that had 2 VMS newsgroup many years ago support for GNAT Ada on OpenVMS in public releases with work in progress regarding the future of Ada on VMS. I 2015. It's not the commercial reasons that on Version 3: iMAX-432, depending on believe the guys at the above companies interest me. how puritanical one wishes to be about were involved. I think the conclusion was

Ada User Journal Volume 41, Number 3, September 2020 130 Ada Practice they would not or could not handle it in- LLVM licensing, which re-sparked a house and I believe the Ada they had on Ada Practice somewhat more focused discussion in VMS was only 95. There were relation to the original topic, which murmurings that they would try to find Ada on Apple's New follows. --arm] somebody to do it but I did not hear that Processors Licensing From: [email protected] AdaCore ever released anything. Concerns Date: Thu, 25 Jun 2020 00:21:01 -0700 Thank you, I'll follow this thread with > The compiler links to GNAT-LLVM, interest. [The thread started with compiler backend concerns, but most of it evolved towards the runtime doesn't. licensing issues in view of the > Pretty sure that the AdaCore people said Ada and Other optimizations that the Apple Store may it won't fall under GPL. perform to intermediate code. As is often Languages the case with licensing arguments, no That's correct, there is no issue here. The entirely satisfactory consensus was GNAT LLVM compiler is a tool and is CLU and Alphard reached on the actual situation, and any licensed under GPLv3, which is just fine Grammars conclusions in any case should be vetted and the proper license for a tool. The by qualified experts. One possible runtime which is linked with your From: Oliver Kellogg takeaway, as Fabien Chateau summarizes executable comes from the gcc.gnu.org in one of his posts, is that the GNAT- repository and contains the GCC Subject: CLU and Alphard grammars LLVM frontend opens many possibilities RunTime exception license. available in HTML that did not exist before, which is a net From: "Luke A. Guest" Date: Thu, 23 Jul 2020 15:02:09 -0700 positive in any case. Newsgroups: comp.lang.ada Date: Thu, 25 Jun 2020 10:55:39 +0100 The complete thread can be found at The research languages CLU and Alphard https://groups.google.com/g/comp.lang.ad > That's correct, there is no issue here. had some influence on the design of Ada a/c/lHQQfRATKno --arm] [...] [1]. From: Jerry Can you confirm that using FSF GNAT The available grammar documents [2], [3] Subject: Ada on Apple's new processors with GNAT-LLVM (GPLv3) does or are in Postscript or PDF format, in the Date: Mon, 22 Jun 2020 15:53:00 -0700 does not enable the IR clause in the case of Alphard in a somewhat hard to Newsgroups: comp.lang.ada GPLv3? read typeface due to being scanned from Apple is beginning its third nightmare From: [email protected] the original document. transition to a new processor family. Date: Thu, 25 Jun 2020 03:14:31 -0700 What does this mean for Ada on macOS? For an HTML version of the grammars, > Can you confirm that using FSF GNAT see Can we hope for a native compiler with GNAT-LLVM (GPLv3) does or http://okellogg.de/proglang/ anytime soon? We will have Rosetta 2 does not enable the IR clause in the CLU-syntax.html until we don't. (Original Rosetta lasted for GPLv3? two OS generations and then it was taken http://okellogg.de/proglang/ away.) I could tell you the story of It does not and in any case, invoking this alphard-collected-syntax.html needing to run a small PowerPC program clause is a red herring since as explained in the license, the concern and what's not [1] Ada 83 LRM section 1.3 to set up a slightly old Apple WiFi device a couple years ago. Buy Parallels. Call allowed is using an intermediate See e.g. http://archive.adaic.com/ Apple and send $30 to get Snow Leopard representation and feed it to a proprietary standards/83lrm/html/lrm-01-03.html Server--that's 10.6. Virtualize Snow (non-GPL-compatible) software to e.g. Leopard Server on Parallels to run the optimize it or further process it. LLVM is [2] CLU Reference Manual Appendix A WiFi set-up program in Rosetta.) a GPL-compatible Software, so this is irrelevant. See e.g. http://okellogg.de/proglang/ From: Vadim Godunko CLU-syntax.pdf From: Simon Wright Date: Tue, 23 Jun 2020 03:42:46 -0700 [3] An informal definition of Alphard Date: Thu, 25 Jun 2020 12:03:14 +0100 > Apple is beginning its third nightmare See e.g. http://okellogg.de/proglang/ > It does not and in any case, invoking An_informal_definition_of_Alphard.pdf transition to a new processor family. What does this mean for Ada on this clause is a red herring since as From: "[email protected]" macOS? explained in the license, the concern and what's not allowed is using an Date: Wed, 19 Aug 2020 13:27:33 -0700 > Can we hope for a native compiler intermediate representation and feed it anytime soon? to a proprietary (non-GPL-compatible) Update: I suppose native toolchain will be based software to e.g. optimize it or further Translation of the full "Informal on LLVM, thus it will allow to use GNAT process it. Definition of Alphard" document to LLVM on new processors. Optikos has (at last) made clear his HTML is in progress, see [A large discussion is omitted at this concerns about this: if it is indeed the case http://okellogg.de/proglang/ point on the implications of GCC code that Apple requires App Store developers an-informal-definition-of-alphard.html generation in regard to the Runtime to deliver bitcode for further proprietary Library Exception (RLE) clause of optimizations then there might be an 100% completion ETA is within the next GPLv3. However, as later was pointed issue. few weeks. out, GNAT LLVM does not have any Depends on whether LLVM IR (which I relation to GCC. understand is logically equivalent to Arnaud Charlet from AdaCore eventually bitcode) can count as target code? I've jumped in to clarify the status of GNAT seen it described as LLVM assembler ...

Volume 41, Number 3, September 2020 Ada User Journal Ada Practice 131

From: "Luke A. Guest" > I don't see anything new here. > GNAT LLVM doesn't use nor depend on GCC at all: it goes directly from the Date: Thu, 25 Jun 2020 12:25:59 +0100 What is new here is that there appear to GNAT be well-reasoned ways (e.g., the Wide > [...] further proprietary optimizations legal theory along this thread [that LLVM Ok, makes sense. [...] might be an issue. IR is a kind of IR code according to the > tree to LLVM bitcode, there is never > Depends on whether LLVM IR [...] can RLE --arm]) that GNAT-LLVM could any GENERIC nor GIMPLE in sight by count as target code? •force• a developer's app to [be] GPLed design and never can be (unlike with against the developer's will by easy-to- the old DraggonEgg FWIW). Indeed. The only thing I've found so far is enact-in-GNAT-LLVM violations of the this: RLE's terms that cause the Compilation But, GNAT is 1 part of GCC and the https://thenextweb.com/apple/2015/06/17/ Process to not achieve the stricter Eligible GPLv3 mentions IR, what constitutes the apples-biggest-developer-news-at-wwdc- Compilation Process definition, due to IR? Surely it covers the Ada AST IR? that-nobodys-talking-about-bitcode/ Apple's closed-source manipulations of LLVM IR bitcode. Does the GPL infect across the different Quote from near the top: IR boundaries? Perhaps the work-around is that GNAT- 'This means that apps can automatically LLVM-based developers of apps should [...] “take advantage of new processor •never• submit LLVM IR bitcode to From: Simon Wright capabilities we might be adding in the Apple's App Store's app-intake procedure. future, without you re-submitting to the In the past as far back as 2015, submitting Date: Tue, 30 Jun 2020 21:01:59 +0100 store.”' bitcode instead of machine code was > GNAT LLVM doesn't use nor depend optional. It is unclear with the new ARM- From the apple docs it links to at the top: on GCC at all: it goes directly from the based Macs, whether that optionality will GNAT tree to LLVM bitcode, there is "Bitcode is an intermediate representation continue in the future, or whether that never any GENERIC nor GIMPLE in of a compiled program. Apps you upload optionality has already been curtailed. sight by design and never can be to App Store Connect that contain bitcode (Conversely, under the Narrow legal (unlike with the old DraggonEgg will be compiled and linked on the App theory along this thread [that LLVM IR is FWIW). Store. Including bitcode will allow Apple equivalent to assembly code and not an It seems to me that there's a lot of to re-optimize your app binary in the actual IR for RLE purposes --arm], your future without the need to submit a new argument about things which can't or claim is correct, nothing has changed: if won't be changed. version of your app to the App Store. " an app-developer doesn't want to suffer So, it looks like he [Andreas Zuercher, the mutual incompatibility of the GPL and AdaCore have produced GNAT-LLVM as aka Optikos --arm] is right. Apple App Store, then don't choose GPL a proof of concept, aimed really at targets as the license for the app, because despite not supported by GCC but of interest to From: Fabien Chouteau its name LLVM IR bitcode is merely AdaCore's customers. assembly language which is unregulated Date: Tue, 30 Jun 2020 04:16:38 -0700 by RLE.) GNAT-LLVM code itself is (C) AdaCore, > this later closed-source processing of and is GPLv3. The gcc/ada code is (C) From: [email protected] FSF, and is GPLv3. the app by Apple for nonjailbroken Date: Tue, 30 Jun 2020 07:35:03 -0700 ARM-based Macs and iDevices to No change there. distribute via the App Store seems to > We need clarification on whether the violate terms of at least the RLE translation from GCC's IR to LLVM's The current build takes the RTS from FSF [Runtime Library Exception] if not IR invokes this clause. I'm not sure if GCC, though clearly it could take it from GPLv3 too. GNAT final IR before the GNAT- elsewhere (e.g. some bare metal RTS). LLVM backend is GENERIC or The Apple app store is incompatible with GIMPLE. That RTS is (C) FSF, GPLv3 + runtime the GPL since long ago: exception. https://www.fsf.org/blogs/licensing/ GNAT LLVM doesn't use nor depend on GCC at all: it goes directly from the Some here have thought, Aha! LLVM, more-about-the-app-store-gpl- RTS with runtime exception, people could enforcement GNAT tree to LLVM bitcode, there is never any GENERIC nor GIMPLE in produce apps for iOS!!!! I don't see anything new here. sight by design and never can be (unlike Then, cold reality strikes: it looks as From: Optikos with the old DraggonEgg FWIW). though there's a conflict between the > I've had a quick look in GNAT-LLVM actual terms of the runtime exception and Date: Tue, 30 Jun 2020 05:28:45 -0700 and I cannot see any flags enabling the Apple's requirements for code to be output of GCC's IR, only LLVM's IR. submitted to the App Store (it needs to be > in LLVM IR or equivalent); the code > The Apple app store is incompatible See above. would very likely lose the protection of with the GPL since long ago: By the way the reason I haven't answered the runtime license umbrella. https://www.fsf.org/blogs/licensing/mor other messages is mainly because I am e-about-the-app-store-gpl-enforcement Now, guys, given that there's Apple on not familiar with Apple's specific one side standing on a mountain of money Yes, when the developer's app is GPLed, constraints here, so I'd rather not make and a prickly attitude to what they'll the App Store's terms and the GPL's terms any statement about them rather than accept for their app store, and on the other are mutually incompatible. Historically, making wrong statements and you side a very much smaller developer GPLing an app would have been by shouldn't draw any conclusion from the community, who's going to risk going to developer choice (unless somehow fact that I haven't replied to some of the court to put a GNAT app on to the App violating the RLE which was rare in messages in this thread. Store? practice because using garden-variety From: "Luke A. Guest" unmodified IR-unadorned GNAT, GCC, Whether you could make such an app and run it on iPhones privately, without going and so forth resulted in an Eligible Date: Tue, 30 Jun 2020 15:46:43 +0100 Compilation Process in RLE).

Ada User Journal Volume 41, Number 3, September 2020 132 Ada Practice through Apple & the App Store, I don't > I'd have thought that AdaCore's June 2015 as a key technology related know. I'm sure the NSA can. response to this idea would be to ask to App Store submission and where you got the idea that iOS & the downstream proprietary processing by [...] App Store would feature as a candidate Apple post-submission: From: "Luke A. Guest" target. It seems like you focus too much on Date: Tue, 30 Jun 2020 21:20:27 +0100 Gee, either details of a simple README. LLVM bitcode is sometimes used to talk about >> By that point, there should be a strong a) we all concurrently pulled it out of thin the general LLVM IR. track record of technical knowledge air via overactive imagination as you regarding Apple's bitcode submission imply, The example use cases mentioned by the README are bringing more tooling to policies to the App Store to relay to the or attorneys so that they can simply turn the Ada ecosystem, for instance with the legal crank to make a b) the following extant events & facts KLEE, or "connecting the GNAT front- decision/adjustments of whether/how transpired: end to the LLVM code generator". GNAT-LLVM is to transition out of It took time and effort to publish GNAT- experimental status. At least an engineer at AdaCore (if not AdaCore speaking as an organization) LLVM on GitHub, and AdaCore had > I'd have thought that AdaCore's wrote the following on the GNAT-LLVM absolutely no obligation to do so. To be response to this idea would be to ask repository's README.md: honest, I am personally a bit disappointed where you got the idea that iOS & the to see such a long discussion on what is App Store would feature as a candidate “[GNAT-LLVM] is a work-in-progress allegedly not possible to do with GNAT- target. research project that's not meant for and LLVM (and was absolutely not possible shouldn't be used for industrial purposes. before anyway), rather than all the I'm developing SDLAda, there are mobile It's meant to show the feasibility of possibilities that GNAT-LLVM opens. targets. I don't see why Ada shouldn't. generating LLVM ••bitcode•• for Ada.” Jesus, even COBOL can compile to (emphasis added) From: Simon Wright mobile according to an article I read a while ago. If AdaCore and Ada users LLVM.org did not organically produce Date: Wed, 01 Jul 2020 12:03:10 +0100 want people not thinking that Ada is an bitcode out of their own volition. Bitcode > It took time and effort to publish ancient language, then it needs to wake was Apple's idea, Apple's design, GNAT-LLVM on GitHub, and up, smell the coffee and get on mobile. contributed by Apple to benefit primarily AdaCore had absolutely no obligation Apple as a strategic technology to From: Wesley Pan to do so. To be honest, I am personally facilitate Apple's OS-optimization & a bit disappointed to see such a long processor-switcheroo goals without Apple Date: Tue, 30 Jun 2020 15:07:05 -0700 discussion on what is allegedly not begging all app developers to resubmit a possible to do with GNAT-LLVM (and > I'm developing SDLAda, there are plethora of minor-variation apps every was absolutely not possible before mobile targets. I don't see why Ada time Apple has a bright idea or Big New anyway), rather than all the possibilities shouldn't. [...] Thing. So when GNAT-LLVM's that GNAT-LLVM opens. README.md is explicitly calling out I COMPLETELY agree with Luke! We bitcode emission as the A#1 top-priority Personally, I thank AdaCore for making need Ada to expand to things like mobile, reason for GNAT-LLVM to exist, by such an interesting project available. gaming, and other "more exciting" using that very term bitcode, it is quite markets to help attract the new clear that the intended reading of A couple of postings down Jeffrey Carter generations of software engineers and to README.md is referring to the Apple- quoted this, which seems apt in the stay relevant in the public's eyes. The Apple-Appleness of bitcode since bitcode current context: gaming industry alone rivals that of was announced at Apple's Worldwide Hollywood. By the end of 2019, GTA 5 "Propose to an Englishman any Developer Conference in June 2015 as a principle, or any instrument, however sold more than 100 million copies key technology related to App Store worldwide, earning its publisher more admirable, and you will observe that the submission and downstream proprietary whole effort of the English mind is than $6 billion on a $265 million processing by Apple post-submission: development budget. That's not chump directed to find a difficulty, a defect, or an change. How can members of the Ada https://TheNextWeb.com/apple/2015/06/ impossibility in it. If you speak to him of community ever really jump into such 17/apples-biggest-developer-news-at- a machine for peeling a potato, he will industries if the same issues like the wwdc-that-nobodys-talking-about-bitcode pronounce it impossible: if you peel a license keep coming up as roadblocks?! potato with it before his eyes, he will From: Fabien Chouteau declare it useless, because it will not slice I'm not in any way suggesting the Ada a pineapple." community give up its focus on the safety Date: Wed, 1 Jul 2020 02:23:29 -0700 Charles Babbage and reliability angle. Those are very > Gee, either important too. But, if you were to have From: Wesley Pan affordable/free Ada tools for > a) we all concurrently pulled it out of mobile/gaming on one side, and thin air via overactive imagination as Date: Thu, 2 Jul 2020 17:51:36 -0700 you imply, expensive tools for the next-gen Mars > It took time and effort to publish rover on the other side, which do you > or GNAT-LLVM on GitHub [...] think would attract more end users? > b) the following extant events & facts Hi Fabien, BTW, even the new "cool" Rust language transpired: is being used to develop apps for mobile. The answer is a). That's a fair point. As with any compiler Ada apps....? related development (and software in > it is quite clear that the intended reading From: Optikos general), I'm sure the amount of time and of README.md is referring to the effort it took to create GNAT-LLVM was Apple-Apple-Appleness of bitcode Date: Tue, 30 Jun 2020 21:46:47 -0700 significant. Aside from the licensing since bitcode was announced at Apple's issue/debate, it is a really great Worldwide Developer Conference in contribution to the Ada community and I

Volume 41, Number 3, September 2020 Ada User Journal Ada Practice 133 hope it becomes production quality in the These have been my exact concurring [3] Let the function return a record with a very near future. conclusions as well for over 2 years now, field Value with the actual result and a when I back then ceased coding up my field Error with the estimated precision. AdaCore is the main (if not only) own variant resembling what is now company that continues to make known as GNAT-LLVM. Some of my This would make the code a bit heavier innovative and very helpful tools related design/coding work was hinted at in since instead of calling to Ada (e.g. libadalang and LearnAda). multiple of my postings here on c.l.a. X := Lambert(Y); As you pointed out, AdaCore was not back then. I figured out these ••chilling obligated to make such contributions. effects•• on my own over 2 years ago. you would say GNAT-LLVM could very well have been X := Lambert(Y).Value; kept in closed doors to only further Question about Best AdaCore's internal development. Practices with Numerical Not really a huge deal, however... When news about GNAT-LLVM first Functions [4] Print a warning message to standard came out, I for one thought it would error or some logging system and go on. finally allow people to create IOS apps in From: mockturtle Ada and to further the adoption of the This sounds like the worst option to me. Subject: Question about best practices with The message could be overlooked and, language. Sadly, not sure that will ever numerical functions happen now... moreover, it supposes there is some Date: Fri, 3 Jul 2020 22:30:52 -0700 logging facilities or that the standard error From: [email protected] Newsgroups: comp.lang.ada is available for logging... Remember that Date: Fri, 3 Jul 2020 04:08:00 -0700 I have a question about the best way to the function should be general, to be used > It took time and effort to publish manage a potential loss of precision in a in any program. GNAT-LLVM on GitHub [...] numerical function. This is a doubt that [5] ??? came to my mind while writing a piece of There is a bias here: the people discussing software; now I solved the specific Any suggestions? on comp.lang.ada tend to be busy... problem, but the curiosity remains. discussing on comp.lang.ada - and less Thank you in advance busy doing actual programming. Chatting Let me explain. From: "Dmitry A. Kazakov" and programming are incompatible Recently I needed to write an activities IMHO. At least you cannot do Date: Sat, 4 Jul 2020 09:50:57 +0200 both at exactly the same time... implementation of the Lambert W function (is the function that given y finds > [5] ??? From: Simon Wright x such that x*exp(x)=y). This function cannot be expressed with elementary [5] Interval computations is the best way Date: Thu, 02 Jul 2020 10:54:27 +0100 functions and the algorithm I found to handle rounding errors: basically solves the equation in an > "The LLVM code representation is https://en.wikipedia.org/wiki/ iterative way. Of course, if you fix the designed to be used in three different Interval_arithmetic forms: as an in-memory compiler IR, as maximum number of iterations, it can an on-disk bitcode representation happen that the convergence is not fast An Ada implementation is here: (suitable for fast loading by a Just-In- enough and you obtain a result that is Time compiler), and as a human potentially less precise than what you http://www.dmitry-kazakov.de/ada/ readable assembly language would expect. intervals.htm representation", which to me precisely From: "Nasser M. Abbasi" I was wondering how to manage such a matches "data in any format that is used non convergence case. Please note that I as a compiler intermediate Date: Sat, 4 Jul 2020 05:45:57 -0500 am supposing that I am writing a representation, or used for producing a "general" function that could be used in compiler intermediate representation". Most Fortran Lapack use INFO code. many different programs. If the function On thinking about this further, I can't help was specific for a single program, then I "All documented routines have a wondering whether this is deliberate. would choose the line of action (e.g., diagnostic argument INFO that indicates ignore, log a warning or raise an the success or failure of the computation, From: [email protected] exception) depending on the needs of the as follows: Date: Fri, 3 Jul 2020 17:18:40 +0000 specific program. INFO = 0: successful termination > On thinking about this further, can't help wondering whether this is (Incidentally, it turned out that the INFO < 0: illegal value of one or more deliberate. implementation converges nicely for any arguments -- no computation performed value of interest; nevertheless, the Why doubt? FSF clearly did not want curiosity remains...) INFO > 0: failure in the course of what Apple is doing now. Apple computation" understood this well, left GCC I can see few line of actions that would development and started promoting make sense https://www.netlib.org/lapack/lug/ node138.html LLVM. FSF lawyers formulated [1] Raise an exception. appropriate licencing language. So the So you could follow that. remaining question is if they did a good Maybe this is a bit too drastic since there job. Basically folks here are searching for are cases where a moderate loss of [...] a loophole. Loopholes happen, but FSF precision does not matter (this was my From: Shark8 was careful, so do not bet on this. case, i just needed one or two decimal digits) From: Optikos Date: Mon, 6 Jul 2020 10:02:39 -0700 [2] Let the function have an optional > [5] ??? Date: Fri, 3 Jul 2020 11:31:33 -0700 "precision" parameter and raise an > Any suggestions? exception if the precision goes below that > Why doubt? [...] One way to do this would be to use fixed- point types:

Ada User Journal Volume 41, Number 3, September 2020 134 Ada Practice

(1) Convert your input to the fixed-point type Item (Size : Stream_Element_Count) [2] https://en.wikipedia.org/wiki/ that has a "good enough" delta for the is record MessagePack precision you want. Data : Stream_Element_Array (1..Size); (2) Run the algorithm. end record; Fixed vs Float Precision and (3) Convert back to your normal value- Instantiate the generic buffer with this Conversions type. type. Use stream attributes to serialize/deserialize. From: Björn Lundin This assumes you're using floating-point or integers, but one nice thing about Alternatively you can do it with Subject: Fixed vs float and precision and fixed-point is that it has a bounded error Storage_Element in the above and use a conversions when dealing with operations, unlike fake storage pool to store/restore objects. Date: Tue, 7 Jul 2020 23:10:20 +0200 floating-point. -- I remember some years Or a combination "for X'Address use Y" Newsgroups: comp.lang.ada with pragma Import (Ada, X); ago seeing a bug report dealing with I've for years run an interface towards floating-point, where the particular error If the type set is somewhat statically external part on a raspberry pi that simply couldn't have happened with known you can use a variant record as an communicates with JSON over http fixed-point. element too. (JSONRPC2) From: "Dmitry A. Kazakov" In some cases you can have a ring buffer the versions are [...] Date: Tue, 7 Jul 2020 00:23:06 +0200 of type tags and a set of ring buffers. For each type tag you would keep values in a I have found this reliable but suddenly I > One way to do this would be to use separate ring buffer. have got some rounding troubles. Or I fixed-point types: perhaps just discovered it now. From: "J-P. Rosen" Rounding error is bounded in both cases. Date: Thu, 24 Sep 2020 06:39:43 +0200 I have a fixed type Fixed-point has same error regardless of > Does anybody knows any example of type Fixed_Type is delta 0.001 digits 18; the values involved in the operations. this written in Ada? Floating-point has error depending on the but JSON does not support that. So I get values. Hmmm, you know, Ada is a strongly floats instead. I use gnatcoll.json as parser typed language, therefore what you put in by the way I would say that floating-point error a buffer must have a well defined type. would be roughly the same for addition, [Skipped example that boils down to subtraction and multiplication, provided There are two possibilities: converting a float to a fixed point type. --arm] fixed-point does not overflow. It will be 1) If you can accept several buffers, one hugely better for division. for each type, make it generic and The message (JSON) contains a value Using fixed-point arithmetic has only instantiate it as many times as you need 5.10 (in a float), but that is converted sense for a few marginal cases of 2) Make a buffer of Stream_Elements, (sometimes I think) to the fixed_type rounding. and use the streaming attributes ('Read, variable with value 5.099. This gets me into trouble further down in the code. Furthermore converting many algorithms 'Write) to turn any type into stream to fixed-point might turn quite non-trivial elements. So - What should I do instead? as you will have to ensure absence of Ada.Streams.Stream_IO can also be should I express my Fixed_Type in overflows and underflows. Where handy in some cases. another way? floating-point computation just would lose some precision, fixed-point will From: Simon Wright I need to be able to express 6.5 % (0.065) catastrophically fail. which I could not with type Fixed_Type Date: Fri, 25 Sep 2020 15:32:01 +0100 is delta 0.01 digits 18; General Circular Buffer As J-P has said, you could use 'Write and From: Niklas Holsti 'Read (or better, 'Output and 'Input) to From: Daniel write to a stream. Date: Wed, 8 Jul 2020 00:30:29 +0300 Subject: General circular buffer example The beginnings of an alternative, which I According to RM 4.6(31), conversion to a not tied to any specific type last worked on a while ago, is at [1]; it's decimal fixed-point type does not round, Date: Sat, 4 Jul 2020 10:00:26 -0700 an Ada implementation of part of but truncates toward zero if the operand is Newsgroups: comp.lang.ada MessagePack[2] (boolean, integer, float, not a multiple of the "small" of the target string). Still a way to go! type, which is usually the case here if Hello, any theoretical example of buffer I Floats are base-two. can find is always tied to a specific type. Writing arbitrary data to a stream using 'Write/'Output suffers from the You should perhaps change the I'm looking for any example of Ravenscar disadvantage that the reading side won't conversion (Target := Fixed_Type(Tmp)) buffer able to use any type of data at the know what to expect unless you have to round, by doing Target := same time. some protocol in place. This Fixed_Point'Round (Tmp). I suppose it will need to serialize all data Message_Pack doesn't eliminate this at Note, I haven't tried it. and manipulate it as a group of bytes. all. For a while, I supported a scheme where From: Björn Lundin Does anybody know any example of this written in Ada? all the data to be transmitted had to be instances of a tagged type e.g. Base; as far Date: Wed, 8 Jul 2020 20:10:35 +0200 From: "Dmitry A. Kazakov" as I can remember, you output the data The main reason for asking was to see if I using Base'Class'Output and read it in got the whole concept of fixed types Date: Sat, 4 Jul 2020 19:25:22 +0200 using Base'Class'Input. wrong or not. Ring buffer of indefinite elements would [1] https://sourceforge.net/u/ be OK. As an element you can use this: simonjwright/msgpack-ada/code/ ci/master/tree/

Volume 41, Number 3, September 2020 Ada User Journal Ada Practice 135

I did expect 'You should do this or that From: Niklas Holsti This is an interesting pedagogical one-liner' as Niklas proposed. I did not get example, but the actual algorithm is too that to work though. Date: Wed, 8 Jul 2020 23:34:46 +0300 specialized to be of general use. From: Niklas Holsti > I did a test routine like below, but From: Simon Wright realized that Float(5.10) - which was Date: Wed, 8 Jul 2020 21:21:45 +0300 converted to Fixed_Type(5.099) is a Date: Thu, 09 Jul 2020 21:00:18 +0100 valid fixed_type of course. > I did expect 'You should do this or that Interesting! one-liner' as Niklas proposed. I did not No, see below. You are confusing decimal get that to work though (base-10) reals with binary (base-2) floats. I thought to have a bit of a play with it, [...] The point is that Float'(5.10) is not and I found that neither CE 2019 nor CE Oh. What happened when you tried? How 2020 will prove as is, including "assertion did it fail? exactly 5.10, because base-2 floats cannot represent decimal fractions exactly. Since might fail, cannot prove Bottom < Top"; From: Shark8 the result, as you showed in your first but it proves just fine with post, of converting (with truncation) type Element_Type is new Integer; Date: Tue, 7 Jul 2020 14:58:40 -0700 Float'(5.10) to Fixed_Type is 5.099, the or > but JSON does not support that. So I get actual (binary) value of Float'(5.10) is a floats instead. little less than 5.10, so the truncation subtype Element_Type is Integer; gives 5.099 instead of 5.100. This is a limitation of JSON, IIUC: all From: "J-P. Rosen" numeric are IEE754 floats -- see: But Fixed_Type'Round (Float'(5.10)) will Date: Fri, 10 Jul 2020 06:17:21 +0200 always give 5.100. https://www.json.org/json-en.html Hmmm... The following O(N**2) If you have access to both sides of the [...] function: serialization, you could define an function Is_Sorted (Table : Array_Type) intermediate serialization say a string of Binary Search SPARK Proof return Boolean "Fixed_Type#value#" where 'value' is the is (for all L in Table'Range => From: mockturtle string-representation you need. -- You can (for all M in Table'Range => Subject: My new post on dev.to about extract the value by indexing on the '#' (if L > M then Table (L) > Table (M)))) SPARK characters, extracting the portion in with Ghost; between, and feeding that via Date: Thu, 9 Jul 2020 07:16:20 -0700 Fixed_Type'Value( Newsgroups: comp.lang.ada can be changed to a O(N) function: EXTRACTED first a bit of disclaimer: this is about a function Is_Sorted (Table : Array_Type) _SUBSTRING ), and produce it via recent post of mine on dev.to I post this return Boolean "Fixed_Type#" & Fixed_Type'Image( here since I think that maybe someone in is (for all L in Table'First .. Table'Last -1 fp_value ) & '#'. this group could be interested. => Table (L) < Table (L+1)) From: "Dmitry A. Kazakov" with Ghost; Recently I wrote a small binary search procedure for a software of mine. Since I From: Paul Rubin Date: Wed, 8 Jul 2020 20:36:47 +0200 always wanted to start using SPARK, I > The main reason for asking was to see if thought that this could be a nice small Date: Thu, 09 Jul 2020 23:04:03 -0700 I got the whole concept of fixed types problem to start playing around with > Hmmm.. The following O(N**2) wrong or not. SPARK. The post on dev.to is about my function: [...] can be changed to a O(N) experience. Fixed-point is conceptually a scaled function [...] integer. You should deal with it If you are curious Should it matter? The code is never accordingly. [It could be a bit surprising https://dev.to/pinotattari/ executed. It's only used as a specification in Ada where conversion to integer for the theorem prover. rounds. In most languages conversion to proving-the-correctness-of-a-binary- integer truncates] search-procedure-with-spark-ada-34id By the way, Riccardo, thanks for posting From: Fabien Chouteau that. It was impressive to see that an [...] executable-looking spec like that could be From: Björn Lundin Date: Thu, 9 Jul 2020 08:27:16 -0700 proved automatically with the help of just a few pragmas. I hadn't posted yet Date: Wed, 8 Jul 2020 21:39:20 +0200 I shared it on reddit: because I haven't yet had a chance to try https://www.reddit.com/r/programming/ building and playing with the program. > Oh. What happened when you tried? comments/ho4zzp/ How did it fail? proving_the_ From: "J-P. Rosen" Date: Fri, 10 Jul 2020 09:47:16 +0200 I did a test routne like below, but realized correctness_of_a_binary_search/ > Should it matter? The code is never that Float(5.10) - which was converted to Go upvote :) Fixed_Type(5.099) is a valid fixed_type executed. of course. From: "Jeffrey R. Carter" For Spark, no (although I think that the so Date: Thu, 9 Jul 2020 18:35:39 +0200 simpler version is more understandable). But if you run it through an Ada compiler Fix1 := Fixed_Type(Flt); > Recently I wrote a small binary search with assertions on, then it will make a procedure for a software of mine. or difference. Fix2 := Fixed_Type'Round(Flt); This is good, but why did you write it from scratch? Why not start with an does not really matter, since both may available, reusable binary search? Then return 5.099 when given 5.10 you would have a proven, generally useful component. [...]

Ada User Journal Volume 41, Number 3, September 2020 136 Ada Practice

One Discriminated Task per To block a subprogram until the Worker It appears that PTC ObjectAda 10.x is an tasks all complete, declare them in a block Ada-12 compiler, making two vendors CPU statement: with Ada-12 compilers*. Only took 8 From: Olivier Henley Create_Workers : declare years. Worker : T_Set; https://www.ptc.com/-/media/Files/PDFs/ Subject: 'Number_Of_CPUs' tasks creation, begin Developer-Tools/PTC-ObjectAda-64-for- with discriminants, running null; Windows-10_1_RB.pdf simultaneously. end Create_Workers; Date: Mon, 20 Jul 2020 06:51:12 -0700 *An Ada-12 compiler implements at least Newsgroups: comp.lang.ada From: Olivier Henley the entire core language of ISO/IEC 8652:2012. Please don't clutter this thread My goal is to distribute similar work Date: Mon, 20 Jul 2020 13:31:45 -0700 with posts about compilers that don't meet across multiple tasks. Incidentally, I want > The order of the discriminants is this definition. those tasks to start simultaneously, each arbitrary; there is no guarantee that From: Dirk Craynest task having some 'indexed' work Worker (I) will have ID of I. (discriminants), and ideally block from Elaboration is sequential, so each Date: Thu, 23 Jul 2020 17:24:39 -0000 main until they are done with their Worker will have a unique ID. workload. >https://www.ptc.com/- As long as all the tasks get a unique ID, I /media/Files/PDFs/Developer- I got this working by declaring the tasks am fine. Tools/PTC-ObjectAda-64-for- individually. What I would like to achieve Windows-10_1_RB.pdf is to leverage 'System.Multiprocessors. Function as a discriminant at elaboration Number_Of_CPUs' for the number of ... should have thought about it but it The above PDF is an announcement from tasks created. What is the idiomatic way looks like I am missing some wisdom May 27, 2019, and mentioned that the of achieving what I want? points. "release expands the support for Ada 2012 language features to include the I tried with an array of tasks, but the Thank you Jeffrey. complete set of Ada 2012 container problem becomes I do not know either From: onox packages and support for the associated how to start them simultaneously with Date: Wed, 22 Jul 2020 12:05:01 -0700 Ada 2012 language constructs required by parameterization or coordinate their exit those packages". Hence a partial Ada point with main. Another way is to use an extended return: 2012 implementation. I am lurking for the most 'clean/simple' spec: But perhaps even more interesting, PTC solution possible. type Worker; announced yesterday, July 22, 2020, the You can see the actual working code release of PTC ObjectAda for Windows fixed at 8 tasks here: task type Worker_Task (Data : not null Version 10.2: https://developer-tools- https://github.com/ohenley/xph_covid19/ access constant Worker); us.ptc.com/Announcements/Products/Obj blob/master/src/xph_covid19.adb# ectAda/1000/10.2/RB-20200722- L280-L287 type Worker is limited record ObjectAda%20for%20Windows%20V10. ID : Positive; 2.pdf From: "Jeffrey R. Carter" T : Worker_Task (Worker'Access); end record; And the subtitle of that announcement Date: Mon, 20 Jul 2020 19:45:54 +0200 reads: "New native Ada compiler release type Worker_Array is array (Positive provides complete Ada 2012 language For simple parameterization, you can use support". a discriminant with a default that is a range <>) of Worker; function call: A small extract from the text: function Make_Workers return subtype Task_ID is Integer range Worker_Array; 0 .. System.Multiprocessors. body: Number_Of_CPUs; "ObjectAda for Windows version 10.2 function Make_Workers return represents the completion of the phased subtype Valid_Task_ID is Task_ID range Worker_Array is 1 .. Task_ID'Last; implementation strategy PTC adopted for begin Last : Task_ID := 0; Ada 2012 language feature support within return Result : Worker_Array the ObjectAda technology.", stated Shawn function Next_ID return Valid_Task_ID is (1 .. Positive (Count)) do begin Fanning, Software Development Director for Index in Result'Range loop Last := Last + 1; at PTC. "With ObjectAda for Windows Result (Index).ID := Index; version 10.2, the ObjectAda compiler return Last; end loop; end Next_ID; conforms to the Ada Conformity end return; task type T (ID : Valid_Task_ID := Next); Assessment Test Suite (ACATS) version end Make_Workers; 4.1Q and adds several new features type T_Set is array (Valid_Task_ID) of T; Worker : T_Set; including support for storage subpools Workers : constant Worker_Array := and the Default_Storage_Pool pragma, Each Worker (i) will have its ID Make_Workers; execution time enforcement of type determined during elaboration, and they pragma Unreferenced (Workers); invariants, and complete support for new will all start at the "begin" that follows the Ada expression forms. declaration of Worker. The order of the Two Ada 2012 Vendors discriminants is arbitrary; there is no guarantee that Worker (I) will have ID of From: "Jeffrey R. Carter" For more information, see the PDF at the I. Elaboration is sequential, so each 2nd URL above. Worker will have a unique ID. Subject: Two Ada-12 Vendors Date: Thu, 23 Jul 2020 14:13:35 +0200 Dirk (I think Ada 2X will allow a way to insure Newsgroups: comp.lang.ada that the ID equals the index, but I'm not [email protected] (for Ada- sure how it will work.) Belgium/Ada-Europe/SIGAda/WG9)

Volume 41, Number 3, September 2020 Ada User Journal Ada Practice 137

Survey on the Future of will be doable tomorrow from these I deeply agree! NGs are so (too?) GNAT Community Edition community-led builds. efficient. Why are we working on this plan? From: Fabien Chouteau From: Wesley Pan We have noticed that GNAT Date: Mon, 27 Jul 2020 01:36:37 -0700 Community's pure GPL license on the Subject: AdaCore's survey regarding the > Interesting that they did _not_ post future of GNAT Community Edition run-time is seen as a barrier to new Ada users. More specifically, understanding about this survey in this newsgroup. I Date: Fri, 24 Jul 2020 14:42:16 -0700 guess we're just _so_ yesterday ... Newsgroups: comp.lang.ada the consequences of the GPL licence is complex. The result is that newcomers I was going to do it this week ;) I just discovered this via Ada Planet... will often be introduced to Ada/SPARK by a legal licence discussion rather than From: DrPi <[email protected]> Link to the Google Docs survey: Date: Mon, 27 Jul 2020 10:07:48 +0200 https://docs.google.com/forms/d/e/ looking at the value of the technology. 1FAIpQLSet9x3UNUFmfWt5v- This will, understandably, scare people What about Ada for microcontrollers? off. 8Jb7dW8BgKiJxyEMJ_TFm0G2UJKx5O From: Fabien Chouteau mQ/viewform On top of this, we are witnessing a Reddit discussion: widespread misunderstanding around the Date: Mon, 27 Jul 2020 01:38:35 -0700 openness of the Ada language and the https://www.reddit.com/r/ada/comments/ > What about Ada for microcontrollers? hwgbwa/survey_on_the_future_of_gnat_ GNAT compiler, some people seem to community/ think that Ada and GNAT are proprietary With this plan arm-elf and riscv-elf technologies. We see this phenomenon as toolchain will be available for Linux and Survey summary reproduced below... detrimental to the growth of the Ada Windows at least. community. Of course this GNAT Ecosystem Community Survey misunderstanding will not fade in a I am doing a lot of microcontroller Hello Ada supporters, couple days, but we think that removing programming myself so don't worry about GNAT Community will make the that :) We are writing this message here to situation clearer and will allow us to From: foo wong present, discuss and get feedback on a better communicate on the situation of the plan that we at AdaCore want to put in Ada compiler ecosystem. Date: Wed, 29 Jul 2020 02:44:08 -0700 place. Over the next couple of years, we want to experiment with an evolution of Besides general comments and discussion [...] the GNAT ecosystem and would like your around this plan, we would appreciate help. your feedback in this survey form. Please I just wanted to say that I am very happy help us spread the word. The more to read this thread. So far, there are three grand families of feedback we get, the more we will be able GNAT releases: I have written several disparaging posts to move in the right direction. about AdaCore and my take on the - GNAT Pro: An AdaCore release with From: Stephen Leake situation was: professional support and high level - GNAT Pro: professional support, more quality assurance. Available on many Date: Fri, 24 Jul 2020 19:17:30 -0700 different targets (PowerPC, Leon, targets. vxWorks, etc.). Interesting that they did _not_ post about - GNAT Community: Lower level of this survey in this newsgroup. I guess quality assurance, less targets, and a - GNAT Community: An AdaCore we're just _so_ yesterday ... release with a lower level of quality pure GPL license for the run-time for a assurance, less targets, and a pure GPL From: Stéphane Rivière demoware experience license for the run-time. Date: Sat, 25 Jul 2020 12:35:39 +0200 - GNAT FSF: least quality assurance - GNAT FSF: community built compiler Many thanks Wesley!!! designed to push users to the community from the FSF source tree. Available build or Pro ASAP Fascinating... (C) Spock from Linux distributions or Msys2 on I hope I was wrong all along and either Windows, for instance. Finally, we're back to the previous way, the future just got a little brighter as Moving forward, we are looking to situation without the GPL barrier... AdaCore's two offerings will now be suitable for free or non-free software. simplify the situation and remove GNAT GNAT 3.15p was born again ;) Community from the picture. I don't believe that there is anything All the arguments given are exactly those illegal about re-distributing GNAT Pro so The plan is to reach a point where I addressed to AdaCore at the highest AdaCore would not release GNAT if the gap in quality was so large between level at the time (may be about 15 years Pro and FSF, I think one paying customer Community compilers and instead instruct ago?)... non-professional users to use GNAT FSF might take pity on us eventually and builds. We would still keep making Originally, GNAT was funded precisely release Pro to the world and reset the gap GNAT Studio and SPARK releases, and to be available to everyone, including for a while. libraries such as AWS and xmlada will be commercial use. With dark days setting in for the avionics available in the Alire package manager I answered their survey, in a constructive industry (for a while at least), maybe (http://alire.ada.dev). With this plan we way, of course. AdaCore will eventually reconsider and also want to invest some more time to will release Pro as their FSF offering to help the maintainers of GNAT packages Very good news. broaden their user base. in Linux, BSD, or Windows (msys2) From: Stéphane Rivière From: Simon Wright distributions, for instance, and potentially Date: Sat, 25 Jul 2020 12:35:43 +0200 contribute when necessary. Our intention is to contribute to various communities > Interesting that they did _not_ post Date: Wed, 29 Jul 2020 17:44:30 +0100 building GNAT packages so that what can about this survey in this newsgroup. I be done today with GNAT Community guess we're just _so_ yesterday ...

Ada User Journal Volume 41, Number 3, September 2020 138 Ada Practice

> I have written several disparaging posts You'll have that issue on FSF because unsuccessful. The main problem being about AdaCore and my take on the AdaCore don't tag for FSF releases like that AdaCore seem to be in the midst of situation was: [...] they should. doing the necessary upgrade from Python 2 to Python3. I did attempt to IMO you've been wrong all along, at least Having CE available is a massive do Python3 modifications myself but so far as the quality is concerned. mistake, one which they are realising far eventually got to a stage where I could Assurance, yes; number of targets, yes; too late, imo. proceed no further support, yes. From: Simon Wright > [...] I think one paying customer might I've reached the same stage. I can manage take pity on us eventually and release Date: Sun, 16 Aug 2020 11:08:18 +0100 some of the 2-to-3 fixes (not the one in gobject-introspection, though), but the Pro to the world and reset the gap for a > Unfortunately, the AdaCore community while. real problem for me is that there isn't a 2020 edition doesn't include gps consistent complete set of sources, and I wouldn't have done this; but we were I _think_ this is on macOS? i.e. Linux, some aren't provided on the AdaCore stuck on an old release for a long time, so Windows include it? (presumably under community site (e.g. pygobject, langkit, wouldn't have helped. its new name GNATstudio (modulo libadalang, libadalang-tools, > With dark days setting in for the capitalisation)) ada_language_server). And, so far as I can see, langkit (20.2) isn't consistent with avionics industry (for a while at least), From: Stephen Leake maybe AdaCore will eventually libadalang (20.2). And, my Python venv has got screwed. reconsider and will release Pro as their Date: Sun, 16 Aug 2020 05:08:13 -0700 FSF offering to broaden their user base. Netflix & Twitter. > > Unfortunately, the AdaCore The only difference between the pro community 2020 edition doesn't From: Andreas Zeurcher compiler and FSF is a few months. include gps Date: Wed, 19 Aug 2020 11:09:35 -0700 From: Kevin K > I _think_ this is on macOS? i.e. Linux, Date: Sat, 15 Aug 2020 09:38:23 -0700 Windows include it? (presumably under > I've reached the same stage. [...] I hadn't seen this before today. The main its new name GNATstudio (modulo If multiple well-skilled people cannot impediment to me with the free version capitalisation)) build a GPL-licensed source code with the compared to the community edition is that Windows has /bin/gnatstudio.exe source code as provided and instructions with the community edition AdaCore took as provided, wouldn't that be a black-&- a set of packages that build together From: Roger Mc white flagrant violation of the GPL? The correctly. I tried to build a set of natural conclusion seems to be: either the components from the free version (gcc 8.2 Date: Sun, 16 Aug 2020 05:54:29 -0700 source code provided mismatched or the and later), gprbuild, etc. At the time, the > I _think_ this is on macOS? i.e. Linux, narrative instructions to build were other important components didn't all Windows include it? (presumably under omitting some secret-sauce, either of build successfully. Some components its new name GNATstudio (modulo which was an unintentional or intentional were ahead of others. So I wasn't able to capitalisation)) preventative of success. The build, for example, gps. unintentionality versus intentionality Yes. My system is macOS. From: Roger Mc would be able to be determined only after The source for GPS doesn't appear the fact by observing the root-cause of the Date: Sat, 15 Aug 2020 19:24:06 -0700 available from the AdaCore community preventative of successful building once version for any platform? that root cause is discovered/reported. > I hadn't seen this before today. The This irreproducibility is both notable and main impediment to me with the free The source that I tried to build from was highly interesting. version compared to the community obtained from GIT. edition is that with the community From: "Dmitry A. Kazakov" edition AdaCore took a set of packages I can only find GNATstudio under Ada that build together correctly. [...] core pro. Is it available elsewhere? Date: Wed, 19 Aug 2020 21:11:31 +0200 From: Stéphane Rivière > If multiple well-skilled people cannot Unfortunately, the AdaCore community Date: Mon, 17 Aug 2020 10:51:34 +0200 build a GPL-licensed source code with 2020 edition doesn't include gps so I am > You'll have that issue on FSF because the source code as provided and currently using the community 2020 tool- instructions as provided, wouldn't that chain and gps from community 2019. I AdaCore don't tag for FSF releases like they should. be a black-&-white flagrant violation of did try to build gps from the current the GPL? AdaCore community source but was > Having CE available is a massive unsuccessful. The main problem being mistake, one which they are realising What else you expect when GTK and that AdaCore seems to be in the midst of far too late, imo. Python are used? GTK is practically doing the necessary upgrade from Python impossible to bootstrap. Python is full of 2 to Python3. I did attempt to do Python3 Fully agree. bugs and incompatibilities. On top of that modifications myself but eventually got to For the records, GVD (Gnu Visual for some mysterious reason AdaCore a stage where I could proceed no further. Debugger) was buildable (under decided to use config scripts. No wonder From: "Luke A. Guest" Windows¹ or Linux) but I _never_ it is a nightmare anywhere outside Linux. succeeded to build GPS... If you think that commercial code Date: Sun, 16 Aug 2020 03:42:11 +0100 ¹ For the now deprecated AIDE delivered in sources is any better, you are > I hadn't seen this before today. The https://stef.genesix.org/aide/aide.html wrong. Building from sources working main impediment to me with the free out of the box is a rare exception. Most version compared to the community From: Simon Wright vendors simply check out the code from edition is that with the community the repository and send it to you. They edition AdaCore took a set of packages Date: Wed, 19 Aug 2020 15:29:00 +0100 have no resources or desire to supply you that build together correctly. [...] > I did try to build gps from the current with a working toolchain tailored for your AdaCore community source but was

Volume 41, Number 3, September 2020 Ada User Journal Ada Practice 139 targets, nor have they necessary I'd sometimes (often?) have to resort to In any case, AdaCore's iechoice of python knowledge anyway. an earlier build to achieve success! is miserable. It would have been wiser, if From: "Luke A. Guest" there was a need for a scripting language, Note that the libadalang/master and to implement a subset of Ada (like langkit/master repositories are often out Date: Wed, 19 Aug 2020 21:21:20 +0100 Gautier de Montmollin HAL :) For the ahead of gps/master. You'll have better doc, they even abandoned GNU/Texinfo > [...] No wonder it is a nightmare luck if you build them from stable for Python... anywhere outside Linux. branches, then gps/master should build. Moreover, the GPS code has always been I build on Linux and see my previous Similarly spark2014/master is often ahead problematic. I remember the first versions comment. of FSF gcc/master. gcc/master is usually where a very large portion of the code in sync with spark2014/fsf branch. From: Simon Wright was in C because they had integrated a From: Roger Mc full version of an old version of berkeley Date: Wed, 19 Aug 2020 21:17:43 +0100 DB... Date: Wed, 19 Aug 2020 22:42:24 -0700 > [...] This irreproducibility is both From: Vincent Diemunsch notable and highly interesting. > [...] the real problem for me is that there isn't a consistent complete set of Date: Mon, 31 Aug 2020 07:54:43 -0700 Well - I have every sympathy with people sources [...] who make a binary release and then move > In any case, AdaCore's choice of python on in staggered stages, aiming for another I think I managed to do all the Python 3 is miserable. It would have been binary release in a year's time. The sort of conversions but couldn't get linking to > wiser, if there was a need for a scripting problem you encounter is that the the work. language, to implement a version of gobject-introspection on the I recall that getting the prerequisites built > subset of Ada (like Gautier de CE site won't compile with Python 3.8.5, was a challenge and found that if I Montmollin HAL :) For the doc, they because of the removal of the changed anything in any of them I'd have even DL_EXPORT macro that was deprecated to go back and start building them from > abandoned GNU/Texinfo for Python... with Python 2.3; while libadalang scratch again. Worse, I seem to recall that _requires_ Python 3.8.5. The latest glib for at least one of them, probably langkit, I agree. uses Yet Another Build Tool I'd have to delete it and reload it from its (meson/ninja), and the script doesn't archive file. And they also used Python for libadalang: export a header required by gtk-3.14+ ... "libadalang is using the Langkit it's not so much DLL Hell as a version It's comforting to find that many of the framework as a basis, and is at the time of compatibility tightrope. opinions expressed in this thread are writing the main project developed using From: "Luke A. Guest" similar to my own. it. The language specification, while embedded in Python syntax, is mostly its [Around this point, the thread veers off Date: Wed, 19 Aug 2020 21:19:50 +0100 own language, the Langkit DSL, that is towards Python specifics, although with a used to specify the part of Ada syntax and > If multiple well-skilled people cannot relation to Ada features. --arm] semantics that are of interest to us." build a GPL-licensed source code with From: Roger Mc the source code as provided and I wonder if it would have been possible to instructions as provided [...] Date: Wed, 19 Aug 2020 22:48:34 -0700 create a library of objects directly in Ada, somehow equivalent in features to Every component from AdaCore is an > What else you expect when GTK and Python's Objects, but with the advantage absolute fucker to build. Python are used? [...] of strong typing and a compilation to From: Simon Wright Incredibly, Python seems to be the native instructions. It would require a language of choice for "teaching" the major use of interfaces, one for each Date: Wed, 19 Aug 2020 21:50:29 +0100 now-defunct discipline of software Python's built-in type class, but it would development, even by leading universities have been a foundation for many other > Every component from AdaCore is an applications. absolute fucker to build. as far as I can discover. From: Stephen Leake The "front-line" components (gnatcoll*, Most of the rules of disciplined software gprbuild, xmlada & friends) build pretty development seem to have been discarded Date: Tue, 1 Sep 2020 11:22:04 -0700 reliably for me, even taking the master long ago. In particular, the maintainability branch. aspect seems to have disappeared. > And they also used Python for libadalang [...] From: "Luke A. Guest" From: Stéphane Rivière Date: Thu, 20 Aug 2020 08:43:13 +0200 > I wonder if it would have been possible Date: Wed, 19 Aug 2020 22:35:07 +0100 to create a library of objects directly in > Incredibly, Python seems to be the Ada, somehow equivalent in features to > The "front-line" components (gnatcoll*, language of choice for "teaching" the Python's Objects, but with the gprbuild, xmlada & friends) build now-defunct discipline of software advantage of strong typing [...] pretty reliably for me, even taking the development, even by leading master branch. universities as far as I can discover. Langkit uses the advanced features of Python to create a Domain Specific That's only after you work out which It's not incredible. It's led to 737max Language (DSL) for defining Abstract commit to build, after many attempts at failure, It's Idiocracy. Syntax Trees. The DSL also defines much building. RM about Idiocracy could be the movie of the user API for accessing the syntax From: Idiocracy. I urge you to see it. Its tree after parsing. You could accomplish Date: Wed, 19 Aug 2020 23:12:07 -0700 nickname is: the movie which has become something similar by using a grammar generator (WisiToken or Langkit :) to > I think that I also found this. a documentary. It's delightfully vulgar but above all incredibly relevant and funny. create a parser for the desired DSL (as Sometimes, the master worked, WisiToken does), but then defining the occasionally the stable (?) worked but https://en.wikipedia.org/wiki/Idiocracy API would be done separately, and the correspondence between the API and the

Ada User Journal Volume 41, Number 3, September 2020 140 Ada Practice syntax tree maintained manually (ie error- not the only change needed. What you'd In another sense we have it as JP Rosen prone). I think Python is a good choice for like really is to be able to reassign the said, for the specific example this application - there are probably other string to some larger/smaller string, like Unbounded_String. languages with similar features that could you do when using Unbounded_String. have been used, but Ada is not one. Is there any way we could generalise the On 2020-04-04, Jeffrey R. Carter wrote: (storage, access and lifetime aspects of) From: "Dmitry A. Kazakov" > the ARG is aware of them and has Unbounded_String for unconstrained arrays and discriminated records in such a Date: Tue, 1 Sep 2020 20:59:52 +0200 chosen to take no action. That seems unlikely to change. way that Unbounded_String can be a > Langkit uses the advanced features of simple instantiation of one of these? Python to create a Domain Specific On the other hand, AdaCore has launched a project to collect/discuss But without the full flexibility (or Language (DSL) for defining Abstract overhead) of controlled types. So, Syntax Trees. ideas/suggestions/problems regarding the evolution of Ada and SPARK: somewhere in between, as: Which is a big mistake, as well. Each https://github.com/AdaCore/ 1. Controlled type intermediate is yet another point of error. ada-spark-rfcs + 2. Unconstrained Array or > I think Python is a good choice for this + Discriminated Record Feel free to open an Issue there on that + 3. Unbounded String (instance of 2) application - there are probably other topic. languages with similar features that 2) can be implemented internally using could have been used, but Ada is not From: "J-P. Rosen" Date: Mon, 27 Jul 2020 11:21:16 +0200 pointers, but externally appears to be a one. data object, just like Unbounded_String I doubt there could exist applications for > I agree with the goal. does, with similar semantics. languages like Python. Anyway, GPS is You have it already. It's called From: "Dmitry A. Kazakov" demonstratively not. Unbounded_String. Date: Mon, 27 Jul 2020 22:02:57 +0200 I also do not believe in heavily scripted From: "Dmitry A. Kazakov" IDEs. I certainly do not want GPS > 2) can be implemented internally using becoming Emacs. Any usability GPS has, Date: Mon, 27 Jul 2020 11:49:28 +0200 pointers, but externally appears to be a comes from not being Emacs, or, for that data object, just like Unbounded_String matter, Visual Studio with its horrific VB > You have it already. It's called does, with similar semantics. scripts. Unbounded_String. No, the point is that Unbounded_String is Not really. Proposal: Auto-allocation of exactly opposite to what is required. In no 1. Unbounded_String is a compromise case it should appear as an object of a Indefinite Objects needed when the string length changes different type! during its life. The great majority of From: Yannick Moy cases allocate [and initialize] a string Compare access to string P with Subject: Re: Proposal: Auto-allocation of just once. [addressed to be the cases unbounded string U: Indefinite Objects when using a discriminant does not for I in P'Range loop -- This is OK Date: Mon, 27 Jul 2020 00:47:30 -0700 work] P(J) := 'a' -- This is OK Newsgroups: comp.lang.ada 2. There is nothing for arrays that are not Now would you do: [This thread continues from AUJ 41.2, on strings and for other indefinite types. the topic of having a mechanism to E.g.: To_String (U) (J) := 'a' -- Garbage! transparently allocate indefinite objects as type Node_Type is record What if the original object must be a if they were definite, e.g., as record class-wide object, task, protected object, members. --arm] Item : new Element_Type'Class; Prev : Node_Ptr_Type; limited object etc? Hi Stephen, Next : Node_Ptr_Type; Ada's access types delegate all operations > My proposal is that it should end record; to the target object, except assignment. (sometimes?) be possible to declare 3. There is nothing for serialization and This is the key property that the proposal objects of indefinite types such as marshaling objects logically containing in my view must retain. String and have the compiler strings and other indefinite types. From: "Jeffrey R. Carter" automatically declare the space for From: Brian Drummond them without the programmer having to Date: Mon, 27 Jul 2020 22:31:34 +0200 resort to access types. Date: Mon, 27 Jul 2020 17:48:40 -0000 > Is there any way we could generalise I agree with the goal. > My proposal is that it should the (storage, access and lifetime aspects > Benefits: (sometimes?) be possible to declare of) Unbounded_String [...] > objects of indefinite types such as Ada.Strings.Unbounded can be String and have the compiler considered a combination of > 1. Easier, especially for automatically declare the space for newbies/students. Ada.Containers.Indefinite_Holders them [...] instantiated for String and > 2. Safer due to reduced use of access In one sense we already have this ... in Ada.Containers.Vectors instantiated with types. that we can do this in a Declare block, Positive and Character, with some > 3. Remove the need to have definite and where stack allocation is a practical additional operations added. indefinite versions of generic units. implementation. The To_String and I agree with 2 only if we can combine this But what about cases where (for whatever To_Unbounded_String operations of with safe handling of aliasing. It would be reason) we want it allocated on the heap? Unbounded_String are similar to the terrible to have such a feature lead to Element and Replace_Element operations unsafe code if you somehow copy the of Holder, which do not exist for Vector. pointer. Also, for strings that's possibly

Volume 41, Number 3, September 2020 Ada User Journal Ada Practice 141

The indexed operations of probably with shallow copy on > Q := "hello_world"; -- Unbounded_String are similar to the assignment if they contain access types. deallocates, allocates with new bounds indexed operations of Vector, which do > ... not exist for Holder. If there is no re-allocation (no different size assignment) the compiler is free to > end; -- deallocate Q here. If Ada.Containers.Vectors had an substitute direct (stack) storage instead of additional generic formal type heap allocation and implicit access types. The rule could be "same pool" as of the So for example instead of container. In the case of a block, the pool type Fixed is array (Index_Type range is the stack. In the case of a record <>) of Element_Type; A : constant String := "done"; member, the pool is the pool of where the ... and 2 new operations record itself is allocated. So that you loop could allocate all [the full] object in the function To_Fixed (From : Vector) declare same pool. return Fixed; P : String := Get_Line; function To_Vector (From : Fixed) begin > It follows that "indefinite" cannot also return Vector; exit when P = A; be "aliased" unless we want to end; > implement smart pointers. For then we wouldn't need end loop; Ada.Strings.Unbounded. simplicity I'd suggest disallowing "aliased From: Brian Drummond A : constant String := "done"; Q : indefinite String; > indefinite" on the grounds that "access" Date: Tue, 28 Jul 2020 14:28:53 -0000 ... can (should) be used instead. > No, the point is that Unbounded_String loop It makes sense, but there are use cases for is exactly opposite to what is required. Q := Get_Line; having it aliased: exit when Q = A; In no case it should appear as an object X : indefinite T; end loop; of a different type! [...] Y : indefinite S (X'Access); > To_String (U) (J) := 'a' -- Garbage! the implementation can be either an -- Access discriminant implicit declare block or an implicit That wasn't the aspect of Unbounded I access type. However, where Q has [...] was getting at. I agree ... garbage. several reassignments within a block, and > Assignment would always be shallow the compiler can't determine the size, an copy (where the record contained What I meant was that Unbounded doesn't implicit access type must be used. (If it access types). load New, dereferencing, deallocation etc can, it can warn that "indefinite " is onto the programmer, but hides the access unnecessary). That would be inconsistent. IMO, it details, and our indefinite type should do should be a deep copy, provided such a the same (the compiler can probably to a > What if the original object must be a component would not make the type better job than the programmer anyway). class-wide object, task, protected limited, of which I am not sure. object, limited object etc? I'm suggesting something more like the From: Brian Drummond C++ reference, signalling (perhaps by > Ada's access types delegate all adding a reserved word "indefinite") that operations to the target object, except Date: Wed, 29 Jul 2020 15:33:33 -0000 fixed size allocation won't work; and assignment. This is the key property that the proposal in my view must > Equivalent of C++ reference in Ada is implementation is more in line with a renaming. controlled type but with system-provided retain. Initialise,Adjust,Finalize providing the Indefinite can also be applied to records OK. Not quite sure how complete the required operations (no need for the (discriminated, class wide, etc) here the correspondence between reference and programmer to provide them). size is indeterminate and may vary on renaming is, but I can see similarities. A : String := "hello" -- a definite string reassignment. Assignment would always [...] P : access String := new String'("hello"); be shallow copy (where the record contained access types). > The rule could be "same pool" as of the Q : indefinite String := "hello"; container. In the case of a block, the ... From: "Dmitry A. Kazakov" pool is the stack. In the case of a record begin member, the pool is the pool of where for I in P'Range loop -- This is OK Date: Tue, 28 Jul 2020 16:59:09 +0200 the record itself is allocated. So that P(J) := 'a'; -- This is OK > I'm suggesting something more like the you could allocate all object in the Q(J) := 'a'; -- also OK. But index out of same pool. --range would raiseConstraint Error C++ reference, signalling (perhaps by adding a reserved word "indefinite") Looks like a good rule. Saves the ... that fixed size allocation won't work; compiler having to plant deallocations if Q := "hello_world"; -- deallocates, Equivalent of C++ reference in Ada is the whole pool is to be de-allocated. -- allocates with new bounds renaming. [...] ... > Q : indefinite String := "hello"; >> Assignment would always be shallow end; -- deallocate Q here. I think the keyword is misleading. Maybe copy (where the record contained access types). It follows that "indefinite" cannot also be this: "aliased" unless we want to implement Q : new String := "hello"; > That would be inconsistent. IMO, it smart pointers. For simplicity I'd suggest should be a deep copy, provided such a disallowing "aliased indefinite" on the And I don't like initialization. It was a component would not make the type grounds that "access" can (should) be mistake to have limited return. The syntax limited, of which I am not sure. used instead. must stress that all initialization is strictly in-place. No copies involved because the Honest question: Inconsistent with what? Records (including tagged, class wide, pool is fixed.> ... I suggested shallow copy just for simplicity, and for no (ahh) deeper reason. discriminated) should work the same, but > begin

Ada User Journal Volume 41, Number 3, September 2020 142 Ada Practice

But again, I'm probably missing > I don't like compiler relocating objects. From: "Dmitry A. Kazakov" something. If the pool is a stack (or heap organized as a stack) it might be unable to do this. Date: Mon, 10 Aug 2020 10:57:44 +0200 Thank you for your thoughts. I don't know if this is worth developing into an This is not that hard to deal with. > That's the idea of such mechanisms. If AI. Janus/Ada handles discriminant- you really need control, you do not use these abstractions and instead write the From: "Dmitry A. Kazakov" dependent components of mutable objects this way: they are allocated on the stack, stuff yourself explicitly using access types and the like. Date: Wed, 29 Jul 2020 18:20:24 +0200 but if they have to be reallocated they move to the heap. Right, that is my take on the proposal. If I [...] I note that the original idea already exists am ready to compromise on #1 and #2, I In general, there are two close but not for discriminant-dependent components -- can use an abstraction hiding pool access. equivalent objectives: one is handling that's a bit more painful to use but hardly Otherwise I want a language construct indefinite components of records; another difficult. The main issue is that most being more safe than raw access types. is a transparent holder object integrated compilers fail to support these > Otherwise, you use containers and into the language (without generic mess). components properly, using some sort of unbounded strings, and they do what max-size implementation unconditionally they do. Your use case is about the latter. My is rather than switching to a pool-based rather the former. implementation when the max size is too No, from the abstraction point of view I doubt it is possible to unite both large. I've never understood why Ada they do not. They indeed abstract the objectives in a single AI. compilers were allowed to make such a memory allocation aspect, but they do limitation (it becomes a major limitation that at the cost of *everything* else. On 29/07/2020 17:33, Brian Drummond when working on non-embedded Unbounded_String is no string anymore. wrote: programs), while similar limitations on Container is neither array nor record type. > I suggested shallow copy just for case statements and aggregates are not Unbounded_String must be converted simplicity, and for no (ahh) deeper allowed. forth and back. For containers I must use ugly hacks like iterators to make them reason. But again, I'm probably missing From: "Randy Brukardt" something. resemble arrays and records introducing whole levels of complexity to fight If you make a shallow copy of Date: Sun, 9 Aug 2020 19:39:31 -0500 through every time the compiler or I miss type Node_Type is record > I don't want the compiler deciding something. Item : new Element_Type; where Q is allocated, especially because this could break things: In most cases I prefer to keep a clear array Prev : Node_Ptr_Type; or record interface at the expense of Next : Node_Ptr_Type; > 1. Large object moved to the stack manual memory management. end record; The compiler is buggy IMHO if this > There's no free lunch. you create a dangling pointer should the breaks something. Any compiler has to be original node disappear. A deep copy able to deal with objects that exceed the I think with a better type system there would create a new target for new Item. maximum stack frame, and move those to could be a whole banquet. (:-)) From: "Dmitry A. Kazakov" somewhere that they will fit (or reject From: "Dmitry A. Kazakov" completely). Date: Mon, 10 Aug 2020 10:58:20 +0200 Date: Thu, 30 Jul 2020 20:28:32 +0200 Yes, most compilers are buggy this way (including mine in a few cases). So what? > Janus/Ada handles discriminant- [...] dependent components of mutable > The compiler should be able to > 2. Lock-free code starting using heap objects this way: they are allocated on determine if [...] the use of Q (the lock when moved from the stack. the stack, but if they have to be indefinite type) is equivalent to a Expecting a compiler not to use the heap reallocated they move to the heap. Declare block (i.e. can be on the stack; is silly in any case (outside of the new stack frame in each iteration; no What do you do if such an object is No_Heap restriction - use that in allocated via pool-specific access type? relocation ever required) or not. Janus/Ada and the compiler refuses to do I don't want the compiler deciding where anything outside of elementary types). [...] Q is allocated, especially because this The compiler is supposed to be making From: "Randy Brukardt" could break things: the programmer's life easier, not adding new hurdles. 1. Large object moved to the stack Date: Wed, 19 Aug 2020 19:10:27 -0500 > I do not know which heuristic it uses to 2. Lock-free code starting using heap lock > I think with a better type system there reduce reallocation and how much extra could be a whole banquet. (:-)) when moved from the stack. memory it takes under which The mechanism should be transparent. I circumstances. Maybe. but IMHO a better type system would get rid of arrays and strings do not like Unbounded_String for many That's the idea of such mechanisms. If reasons. Fiddling with the heap is one of altogether and only have you really need control, you do not use containers/records of various sorts. The them. I do not know which heuristic it these abstractions and instead write the uses to reduce reallocation and how much complexity of having both solving the stuff yourself explicitly using access types same problems (not very well in the case extra memory it takes under which and the like. circumstances. of arrays/strings) doesn't buy much. I Otherwise, you use containers and suspect that a user-defined "." as you've [...] unbounded strings, and they do what they proposed elsewhere would eliminate most From: "Randy Brukardt" do. There's no free lunch. But the need to of the rest of the problems (and unify be explicit should be very rare - the main everything even further). Date: Sun, 9 Aug 2020 19:31:06 -0500 problem is programmers with insufficient trust that a compiler will do the right thing.

Volume 41, Number 3, September 2020 Ada User Journal Ada Practice 143

From: "Randy Brukardt" From: "Randy Brukardt" > Whether that would be worthwhile would depend on how expensive the Date: Wed, 19 Aug 2020 19:13:15 -0500 Date: Thu, 20 Aug 2020 18:30:07 -0500 locking is. > What you do if such an object is > But records and arrays are needed as It could be very expensive on a multi-core allocated via pool-specific access type? building blocks of containers. How architecture. I also think about scenarios would you get rid of them? The whole object goes in that pool. The when the object is used inside a protected entire mechanism in Janus/Ada is built There's no reason that a compiler couldn't action. I would not like to see any pool around pools - the stack is represented by "build-in" a simple bounded vector interaction in an interrupt handler! a pool object as well as various other container as the basic building block. We From: "Randy Brukardt" pools to support the mechanism. already do that for things like Ada.Exceptions, Unchecked_Conversion, Date: Sat, 22 Aug 2020 23:48:13 -0500 [...] and Unchecked_Deallocation, so it's no > That simply replaces the word "array" From: "Dmitry A. Kazakov" harder to do that for a vector. (Probably with four words "simple bounded would need some sort of fixed vector for vector container." The construct is still Date: Thu, 20 Aug 2020 19:49:34 +0200 interfacing purposes as well, to deal with there and it is still built-in. The syntax other language's and/or system's memory > The whole object goes in that pool. [...] and usability are drastically worse, layout.) though. OK, but then you are back to the problem One could do something similar for ??? The syntax of use is the same (as it is that you do not know how that pool records, although I would probably leave works. The user pool might require a in Ada 2012). Declaration would be an them as in Ada and just allow user- instance, about the same length and certain order of objects inside it and your definition of "." (via a getter/setter pair). interference with relocation will break it. wordiness as an array declaration. Yes, From: "Randy Brukardt" junk like slices, settable/retrievable [...] bounds, and built-in operations that are From: "Dmitry A. Kazakov" Date: Thu, 20 Aug 2020 18:33:40 -0500 rarely used would be gone, but so would > And likely needed for any embedded or the rather substantial overhead that those Date: Thu, 20 Aug 2020 19:49:44 +0200 low-level work where they are mapped things entail. There'd be a lot more to things like (GP) I/O ports or such... flexibility in implementation, which > [...] IMHO a better type system would would allow better implementations. get rid of arrays and strings altogether Yes, a fixed vector container would be and only have containers/records [...] needed for interfacing (probably wouldn't Virtually every array that I write has a fixed size (capacity really) and a usage But records and arrays are needed as use it for anything else). But there's no reason that can't be provided as a high-water mark (a "length"). Having that building blocks of containers. How would generated automatically would be usually you get rid of them? container, so long as representation guarantees (esp. Component_Size) are better than having to reinvent it literally From: Dennis Lee Bieber included. Remember that containers (in every time I program something. (And as Ada 202x) have indexing, aggregates, and you've noticed repeatedly, Ada's type Date: Thu, 20 Aug 2020 16:19:52 -0400 all of the useful basic operations. The abstraction isn't good enough to make it >But records and arrays are needed as stuff that's missing is the same stuff that practical to build anything reusable to do building blocks of containers. adds a vast amount of complexity to Ada that.) (and possibilities for bugs) - hardly >> I would probably leave them as in Ada And likely needed for any embedded or anyone would miss it. and just allow user-definition of "." low-level work where they are mapped to things like (GP) I/O ports or such... From: "Dmitry A. Kazakov" ??? From: "Randy Brukardt" Date: Fri, 21 Aug 2020 08:46:07 +0200 The basic idea would be to eliminate the huge number of special cases that exist in Date: Thu, 20 Aug 2020 18:25:46 -0500 > There's no reason that a compiler Ada resolution and essentially make couldn't "build-in" a simple bounded > [...] The user pool might require a *everything* a subprogram call at its vector container as the basic building heart. Ada did that for enumeration certain order of objects inside it and block. your interference with relocation will literals and that model makes sense for break it. That simply replaces the word "array" pretty much everything: object usage, with four words "simple bounded vector indexing, selection, etc. It would be much Such a pool does not implement the container." The construct is still there and easier to prove that resolution is doing the interface as defined in 13.11. It's OK of it is still built-in. The syntax and usability right thing (I don't think that would be course to write a pool that depends on are drastically worse, though. practically possible for Ada). implementation-specific properties (I've done it many times), but such a pool is not > One could do something similar for From: "Randy Brukardt" usable with portable Ada code. If the pool records, although I would probably allows any sort of allocation at any time, leave them as in Ada and just allow Date: Sat, 22 Aug 2020 23:52:30 -0500 then it will work just fine with the user-definition of "." (via a getter/setter > Really? I would miss array conversions, Janus/Ada implementation. pair). slices, equivalence of same length index ranges, constrained array [...] From: "Dmitry A. Kazakov" subtypes etc. Note that this is the reason that Ada Date: Fri, 21 Aug 2020 09:08:46 +0200> Those things are mostly useful for making doesn't support specifying the pool used >> I meant that if you used a pool behind work for programmers. Note that I'm by a container. It would not be reasonable the scenes for local objects you could assuming that Strings are a completely to restrict the allocations in any way, so do that task-specific eliminating separate abstraction - a UTF-8 string is implementation-dependent pool designs interlocking. not an array and shouldn't be treated as would not work. one. (Indexing of individual characters [...] being very expensive.) Fixed constrained

Ada User Journal Volume 41, Number 3, September 2020 144 Ada Practice arrays would be available for interfacing All the above are commercial and cost There used to be GNAT 3.15p (last non- (they're not really useful for much else). £££££'s GPL) release but it was cruelly excised Note that a bounded vector is allocated > There's also work being done on some from all servers and download sites when statically, so there's no extra cost to using open source compilers like HAC or my AdaCore happened. it (unlike an unbounded vector or string). own Byron. We should note, GNAT / AdaCore were From: "Randy Brukardt" created on the backs of American HAC is not going to be a full compiler, so it's really worth mentioning. taxpayers via a grant to New York Date: Sun, 23 Aug 2020 00:03:01 -0500 University. Unfortunately, the taxpayers > [...] I also think about scenarios when Byron's not anywhere near close to got the shaft and a profitable business was the object is used inside a protected generating assembly. born to continue the fun. action. I would not like to see any pool In answer to the OP's question, no, there From: Micronian Coder interaction in an interrupt handler! isn't another open source compiler. Date: Mon, 3 Aug 2020 10:37:05 -0700 Interrupt handlers shouldn't be doing From: nobody in particular anything other than unblocking tasks. I Just because a compiler is not free does think it is a mistake to allow anything else Date: Mon, 3 Aug 2020 15:18:36 +0000 not mean it is not relevant to someone. In (as there are always problems with race > RR Software has Janus/Ada. addition, the OP did _not_ specifically conditions if you do so). So no heap ask for an open source compiler. They possibilities as very little is going on. Honest company run by good guy Randy asked if there are other compilers. Brukhard, who is a long time participant Hobbyists generally want a free compiler, Available Ada Compilers on the newsgroup. Unfortunately, not so by default GNAT is the one that is available on the platform I wanted it for. used. For companies who want From: [email protected] Hobbyist-friendly. commercial support and are fine with Subject: Is there another ada compiler > PTC has ObjectAda and ApexAda. paying money, then the other options are Date: Sun, 2 Aug 2020 19:22:10 -0700 perfectly fine. Newsgroups: comp.lang.ada There was a recent announcement here in the newsgroup, unfortunately without any Of the commercial ones listed, Janus/Ada Is there another Ada compiler other than is the more affordable one for an AdaCore? pricing. Pricing is also not found on the PTC website. In the past, Aonix did have individual willing to spend money (see From: [email protected] a hobbyist compiler but I haven't seen it http://www.rrsoftware.com/html/company Date: Mon, 3 Aug 2020 00:54:26 -0700 for years. inf/prices.htm), especially if they are a student Check here: http://unzip-ada.sf.net/ > Green Hills has an Ada compiler. (http://www.rrsoftware.com/html/compan #adacomp Huge money and the salesman I spoke yinf/educ.htm). While it's not as up to or here https://www.adaic.org/ with displayed significant disdain when I date as GNAT in terms of Ada2012 ada-resources/pro-tools-services/ turned out to be an individual rather than support, it's still enough to develop a company. Did not disclose pricing. software with (note: Windows only which for instance. However, in speaking with another is fine for many people and can probably run on Wine for Linux users). Judging by If you are looking for another *open- participant off-list, I was given some Randy's posts in this group, one can source* compiler, but rather incomplete: sense of the pricing. expect good support from RRSoftware. https://hacadacompiler.sourceforge.io/ > DDC-I has a compiler. I should point out that PTC is known to From: Shark8 Not sure if anything past '83 is supported. provide free access to their compilers if it But do check if you're interested. I believe is for developing *open source* Ada Date: Mon, 3 Aug 2020 06:51:54 -0700 JOVIAL is also available from DDC-I. software. Gautier has confirmed this on Reddit RR Software has Janus/Ada. > IBM used to have a compiler. (I'm not sure they do any more.) (https://www.reddit.com/r/ada/comments/ PTC has ObjectAda and ApexAda. hw33kr/ptc_objectada_for_windows_vers It was sold to a company in Washington, ion_102_outprovides/fyzgpss?utm_source Green Hills has an Ada compiler. D.C. which I believe still sells the Ada 95 =share&utm_medium=web2x). So there DDC-I has a compiler. compiler. I don't believe they support any is potential additional standards after 95. I'm sorry, I From: [email protected] IBM used to have a compiler. (I'm not can't remember the name. Date: Mon, 3 Aug 2020 14:44:43 -0700 sure they do any more.) I attempted to get a hobbyist distribution > We should note, GNAT / AdaCore were There's also work being done on some to run on the Hercules z/Architecture created on the backs of American open source compilers like HAC or my emulator (which also supports MVS, taxpayers via a grant to New York own Byron. MVS/ESA, and OS/390) but was not University. [...] From: "Luke A. Guest" successful. Appeared to be a reasonable It's called public-private partnership ;-) guy and the product was well integrated Date: Mon, 3 Aug 2020 15:29:34 +0100 in MVS/ESA but probably not generally See Tesla or SpaceX for other examples. useful to most people in this newsgroup. Is it so bad? > RR Software has Janus/Ada. If it is, would be worth identifying the > PTC has ObjectAda and ApexAda. company and starting a dialog. BTW, weren't most early Ada vendors essentially financed by the US DoD? > Green Hills has an Ada compiler. Lastly, we should mention gcc-ada which was still out there for Linux and Solaris As a consolation, consider that the > DDC-I has a compiler. last I looked, and even for some unusual American taxpayers have become (at least platforms like Solaris SPARC. The for a while) minority contributors to the > IBM used to have a compiler. (I'm not SPARC platform maintainer was very US budget... sure they do any more.) helpful and I got a copy at some point, I They sold it. can't remember but I think around gcc5.

Volume 41, Number 3, September 2020 Ada User Journal Ada Practice 145

From: Andreas Zuercher Whatever or however one might critique Dynamic Variable Creation FSF GNAT versus AdaCore GNAT Pro Date: Mon, 3 Aug 2020 17:23:59 -0700 differences or delays or never achieving a la PHP > We should note, GNAT / AdaCore were perfect congruence among any pairwise From: Ian Douglas created on the backs of American matching of any of their releases, GNAT's Subject: Newbie question # 2 taxpayers via a grant to New York viability to continue maintenance & Date: Thu, 6 Aug 2020 11:40:35 -0700 University. [...] evolution is far better that CHILL's Newsgroups: comp.lang.ada donorware-based approach that failed Well, I am not usually in the habit of miserably under the same FSF GCC I did try Google search and assorted saying nice things about GNAT, but let us umbrella during the same time period. So books but could not find an answer. compare FSF's GCC GNAT with FSF's matters could be far far worse than they GCC CHILL. Ada and CHILL are fierce are. In PHP, let's say we have a variable $fruit competitor languages: one from NATO which contains the string "banana". military and the other from ITU-T PolyORB and the DSA In PHP, if I do $$fruit, then it creates a telecom, where Ada trended a little more Annex variable $banana, which I can then do toward Wirth family of languages as things with. inspiration whereas CHILL trended a From: tonyg little more toward PL/I as inspiration. Subject: Polyorb abd the DSA Annex Does Ada support any such concept of Both languages had a 2-decade mandate Date: Mon, 3 Aug 2020 04:04:27 -0700 taking the contents of one variable and to be utilized in their respective industrial Newsgroups: comp.lang.ada using THAT as a variable? sectors, but each's mandate had I'm reading in a file which has the name evaporated by the latter half of the 1990s. I just tried to build the git cloned copy of PolyORB (failed on the configure!) with of an object followed by some properties Ada had AdaCore arise through several the 2020 community version of GNAT. It so I want to use the name as a variable ... mergers as the for-profit support company said I had no GNAT Ada compiler. It was File is something I created, so it's not for open-source software, analogous to on the path and it pointed to the gcc some random stuff, and the variables will Cygnus Solutions during the 1990s, and compiler on the path. Are they be existing already. its acquirer RedHat until this day. CHILL compatible? Is there still a PolyORB had a different business model entirely. "enthusiast" list ? From: Simon Wright CHILL compilers were produced by the telecom companies that were self- From: "Luke A. Guest" Date: Thu, 06 Aug 2020 19:56:23 +0100 mandated to use CHILL. If Ada had that Date: Mon, 3 Aug 2020 12:40:32 +0100 I'd think of a record type to contain the business model, Raytheon would have properties, and then a map from object authored its own compiler, Lockheed- Distributed annex is being removed from name to properties: Martin would have authored its own GNAT due to "lack of customer interest." compiler, Boeing would have authored its type Properties is record own compiler, Airbus would have From: Shark8 Length : Positive; authored its own compiler, and so forth. Width : Positive; Eventually the telecom companies in Date: Mon, 3 Aug 2020 06:47:12 -0700 end record; Europe fatigued of the effort needed to This is pretty sad, and IMO, stupid; the package Object_Maps is new write a compiler for an evolving language ability to [relatively] easily make Ada.Containers.Indefinite_Ordered_Maps standard (ITU-T Z.200 and ISO 9496), so distributed applications via DSA is a (Key_Type => String, 2 of them (Alcatel or Siemens, IIRC) killer feature and, in conjunction with Element_Type => Properties); outsourced their internal compiler Ada2020 'parallel' blocks/loops would Objects : Object_Maps.Map; development to Per Bothner, who make for a very attractive system. From: Niklas Holsti eventually landed at Cygnus Solutions, IOW, the "lack of customer interest" is an after University of Wisconsin at Madison Date: Thu, 6 Aug 2020 22:20:11 +0300 (years after Randy). Eventually, Cygnus excuse to shoot themselves in the foot. Solutions convinced FSF to allow their From: "Dmitry A. Kazakov" > In PHP, let's say we have a variable CHILL compiler into GCC. $fruit which contains the string Date: Mon, 3 Aug 2020 16:16:13 +0200 "banana". If I do $$fruit, then it creates Shortly after FSF GCC admitted CHILL a variable $banana, which I can then do into its compiler suite, RedHat bought The reality is a bit more complex. things with. Cygnus Solutions and nearly all of the European telecom companies were Distributed Annex is based on RPC. Fortran has a similar feature, NAMELIST, for reading values into finalizing the financially painful Ada is largely used in the field governmental reform where PTTs (postal- variables also named in the input. It can applications, embedded, real-time. RPC also be used for output. telephone-telegraph agencies of are pretty much useless there, as well as governments) were divesting their in massively parallel applications. Ada does not have such a feature. relationship with the equipment manufacturers—much like AT&T For service-oriented sluggish applications [...] divested WesternElectric/Lucent and Bell RPC might be OK, but CORBA is a From: Ian Douglas Canada no longer had Northern Telecom blocker there, because static Date: Thu, 6 Aug 2020 12:41:53 -0700 as favorite-son supplier during much the topology/configuration is too rigid for same 1990s time period. Long story short, such applications. (Static topology is less > I'd think of a record type to contain the when FSF pleaded for someone anyone to and less tolerated in the former as well) properties, and then a map from object update GCC CHILL to GCC 3.X name to properties: P.S. I have an almost ready distributed internals, no one stepped forward to fund Yes, the variables are actually records. the effort with money, and most Annex implementation based on inter especially no one donated source code as process communication (no network, > package Object_Maps is new in-kind support. GCC CHILL as same box), but I have no information how Ada.Containers.Indefinite_Ordered_Ma donorware ended as of GCC 2.95. to dock it into GNAT. ps

Ada User Journal Volume 41, Number 3, September 2020 146 Ada Practice

Okay that's a new construct I haven't Under Debian buster you should do Proper intended usage of Ada-specific come across yet. Let me see what I can features mitigates 9 of them, including a dig up on that. apt install gnat-8 few that hit interpreted scripting From: Ian Douglas Under Ubuntu it would be languages hard. Others of the 25 are Date: Thu, 6 Aug 2020 12:45:04 -0700 design-level almost independent of apt install gnat-10 . Still others of the > Ada does not have such a feature. And also: 25 are cavalier/insufficient WWW- oriented string-processing or SQL string- I figured as much, probably "unsafe apt install gprbuild processing or director-filename string- programming practice" at the end of the processing that could be conceivably done day. If these do not work check just as badly in Ada. /etc/apt/sources.list [...] From: Philip Munts Conversely, if HOLWG were still From: Niklas Holsti pursuing their language-design goals Date: Sun, 9 Aug 2020 10:17:12 -0700 today, certainly this MITRE* report Date: Thu, 6 Aug 2020 23:08:00 +0300 would shape the design of an evolving > I figured as much, probably "unsafe Depending on what you want to GreenGreenerGreenest language today, programming practice" at the end of the accomplish (i.e. whether it needs the full instead of Ada solving primarily day. Debian OS), and whether you are willing yesteryear's programming/software- and able to do cross-compilation, I think engineering challenges well. I wouldn't say so. I think "namelist" input that MuntsOS is a perfectly reasonable function to have (https://github.com/pmunts/muntsos) is * defense contractor in some programs, and is not particularly the easiest way to develop and run Ada From: Shark8 unsafe in any way -- if the programmer programs on a BeagleBone or Raspberry can limit the set of variables that can be Pi. Date: Tue, 25 Aug 2020 12:09:47 -0700 named and changed by such input, which is the case in Fortran (and also in our I have found that installing and The interesting portion, in tabular form. maintaining and especially configuring various suggestions for implementing it in Rank - ID - Name - Score Ada). I/O with Debian on a BeagleBone to be a pain in the nether regions. In contrast, I 1 CWE-79 Improper Neutralization of PHP is (I believe) an interpreted have attempted to make MuntsOS as easy Input During Web Page Generation language, so the symbol table is around at to use as possible. Its only real downside ('Cross-site Scripting') 46.82 run-time, which makes it easy for PHP to is that it requires cross-toolchains running support variables that refer to any other on a Linux (preferably Debian or Ubuntu) 2 CWE-787 Out-of-bounds Write 46.17 variable by its symbolic name. This can development host. Windows Subsystem 3 CWE-20 Improper Input Validation make "namelist" input in PHP unsafe, for Linux (WSL1 or WSL2) works 33.47 since the input can change any variable -- perfectly well for the development host, including variables that the programmer though. 4 CWE-125 Out-of-bounds Read 26.50 did not intend to be changeable in this From: Ricardo Brandão way. 5 CWE-119 Improper Restriction of Operations within the Bounds of a Ada is usually compiled, and the symbol Date: Sun, 9 Aug 2020 12:56:35 -0700 Memory Buffer 23.73 table is not present when the compiled > APT suggests Debian or Ubuntu. In any program runs, so it would be harder to 6 CWE-89 Improper Neutralization of case I would do a full upgrade to the latest Special Elements used in an SQL implement a "namelist" input/output version of either. feature. But not impossible, as Fortran Command ('SQL Injection') 20.69 shows. Yes, I ran sudo apg-get update and GNAT 7 CWE-200 Exposure of Sensitive appear in apt-cache search gnat Information to an Unauthorized Actor Ada on Beaglebone Black > Under Debian buster you should do 19.16 From: Ricardo Brandão > apt install gnat-8 8 CWE-416 Use After Free 18.87 9 CWE-352 Cross-Site Request Forgery Subject: Running ADA on Beaglebone Black > And also: (CSRF) 17.29 Date: Sun, 9 Aug 2020 07:39:58 -0700 > apt install gprbuild Newsgroups: comp.lang.ada 10 CWE-78 Improper Neutralization of I ran these commands and worked fine. Special Elements used in an OS I've just acquired a Beaglebone black and Command ('OS Command Injection') I'm trying to run a simple program in Ada. Thank you so much 16.44 I tried to install GNAT but apt-get install 11 CWE-190 Integer Overflow or GNAT or anything similar doesn't work. MITRE's Top-25 List of 2020 Software-bug Wraparound 15.81 I didn't find any place with the repository, 12 CWE-22 Improper Limitation of a nor any tutorial. Categories Pathname to a Restricted Directory ('Path How is the best way to run Ada in the From: Andreas Zuercher Traversal') 13.67 BBB? Subject: MITRE's top-25 list of 2020 13 CWE-476 NULL Pointer Dereference From: "Dmitry A. Kazakov" software-bug categories 8.35 Date: Sat, 22 Aug 2020 09:31:13 -0700 Date: Sun, 9 Aug 2020 17:58:54 +0200 14 CWE-287 Improper Authentication Newsgroups: comp.lang.ada 8.17 What distribution? APT suggests Debian https://www.bleepingcomputer.com/news/ or Ubuntu. In any case I would do a full 15 CWE-434 Unrestricted Upload of File security/mitre-shares-this-years-top-25- with Dangerous Type 7.38 upgrade to the latest version of either. most-dangerous-software-bugs/

Volume 41, Number 3, September 2020 Ada User Journal Ada Practice 147

16 CWE-732 Incorrect Permission > Would 've been nice if you'd have also • 17th-most frequent: CWE-94 Improper Assignment for Critical Resource 6.95 given the examples and how Ada Control of Generation of Code ('Code solved them. Injection') 17 CWE-94 Improper Control of Generation of Code ('Code Injection') I am not going to write an entire textbook • 23rd-most frequent: CWE-400 6.53 here on c.l.a, but here are the nine of the Uncontrolled Resource Consumption top twenty-five subcategories that I 18 CWE-522 Insufficiently Protected consider Ada diligently trying to mitigate There are 1,248 Common Weakness Credentials 5.49 or eliminate when properly utilized: Enumerations (CWEs) that MITRE lobs against software development (instead of 19 CWE-611 Improper Restriction of • 2nd-most frequent: CWE-787 Out-of- against hardware development), so you XML External Entity Reference 5.33 bounds Write can peruse the 26th through 1,248th if you so desire. Query 699 is the one for 20 CWE-798 Use of Hard-coded • 3rd-most frequent: CWE-20 Improper Credentials 5.19 looking at the full inventory of Input Validation subcategories of software defects. These 21 CWE-502 Deserialization of • 4th-most frequent: CWE-125 Out-of- 1,248 subcategories (and the Untrusted Data 4.93 bounds Read aforementioned top-25 subcategories) fall 22 CWE-269 Improper Privilege into 40 more-macroscopic broader • 5th-most frequent: CWE-119 Improper categories. Management 4.87 Restriction of Operations within the 23 CWE-400 Uncontrolled Resource Bounds of a Memory Buffer https://cwe.mitre.org/data/definitions/ 699.html Consumption 4.14 • 8th-most frequent: CWE-416 Use After 24 CWE-306 Missing Authentication for Free I claim that next-gen Ada (AdaNG, Critical Function 3.85 pronounced “a dang” as in do we give a • 11th-most frequent: CWE-190 Integer dang or not) would use these 1,248 25 CWE-862 Missing Authorization 3.77 Overflow or Wraparound categories as measuring stick of From: Andreas Zuercher • 13th-most frequent: CWE-476 NULL expressibility of software-engineering Pointer Dereference correctness, just as HOLWG's Green and Date: Tue, 25 Aug 2020 12:43:13 -0700 Ada used Steelman as measuring stick of the ability to express software- engineering correctness.

Ada User Journal Volume 41, Number 3, September 2020