lainchan / λ

Ada_General : Thread := Post;

Cat Mother · 2018-12-04 05:25
This is a thread for discussing the Ada programming language. There doesn't seem to be many Ada programmers here, but we'll see. The Ada programming language was created for the United States Department of Defense in order to provide a reliable programming language to replace the many hundreds in use there at the time. The specifications of what would be desired in this language went through several transformations, from Strawman to Woodenman to Tinman to Ironman; the end result was Ada, a very strongly-typed language designed to catch as many errors as possible at compilation and avoid many common classes of errors in order to help ensure program correctness, along with being designed for large groups to use and with explicit and strong support for concurrency and bending to the demands of other environments, languages, or hardware. Unlike other programming languages, Ada has many different facilities that are not generally useful, but are necessary for certain classes of programs. Lastly and despite all of this, Ada can be too powerful for the requirements of some and so both SPARK and the Ravenscar profile exist as subsets of Ada designed for more powerful verification and testing of programs. For those of you interested, what do you use Ada for? Why do you use Ada? Which facilities of Ada do you find yourself using the most or appreciating the presence of? What tools do you use for writing your Ada programs?
Marly Krushkhova · 2018-12-04 10:07
Does Ada have a future? I don't want to learn an obsolete language :(
藤原純一 · 2018-12-04 13:59
>>11673 I plan on learning Ada in the next couple of months. Ada is in many ways superior to even Rust. I like Rust a lot so thats not saying anything bad about Rust but I think a well built Ada compiler can equal the speed of Rust and give superior safety. >>11674 every commonly used language such as C++, Java, C# are all behind the times and should have been made obsolete by now but are kept alive only because programmers and companies are too lazy to improve themselves
Batou · 2018-12-04 16:52
>>11674 The F-35 is a buggy mess. It famously did not use Ada, even though that's exactly what Ada was made for. Supposedly the reason was a lack of skilled Ada programmers and even after development proved to be a train wreck they are not looking to use Ada for future projects. If you're thinking about future prospects, I would say that learning Ada is somewhere between learning COBOL and Fortran. >>11676 Like most languages, Ada failed in the marketplace of languages because of tooling and support. Attributing it to the laziness of anyone is pure fantasy.
Kay · 2018-12-04 22:43
>>11678 >Like most languages, Ada failed in the marketplace of languages because of tooling and support. Attributing it to the laziness of anyone is pure fantasy. this is totally wrong, Ada has best-of-class tooling and support but the only people who can afford to buy Ada compiler/IDE suites are large companies, ie banking, medical technology, aerospace, etc. The IT industry at large doesnt give a fuarrrk about safety and so safety is simply achieved in the debugger in the alpha process.
Project 2501 · 2018-12-07 19:59
>>11674 Maybe. More and more security and correctness are becoming utmost concerns in software. Specifically things like autonomous vehicles demand such, as adherence to strict standards for safety and such may be the best route to avoid bankruptcy through liability for any accidents and whatnot. I saw a post on comp.lang.ada a while back about just that, and potentially lobbying the government for some sort of mandate for autonomous vehicles to meet whatever standard which currently only Ada is capable of. It's a perfect match to be honest. Anyway, learning Ada certainly cannot hurt you, it's quite a nice language and advancing constantly with the current standard of Ada 2012 and the upcoming revision Ada 2020. There's also support for some microcontrollers and preliminary support for soykaf like the IoT. Really I see the future going one of two ways. People realize consistency, readability/maintainability, and proveable correctness are important and switch to appropriate languages like Ada (seriously, people seem to have such concerns but instead of usin the proven, readily available tools they try to reinvent the wheel but gayer like Rust)... Or everything is just a fuarrrking retarded buggy pile of cludged together javascript soykaf. Honestly the latter is probably more likely, but one can hope. So... I uploaded a bunch of Ada books in the old programming books thread, which I think is still around but probably not for long. Once I get on a proper connection I can upload them all again in this thread.
Nemissa · 2018-12-07 21:04
>>11722 Do you have any good Ada 2012 books that go over data structures? All the books seem to be for ada 95 and many of them were written before 95 was even finished.
typedef · 2018-12-12 08:30
>>11673 I'm particularly interested in using Ada on a microcontroller like the AVR, MSP430, or Cortex M series. There doesn't seem to be much development in this, otter than a few guides and tutorials though. I also need to find time, but I have a few simple projects in mind.
Church · 2018-12-14 14:39
>>11722 >people seem to have such concerns but instead of usin the proven, readily available tools they try to reinvent the wheel but gayer like Rust Ada didn't have a way to provide the memory safety guarantees Rust has until June 2018. And if you take a look at what AdaCore did about that you'll realize they just copied Rust's CREW/borrowing model. Tucker Taft went completely mad and Ada 2020 is going to be a clusterfuck of concurrency APIs that don't go well together. Just take a look at http://www.ada-auth.org/ai-files/grab_bag/2020-Amendments.html . Basically Ada and Rust are like Vim and NeoVim. Development and innovation had stopped to a crawl and it took the arrival of a serious contender to revitalize these projects. But Rust and NeoVim know what they're trying to do and where they're going while Vim and Ada are just trying to play catch-up.
nil · 2018-12-14 21:56
>>11798 Programming languages are like human spoken languages, no one has ever invented a spoken language (other than Esperanto), all human languages derive from previous languages. No programming language has original ideas, they always improve on previous languages. If you look at all the new features in C++11, C++14 and C++17 its mostly a bunch of 'me too' features that modern languages have now. Im currently learning Ada and I am starting to notice that Go borrowed a lot of features from Ada. So its only natural that Ada is going to take back ideas to keep itself up to date. You are trying to make stealing ideas look like its a bad thing for languages, its a good thing and all programming languages do it. For example Ada uses generics to clean up heap allocated memory, Im sure that was borrowed from C++. Looking through that list you linked to I dont see anything related to Rust borrow/ownership syntax but rather everything has to do with concurrency and so looks like its borrowing more from Erlang. I notice in the unfinished proposals they are even suggesting coroutines and channels obviously taken from Go. So it looks like Ada is remaining a healthy and up to date language, so thanks for posting that link, it makes me confident that my time spent learning Ada is a good investment.
null · 2018-12-15 04:58
>>11802 >C++11, C++14 and C++17 its mostly a bunch of 'me too' features that modern languages have now Yes, and this is terrible. Once your language stops having clear focus and starts just copying features from other languages it stops being a well thought-out core and starts becoming a terrible mess of incompatible and/or orthogonal features. >You are trying to make stealing ideas look like its a bad thing for languages No I'm not. I was pointing out that Rust was necessary because there were guarantees it offered that Ada didn't. They showed that borrowing could work and they did that before Ada, so saying that "Rust is just reinventing Ada's wheel" is wrong. >I am starting to notice that Go borrowed a lot of features from Ada Interesting, what are they? >Looking through that list you linked to I dont see anything related to Rust borrow/ownership Yes, I was referring to AdaCore's spark extension implemented by Maroua Maleej, Tucker Taft and Yanick Moy. They wrote a paper about it and it's freely available if you want to take a look at it. >I notice in the unfinished proposals they are even suggesting coroutines and channels obviously taken from Go It doesn't detract for your point but coroutines and channels are actually ideas introduced by CML. Adding all these parallelism primitives to Ada is clearly missing Ada's point IMO. They want to take over the OpenMP crowd (just search for OpenMP on http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0119-1.txt?rev=1.9 ) and AdaCore even recently started working on OpenAcc support ( https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00089.html ). This is wrong. Ada was never meant for high performance computing. Ada is for high assurance computing. Give me more spark. Give me more safety. Don't give me useless primitives that I can't use because their guarantees are too weak for the certifications I'm aiming for and don't implement these primitives at all because people interested in HPC aren't interested in Ada. They're losing their focus IMO. >my time spent learning Ada is a good investment. Of course it is, and has always been, if you want to work on safety-critical projects. But if you're hoping to be able to find a job in webdev, hpc, compilers or just your regular application development, you're going to be severely disappointed.
Leto Atreides I · 2018-12-15 06:56
>>11803 >I am starting to notice that Go borrowed a lot of features from Ada Interesting, what are they? I got brain overload from studying Ada so now I cant remember
Drifter · 2018-12-18 12:29
>>11804 >>11803 Not that guy but I also noticed some similarities as I was learning go. The main thing is the way threads work; channel send/receive is very similar to how ada rendezvous works, and I think there is something like the select statement in ada that works like in go. It's been a while since I did any ada, but as I was learning go I remember going "hey, it's like ada but without the disgusting syntax".
Netrunner · 2018-12-18 21:49
I'm learning Ada to reimplement a program I originally wrote in Common Lisp. This is in part because I now understand the program very well and want to make it more reliable to failure and more optimized with regards to memory usage, along with being easier to distribute in a compiled form. A program reimplementation such as mine is a good first project in a new language, I think. I was originally drawn to Ada because it's unlike every other language I know and, unlike many static languages, has many nice facilities for correctness and avoiding runtime failures and that manner of thing. I saw Ada as the static, very strongly typed, rigid, keyword-based, uncustomizable language to learn, if I was ever going to learn a language with all of those qualities and more. I'm learning with Programming in Ada 2012 by John Barnes, which is the only good book for Ada 2012 still in print, apparently. I've reached chapter sixteen in little time and I find it a nice language so far, albeit a very different one. I'll keep you updated on my reimplementing in Ada, but I don't expect to get started on that this year. With so many examples of how barely designed and poorly implemented software can become popular, I'm thinking more and more that you should design properly and implement perfectly correctly when you release new software, because you certainly don't want to be responsible for more garbage. It can be exhausting to consider all of the nightmarish ways software can fail on the poor operating systems and hardware currently available, but at least the end is rewarding, where you have something that actually works as it should. >>11798 I don't really see the clusterfuck, from the proposals I've looked at. Would you elaborate on why you think this? >Basically Ada and Rust are like Vim and NeoVim. I'm not seeing this relationship. >Development and innovation had stopped to a crawl and it took the arrival of a serious contender to revitalize these projects. Ada is still being used for important and critical software projects. Rust is used in Firefox. >But Rust and NeoVim know what they're trying to do and where they're going while Vim and Ada are just trying to play catch-up. From what I see, Rust has about one thing Ada doesn't (What's called Affine typing, apparently.) and Ada has many things Rust lacks (Syntax designed for correctness, not needing to resort to unsafe code for many things, etc.).
Technician · 2018-12-21 04:34
>>11819 >Ada has many things that Rust lacks Also noteworthy in that category are the programming-by-contract support, the subtyping of primitives, and fixed point types.
queue · 2018-12-21 04:36
>>11815 >disgusting syntax How exactly is Ada syntax bad? How much mental gymnastics does a person have to do in order to reach that conclusion anyway?
Haruyoshi · 2018-12-22 03:46
>>11847 you should read the sentence again, he was referring to Go. you should also read the Go thread if you want to hear people who have made it their purpose in life to discredit Go any way they can
t · 2019-02-14 19:48
I'm having issues compiling my first Ada program. I'll be working with a format where I need to read in units that are less than a single octet and I wanted to see how large Stream_Element is in GNAT with a simple program, but I get the compilation error "Modular_IO" is a nested package, not a compilation unit and as this is the first Ada program I've actually tried to compile, I don't know quite what I'm doing wrong. with Ada.Streams; use Ada.Streams; with Ada.Text_IO.Modular_IO; procedure Test is package Stream_Element_Modular_IO is new Ada.Text_IO.Modular_IO(Stream_Element); use Stream_Element_Modular_IO; begin Put(Stream_Element'First); Put(Stream_Element'Last); end Test; I also don't know what I should do if Stream_Element isn't what I need and how I'd force a compilation error if it ever wasn't. Any help is appreciated.
overriding · 2019-03-12 16:18
>>12529 As an update, I finally got around to figuring this out. My entire issue was with Ada.Text_IO.Modular_IO; instead of with Ada.Text_IO; and I now intuitively understand why that is wrong, since I need to instantiate a generic package and so need to with the containing package, instead, and I can't access a generic package in that way if I with it, itself. Here's the correct program: with Ada.Streams; use Ada.Streams; with Ada.Text_IO; procedure Test is package Stream_Element_Modular_IO is new Ada.Text_IO.Modular_IO(Stream_Element); use Stream_Element_Modular_IO; begin Put(Stream_Element'First); Put(Stream_Element'Last); end Test; With that done, Stream_Element is, unsurprisingly, mod 256 and so I don't know how I should use smaller units, since that's what I need.
Dr. X · 2019-03-12 21:58
I have never used Ada myself, but I have read that it is a language that strikes a balance between safety and performance. I myself have only had C++ as a formally taught language(community college, didn't use it often thereafter). I've since gone on to learn a bit about Lisp, C, JavaScript, a little Java, etc. I mostly deal with HTML and CSS at my day job, so compared to others here I'm a hobbyist at best. Given that, I'm aware that lesser-skilled programmers like myself are a problem because of periodic mistakes in this, that, or the other thing. I've been looking at lightweight formal methods like Alloy to make sure I've thought through the design, but I'm still working with C libraries for my projects at home. For example, I'd like to mess around at some point with the Plan 9 from User Space libraries, which are all C-based. So.... with all that in mind, would Ada be a good choice to learn? I don't necessarily want hand-holding, but my enthusiasm for coming up with ideas has been tempered a bit by all the stories of this breach or that vulnerability. I've been wondering if there is any kind of language that kind of "fits" in my particular risk/reward window. Any advice would be appreciated.
Yamaoto Toshi · 2019-03-14 00:35
Youtube has some interesting videos on the subject. An interesting one is titled "Use a Better Language: Spark Ada" I'm not sure I've heard of another language that claims to be formally verifiable. Lisp comes closest due to lambda calculus, maybe.
J.C. Denton · 2019-03-15 15:17
>>12823 >I have never used Ada myself, but I have read that it is a language that strikes a balance between safety and performance. Unlike some other languages, Ada is designed for high performance, but also safety checks, so it's not a language that only guarantees safety where it has no runtime cost, although you can have the compiler omit them, anyway. >Given that, I'm aware that lesser-skilled programmers like myself are a problem because of periodic mistakes in this, that, or the other thing. I've been looking at lightweight formal methods like Alloy to make sure I've thought through the design, but I'm still working with C libraries for my projects at home. For example, I'd like to mess around at some point with the Plan 9 from User Space libraries, which are all C-based. Plan 9 doesn't use standard C, so it may be easier to use correctly than standard C. It's effectively impossible, in my opinion, to write a correct C program that isn't trivial. This is because, again in my opinion, as C lacks metaprogramming and a high level of abstraction, it relies on behemoth compilers for efficiency, which will silently and greatly modify programs; this even catches the professionals working on the Linux kernel. Unfortunately, I write this and yet GNAT, which is part of GCC, is the only Free Software Ada compiler that I'm aware of. >So.... with all that in mind, would Ada be a good choice to learn? I don't necessarily want hand-holding, but my enthusiasm for coming up with ideas has been tempered a bit by all the stories of this breach or that vulnerability. I've been wondering if there is any kind of language that kind of "fits" in my particular risk/reward window. I recommend it. I'm accustomed to languages such as Lisp and APL. I learned Ada because I wanted to write efficient programs that can recover from cases such as memory exhaustion, which requires control over memory management these languages other don't give you. I've also been very interested in writing perfectly correct software and Ada seems to be the intersection of performance and correctness. I don't believe I'm really doing it justice here, but I think anyone curious would like it. That's another reason I learned it, as it's the only language in its general category I know or have been learning.
Trinity · 2019-06-14 07:12
I just recently read and very much enjoyed the second blog post from this website, as it was recently published; the first is also a rather pleasant read: https://annexi-strayline.com/blog/posts/2/ If you're in the process of learning Ada, as I am, you'll probably similarly appreciate the examples using (unfortunately) familiar concepts, such as common C language programming errors and how Ada would prevent them, even without using it to its full potential. This is a nice learning resource, I think, and so I'm mentioning it here so that others may benefit. I'm still slowly making my way through Programming in Ada 2012 by John Barnes. I tend to read a book rather quickly and then massively slow down at around the midway point; I'm in chapter twenty three, concerning the standard predefined library, currently. So far, I've still not played much with Ada, in part because I don't have a very good environment for it setup, but I believe I'll start making progress again once I finish this chapter; as expected, in my unfinished Ada code I have some things that are poor imitations of what's already implemented for me, such as Ada.Strings.Bounded. Anyway, I'm not the only person here learning Ada, right?
progn · 2019-06-15 09:43
>>13929 >Anyway, I'm not the only person here learning Ada, right? I don't want to dedicate myself to a whole book. I'm just going through https://learn.adacore.com/courses/intro-to-ada/index.html
Cypher · 2019-06-16 15:05
http://www.loper-os.org/?p=1913 is a pretty good tutorial for ada. I wanted to like ada but it felt like I had to do a ton of planning to write anything compared to rust and it isnt as widely supported unless you are talking about mission critical stuff.
Hailvim · 2019-06-17 12:37
Just to update people on a few things. GNAT Community 2019 was released on 31 May, so enjoy the latests and greatest Ada! https://blog.adacore.com/using-pointers-in-spark And, finally, SPARK has pointers!!! My joy is unmesurable. A formally proven language with pointers (a la Rust), this is great. I have been interested in probable languages (Coq, Prolog, F*...), and SPARK was always the perfect mixture of: lets get the work done; and having a proven environment. I have personally not used it much, but it has become a much more modern and attractive solution now.
Nobody special · 2019-06-29 20:36
I finished chapter twenty three a little ways back. Now I'm writing toy programs to get a feeling for the language and all of that. I'll also work on some simple procedures for a program I'm writing and let it all seep into my skull over time. Here's a tiny little program that let me get comfortable with Ada.Command_Line; all it does is print the command name and any arguments: with Ada.Command_Line; use Ada.Command_Line; with Ada.Text_IO; use Ada.Text_IO; procedure Command_Line is begin Put(Command_Name); for I in Positive'First .. Argument_Count loop New_Line; Put(Argument(I)); end loop; end Command_Line;
Undisclosed · 2019-07-31 21:59
I've written an Ada interface to OpenBSD's pledge. You can find it here: http://verisimilitudes.net/2019-07-27 gopher://verisimilitudes.net/12019-07-27 That's the documentation, but I'll also explain here that you use it like this: ... Pledge((Stdio | Fattr => Allowed, others => Disallowed)); ... It's been a fun learning experience and this is a package I can be proud of. I also learned about C interfacing in Ada, although I don't expect to do much of that. The main thing I've yet to do is make it robust against future changes; I expect OpenBSD to add more promises and I have a Bounded_String type with a limit that's defined to be enough for the longest possible promise string; it's important that these be coordinated changes. The only solution that came to my mind and the only I've seen from others is to use a precondition and this is good because the compiler could likely determine it would always succeed or always fail at compilation; however, I want this precondition to be private to the body and I've not yet found how to do this. Once I write that, it will just be a matter of updating the library to stay up-to-date with OpenBSD, although the way its pledge is implemented you could use an old version of this interface just fine.
Cowboy · 2019-08-01 01:34
mini Ada review, after about 6 months of effort, desperately flipping through Programming in Ada 2012 throughout last year's Advent of Code, and making one medium sized daemon and a bunch of smaller tools for work: 1. super verbose 2. super easy to read 3. super painful to Type_Without_Editor_Support... and nobody offers the requisite editor support. ada-mode will capitalize for you but it still expects you to type those underscores without your fingers falling off. Super bizarre. 4. surprisingly powerful. You can, with great effort and information hiding across module bounds, sort of fake Ada's most basic features like distinct integer types with their own ranges, but the effort's so much that you won't bother. Ada's use of generics is futuristic. Brand new programming languages still show up without discriminated unions--what's wrong with the world? Someone tell me about the religion that explains this. 5. surprisingly well-designed. Ada isn't like SQL or Prolog or Smalltalk where the consistent design comes from a consistent application of an idea. Ada's design is almost more impressive: it comes from smart people sitting down and thinking until they arrived at good designs. The Ada 202x @ syntax is a small example of that. It would've been very easy to just give people exactly what they were asking for with assignment operators like +=, *=. Instead the Ada said, "OK, people say they want assignment operators, but what's the real value that they're wanting to gain from such operators? Let's add that value in a more generally useful and maintainable manner." 6. surprisingly expensive: I contacted AdaCore expecting prices like maybe 500 USD, 1000+ USD. Instead prices start at 5000 USD for a one-man project. In conclusion... I recommend Nim. It is an inferior language in many respects, but it borrows from Ada while being so much less verbose, and without the Haskell trap of visual terseness having an inverse relationship with the semantic verbosity. There are other languages I could recommend, but after digging into Ada, Ada's not one of them. It's comparable to Lisp, of meme "learn it to stretch your brain, and then move on."
DEBUG-CONTENTS · 2019-08-01 05:21
>>14446 >It would've been very easy to just give people exactly what they were asking for with assignment operators like +=, *= Not really. In Ada the inequality operator is /=, which makes the usual operators in that style a bit awkward. That it led to the more flexible @ syntax is probably coincidence, considering a lot of the other more contentious fashion trends getting into 202x.
Pris · 2019-08-02 21:31
>>14446 Where's the medium-sized daemon you wrote? >1. super verbose >2. super easy to read I'm not certain I'd call Ada extremely verbose and it's easy to read in part because it omits symbol soup like you'd find in other languages, but aren't these qualities rather intrinisically tied? You can have a verbose language that isn't easy to read, Java comes to mind, but it seems like an easy to read language would probably be more verbose than others, varying. >3. super painful to Type_Without_Editor_Support... and nobody offers the requisite editor support. ada-mode will capitalize for you but it still expects you to type those underscores without your fingers falling off. Super bizarre. I agree here. I'd configured Emacs to swap '-' and '_', but something keeps resetting this and I haven't bothered trying to fix it yet. I've also noticed that some of the editor help, say, ada-subprogram-body butchers some of the preceding specification for no clear reason. >4. surprisingly powerful. You can, with great effort and information hiding across module bounds, sort of fake Ada's most basic features like distinct integer types with their own ranges, but the effort's so much that you won't bother. That's also the impression I get. Being able to make distinct types for everything down to integers is something severely lacking, but this is all part of the appeal. >Ada's use of generics is futuristic. Brand new programming languages still show up without discriminated unions--what's wrong with the world? Someone tell me about the religion that explains this. I blame C and UNIX fanatics. >5. surprisingly well-designed. Ada isn't like SQL or Prolog or Smalltalk where the consistent design comes from a consistent application of an idea. Ada's design is almost more impressive: it comes from smart people sitting down and thinking until they arrived at good designs. I like and have explained it as Ada's rules are simple for a human, such as the access type rules boiling down to preventing dangling pointers, but this doesn't result in simple rules for the machine, but that's okay. Rather than defining a more normal model and calling it fine, Ada has a much less normal model that accomodates real-world scenarios. >The Ada 202x @ syntax is a small example of that. From the looks of it, they want to make Ada more like C and other languages, so the @ idea, while neat, won't be enough to have me start using the newer version. Ada 2012 added a contract system, which has real value for robust software; what has Ada 202X shown so far that would really be good for robust software? I chose Ada because I wanted to write programs that would be lasting, reliable, handle all failure cases, and efficient. If Ada 202X deviates from that even a little, I'll just avoid it. >6. surprisingly expensive: I contacted AdaCore expecting prices like maybe 500 USD, 1000+ USD. Instead prices start at 5000 USD for a one-man project. Why not just use the FSF GNAT? I agree that a major issue with Ada is only having one practical compiler, which is unfortunate. >There are other languages I could recommend, but after digging into Ada, Ada's not one of them. It's comparable to Lisp, of meme "learn it to stretch your brain, and then move on." I prefer the wisdom that a language isn't worth learning if it doesn't change your ideas about programming. I like what I've seen so far, so I'll just carry on in this direction with it and see where I end up.
Junichi Fujiwara · 2019-11-28 02:52
>>15825 (previous lisp thread) >Procedures in Ada can have in, out, and in out parameters. Rather than use dynamically allocated memory, it's common in Ada for a procedure to have an out parameter it uses for storage. I was only really aware of the emulation of out parameters in C where it seems primarily used on heap allocated items, so this is interesting to hear. It seems sane, although it also seems like it would make composition a little more difficult. >As for closures, if I'm remembering the terminology correctly, Ada has downward funargs. It has come to my attention that you often can have upward funargs without heap allocation. All you need to do is restrict mutation of local variables when you have nested functions to insure that there is only a single reference to each of these variables in the case where a function is used in a way that would need a closure typically. This allows for effectively the full power of closures. The remainder of the comments from the post this is in reply to were also interesting, but I either have nothing to say or what I do is not relevant to this thread.
Lain Iwakura · 2019-12-09 00:36
How does one start Ada in 2019? What package do I install to get an Ada compiler? How are libraries distributed? Should I just learn Rust instead?
Marly Krushkhova · 2019-12-09 06:04
>>16166 So depending on distro (on Arch it is gcc-ada), you have access to an Ada aware version of gcc. Else you can use the install instructions on their website. I'll make a proper post soon; currently commutining to work.
Cereal Killer · 2019-12-09 08:13
>>16042 >It seems sane, although it also seems like it would make composition a little more difficult. Ada has several different kinds of type categories, one of those being definite and indefinite. Put simply, some types always consume the same amount of space and some don't. A function can return either, but it's easy to optimize for a definite return value where the calling location can already have storage for it. Functions are preferred for conversion functions, named with a To_Type convention, because a conversion is probably going to be definite anyway and allows ease of composition without needing otherwise useless intermediate variables. This is something I realized for myself, as part of writing Ada is deciding whether to make a subprogram a procedure or a function; there are obvious cases, for convenience or efficiency or something else, but also plenty of blurred boundaries where it may be best to provide multiple forms for the different considerations. This is very different from Common Lisp, where you usually find something useful to always return, although I've written functions which return no value whatsoever before. I recommend mimicking and understanding the standard library in both of these languages, although eventually the point is reached where reasoned deviations are best. >It has come to my attention that you often can have upward funargs without heap allocation. I'll just admit that some of your explanation is lost on me. I'm on the verge of completely understanding it, but I don't want to reference the closure terms currently and it's late. Nested subprograms are less important in Ada than in Common Lisp, because Ada has better information hiding facilities and really just doesn't encourage the kind of programming where you need subprograms in the same way often. >The remainder of the comments from the post this is in reply to were also interesting, but I either have nothing to say or what I do is not relevant to this thread. I'm anticipating your response in the current Lisp thread. >>16166 I read the book Programming in Ada 2012 by John Barnes and I'm just about completely finished with it. It's a longer book, even for someone who reads thick language specifications such as myself, but I'm to understand there's not many good options. I'm going to eventually finish reading the Ada Reference Manual, but I'm only about an eighth of the way through reading it; I learn all programming languages I know by reading the standard and an introductory text, in either order, and Ada is certainly a language that benefits from reading the latter first; I wasn't making good progress reading the standard first, which is why I bought Barnes' book. >What package do I install to get an Ada compiler? Install the FSF GNAT, which is part of GCC. You want the version the FSF provides, not what AdaCore gives, for licensing and other reasons. >How are libraries distributed? I just host them myself, the same as every other language I know. You shouldn't use a library without auditing it, anyway. >Should I just learn Rust instead? What answer do you expect here? I don't see a good reason to learn Rust and that's already been explained in other posts of this same thread.
typedef · 2019-12-09 19:37
>>16169 >Ada has several different kinds of type categories, one of those being definite and indefinite. Put simply, some types always consume the same amount of space and some don't. A function can return either, but it's easy to optimize for a definite return value where the calling location can already have storage for it. >Functions are preferred for conversion functions, named with a To_Type convention, because a conversion is probably going to be definite anyway and allows ease of composition without needing otherwise useless intermediate variables. This is something I realized for myself, as part of writing Ada is deciding whether to make a subprogram a procedure or a function; there are obvious cases, for convenience or efficiency or something else, but also plenty of blurred boundaries where it may be best to provide multiple forms for the different considerations. I knew about the actually working variable sized arrays (unlike in C), I didn't know that this concept was generalized though, that's very nice. It makes sense that you'd try to use these over out parameters when composing, and it's very nice that Ada gives you the flexibility to do this even if at times this results in multiple forms of the same thing. >I'll just admit that some of your explanation is lost on me. I'm on the verge of completely understanding it, but I don't want to reference the closure terms currently and it's late. I could be entirely mistaken but it seems like a sufficiently smart compiler could just inline by value or partially evaluate against local variables for the locally defined function so long as these variables are mutated linearly or not at all. If one of the variables for a locally defined function was mutated after this local function was defined the local function would reference the pre-mutation form of this variable and would be incorrect. Now that I think about it for a second more, even these linear locally mutable variables would have to be on the heap in case you invoked the function more than once, so the local function would also have to be linear to stay on the stack. So you'd have the full power of closures for pure functions, and a severely limited version for impure functions. >Nested subprograms are less important in Ada than in Common Lisp, because Ada has better information hiding facilities and really just doesn't encourage the kind of programming where you need subprograms in the same way often. That's good, I really need to take the time to learn Ada one of these years, it really does seem like they took all the effort possible to competently design the system for the real world constraints they were given.
Iverson · 2019-12-10 01:58
Some resources for learning Ada: https://en.wikibooks.org/wiki/Ada_Programming -- Arguably helped me the most while I was learning Ada. http://ada-auth.org/standards/12rm/html/RM-TTL.html -- The reference manual was my secondary reference while I was learning Ada. It is quite heavy on the information and terminology, but a good read nonetheless. http://ada-auth.org/standards/rationale12.html -- One of the best documents about Ada and the reason why it is so (quite literally, it is the Rationale for Ada). Has some interesting examples here and there to illustrate features. https://en.wikibooks.org/wiki/Ada_Style_Guide -- General Style Guide for Ada Programming, but don't be fooled by the title. It actually has some interesting tidbits about the language and how to use it. https://learn.adacore.com/ -- An online interactive tutorial by AdaCore. I haven't tried it personally. Might be worth checking out. https://dwheeler.com/lovelace/ -- Very nice set of tutorials for teaching you about the ins-and-outs of Ada95 (a much older version of Ada, but the tutorial still holds the test of time). And finally, there's the classic textbook: Programming in Ada 2012 -- John Barnes (2014)
synchronized · 2020-01-14 02:43
Started learning Ada as a programming language for the ARM architecture. Which is sweet. So far, I have loved the language rather than C, or python, and it seems like now there are enough libraries to support what I'd like to do: create my own circuit boards and have them programmed in something incredibly stable, unlikely to fail. >>11674 With libraries being made/supported and companies/the military supporting it, I don't see it dying despite its age: in fact, should be on a incredibly stable footing compared to others >>11722 >>13939 >>16180 Good soykaf, and thanks
Terzibashjian · 2020-01-31 23:15
Anyone have a recommended PDF for learning modern ada?
Backus · 2020-02-15 19:17
I wrote an implementation of SHA-1 in Ada, using the word unit of the algorithm as the basic unit; it's a shame I'm still the only one showing his Ada programs here: http://verisimilitudes.net/2019-12-12 gopher://verisimilitudes.net/12019-12-12 I've been unable to have anyone give their opinion on this so far, so I'd be interested in reading yours. The specification is heavily-commented and the body well-commented. The basic design makes what should be the most common usage, hashing something entirely in memory, simple, but allows for partial hashing, which is what much of the remainder of the specification is concerned with. The library is designed around avoiding errors and making it simple to write correct code, so even though there's no difference between a partial hash and the final digest, the type system enforces it and a one-way conversion between Status and Digest is available. I'm particularly pleased with my Pad procedure, which breaks the naming convention to ease comprehension; since padding may require a second block, it was possible to use a scheme which only required one at a time, but that's more error-prone and so I instead designed it to require both simultaneously. As for the naming scheme, the remainder is entirely consistent: the intermittent Status type is always called State in parameter lists; the Word_Block is always Data; and the final Digest type is always Datum, which is the same length as State. My future plan is to write a comprehensive SHA package, using generics and other such things, and also using them to achieve compatibility with units other than the basic unit of the algorithm, primarily bits and octets, which this current library omitted for two reasons, the first being that it was repetitive and the second being I decided my other SHA-1 implementations would all handle different basic units. I'm anticipating this future SHA package, with a design greatly touched by this, and a casual look at the SHA has me believing they're all similar enough to make this approach pleasant. I'd be glad to get your thoughts and to see your Ada programs to give mine.
Unspecified · 2020-08-04 21:54
It's disappointing I'm still perhaps the only active Ada programmer here. I've been implementing SHA in the languages I know, and I recently finished the SHA-256 in Ada; my plan is to now work from this to a comprehensive SHA package, as with the other implementations: http://verisimilitudes.net/2020-07-28 gopher://verisimilitudes.net/12020-07-28 I won't write another large post, as the design follows from the SHA-1 described here: >>16925 I'm pleased with how the Pad procedure evolved, in accomodating bits and octets. The new design of the Pad procedure has three variations, only padding either bits, octets, or words. Padding is simplest in terms of bits, and I noticed, by restricting Pad to enforce the boundaries of its units, I could use a single generic body, and reduce what was a more complicated procedure to the binary ease. The binary case merely places a bit, zeroes the block, and deposits the length; padding octets or words requires finding the appropriate bit location, unless messages only perfectly aligned on octet or word boundaries are padded, which then becomes just another case of depositing a sigil, zeroes, and the length. I'd like to start other Ada work this year, as well. I'm of the opinion Ada may be well-suited to implementing other, more dynamic languages, serving as a nice platform for them. So, at some point this year, I'd like to start implementing a programming language in Ada. I wouldn't be designing this language, but implementing one already existing, to clarify. I'll not go into too much detail on this, for now.
renames · 2020-08-04 22:24
How is Ada compared to other languages like Rust or Scheme? I heard it is somehow secure, what makes that?
Anonymous · 2020-08-07 21:23
>>19935 Ada is a static, batch-compiled language with very strong typing, no metaprogramming, and an intense focus on writing programs which are efficient, maintainable, readable, and correct. Ada was designed in the mold of a set of requirements collected over years by and for the US Department of Defense, to become the one language it would use for the majority of its work. Ada has been used in missiles, missile-defense systems, aeronautics, automotive firmware, space, and other critical systems. Ada has a subset Ravenscar for real-time systems and a subset Spark for provably-correct systems. The Rust language has no compelling reason to exist in the face of Ada, as has been discussed in this thread already. Rust seeks out zero-cost abstractions, whereas Ada includes safety checks, because they're necessary for proper operation, although Spark can prove safety checks are unnecessary and discard with them entirely. Rust has an escape hatch it looks like most real programs need, whereas Ada has only a few escape hatches which are easy to determine and restrict or ban entirely, along with most real programs not needing them. Ada has the concept of profiles, which allows the program to swear off language functionality and perhaps get a runtime more suited to it, and the program can be statically checked that it adheres to those restrictions. One way Ada helps improve safety is by encouraging segmentation of programs, and a common scheme of subprograms receiving the storage they're to use. It's entirely possible to write many Ada programs that don't need to dynamically allocate memory, except at the very top-level, where it's also easier to check. As for Scheme, there's no real comparison. Scheme is a dialect of Lisp which prefers being small and having general mechanisms to achieve functionality. Scheme is perhaps the opposite of Ada in many senses. Scheme allows for metaprogramming through macros, whereas Ada has a generics system and that's it.
Lady 3Jane.. · 2020-08-07 22:49
>>20078 >focus on writing programs which are efficient, maintainable, readable, and correct How is the speed of coding, is it pain to write programs in it? I'm ashamed to admit I use Scheme mainly because I like the syntax. >Ada has been used in missiles, missile-defense systems, aeronautics, automotive firmware, space, and other critical systems. Sounds good. >The Rust language has no compelling reason to exist in the face of Ada, as has been discussed in this thread already. Why is Rust so popular, again? Everywhere I go, someone writes "cool, now rewrite this in Rust". Is it because of marketing? I can't stand the syntax, it is so disgusting. >One way Ada helps improve safety is by encouraging segmentation of programs, and a common scheme of subprograms receiving the storage they're to use. What about the OOP? I found Ada has OOP on the website. Sorry for my amoeba-tier response, Scheme is the first language I'm learning seriously and I didn't do any CS degree, programming is just my hobby.
Donna Hawthorne · 2020-08-07 23:17
How hard is it to get set up in Ada on Windows?
Mitnick · 2020-08-11 21:00
>>20082 Rust is more popular than Ada because Rust looks like C++ while Ada looks like Pascal, and people are more familiar with the former than the latter.
Tank · 2020-08-18 22:09
Ada is a waste of time. Back when I believed there was a need for low level code (because that's what the masses of oblivious neckbeards told me and it's hard to know they're wrong when first starting out) I used Ada. Then I realized it's not worth having 1500 pages of spec for a simple PL, and just changed to SML which solves every problem anyone cares about in a much better way. Ada is basically for the xxxx unilateral paradigm xxxxxx.
Ivan Horvat · 2020-08-19 01:53
>>20345 Low-level code is absolutely necessary real-time programming, which is what Ada was designed for.
let · 2020-10-08 20:55
>>20078 But does spark (I'm more interested in spark than ada) provide the same memory safety features as rust? Also >https://www.electronicdesign.com/industrial-automation/article/21804924/rust-and-spark-software-reliability-for-everyone >While both consider safety, Rust focuses on memory integrity, providing a model that allows the use of dynamic memory without risk of memory corruption. SPARK focuses on analyzability and provability of program properties and doesn't permit direct use of dynamic memory or even pointers. What does this mean. I'm noob to programming so please teach me.
Ivan Horvat · 2020-10-08 22:48
>>21194 No, it doesn't provide the same memory features. It doesn't allow you to use dynamic memory or pointers so it has absolute protection at the cost of more severe limitations. You can still use dynamic memory in Rust. It means that SPARK programs don't compile unless they pass proofs which are more capable and precise than what a type system can give you (or than you can get without a huge type irritations or unnecessary runtime checks). You're not going to understand this by reading about it. Try learning ATS as an introduction.
Incognito · 2020-11-11 08:05
Anyone have a copies of the POSIX.5 standards? I want to delve deeply into Ada but I don't want to spend $200+ to do it.
Agent Smith · 2020-11-11 08:08
>>22103 tried libgen?
dictionary · 2020-11-11 08:11
>>22104 I've tried libgen, various torrenting libraries, Google dorking, etc. but they're elusive has hell.
Haruyoshi · 2020-11-11 08:38
>>22105 try #osdev on FreeNode
Motoko Kusanagi · 2020-11-11 13:29
>>22103 >POSIX.5 Assuming you mean POSIX.1-2017
Junichi Fujiwara · 2020-11-12 10:55
>>22106 Good suggestion, I'll try that. >>22112 Thanks, but I did mean POSIX.5 (IEEE 1003.5b-1996).
Hacker · 2020-11-22 21:36
I have started learning Ada. I'm reading Programming in Ada 2012 book and I'm really enjoying it. Just finished chapter 4 and will be doing some simple programs to get used to basic Ada syntax. One thing I don't like in Ada is how long some libraries tend to be, not only that but it is full of underscore and capital letter in sequence. It reminds me of what I disliked about Java. Thankfully, I can easily ignore it. I'll keep reading the book and post here what I'm thinking about the language as I use it, perhaps this can make more people interested in the language or post here. Also, github doesn't seems to have many Ada open sources project for me to look at some good code, does someone know where I can find some good ones? The verisimilitude guy has some Ada source codes, at least. He once wanted to rewrite his MMC tool in Ada, I wonder if he did and what he thought of it compared to having write it in Lisp.
H.R. Giger · 2020-12-06 21:29
>>22439 >I have started learning Ada. I'm reading Programming in Ada 2012 book and I'm really enjoying it. Just finished chapter 4 and will be doing some simple programs to get used to basic Ada syntax. That's a good book, the same one I used for learning, and also an excellent reference to later return to. >One thing I don't like in Ada is how long some libraries tend to be, not only that but it is full of underscore and capital letter in sequence. It reminds me of what I disliked about Java. Thankfully, I can easily ignore it. I know several very different languages, so this doesn't much bother me. I take it as part of what Ada is about. I use special editor support for writing the capital letters and underscores easily. >I'll keep reading the book and post here what I'm thinking about the language as I use it, perhaps this can make more people interested in the language or post here. I'd certainly be interested in reading such posts. >The verisimilitude guy has some Ada source codes, at least. I should've had more by now, but I don't. I've a partial comprehensive SHA library. I'm writing a single very complex generic package to instantiate for SHA224, SHA256, SHA384, and SHA512; I've not finished it yet, because Ada is very hard to write in comparison to the other languages I know. It's more satisfying when I'm finished, however, and I can build an elegant design which perfectly conforms to an ideal. Once I finish that, I'd like to implement other such systems in Ada, and see where it takes me. Here's a series about writing an arithmetic library in Ada that may be enjoyed: http://www.loper-os.org/?p=1913 >He once wanted to rewrite his MMC tool in Ada, I wonder if he did and what he thought of it compared to having write it in Lisp. I hit an issue, in that I also wrote terminal libraries for myself, but didn't have a satisfying way to express it in Ada, and I only lightly started anyway. It's for the best, since the approach I use for writing an MMC has changed greatly with more knowledge. It would've been terrible if I'd actually written in back then, since I'm already working on another rewrite with an even better internal representation. I won't discount ever writing one in Ada, but find it unlikely. I believe Ada may be best for providing a good base to other systems, although I'm still going to implement libraries in it as I see fit. An example would be implementing an interactive and dynamic language in Ada, such as that aforementioned series does later on, along with what I want to do with the language.
Mentat · 2021-06-16 01:27
This is a generic function I've written, being a primitive useful for some future work I've had planned. This is the ⍋ function of APL, but even better, because it works on arrays of any indices, and also treats slices properly. It always amuses me when Ada has nicer arrays than APL. It's AGPLv3, but for licensing purposes the source is here: http://verisimilitudes.net/2021-05-31 generic type Index_Type is (<>); type Element_Type is private; type Vector_Type is array (Index_Type range <>) of Element_Type; type Result_Type is array (Index_Type range <>) of Index_Type; with function "<" (Left, Right : in Element_Type) return Boolean is <>; function Grade (Data : in Vector_Type) return Result_Type; with Ada.Containers.Generic_Array_Sort; -- This generic function returns a vector of indices which correspond to the sorted indices of Data. -- The indices returned are those same used by Data. It seems using the result requires O(N) space. function Grade (Data : in Vector_Type) return Result_Type is -- The Iota is named after that from APL, returning a vector with each index resolving to itself. -- Using the Base type avoids that edge case of a null array, with boundaries not of the subtype. -- It does sicken me how these null array bounds can be so lax I must use the Base type for both. function Iota ( First : in Index_Type'Base := Index_Type'First; Second : in Index_Type'Base := Index_Type'Last) return Result_Type is R : Result_Type(First .. Second); begin for I in R'Range loop R(I) := I; end loop; return R; end Iota; -- This function is the key to using a predefined sorting subprogram, exploiting its indirection. -- Controlling the comparison function permits sorting an array based on the contents of another. function Sorting_Indirection (Left, Right : in Index_Type) return Boolean is begin return Data(Left) < Data(Right); end Sorting_Indirection; -- I may find myself wanting for Ada.Containers.Generic_Sort later; using it's unreasonable here. -- It's disappointing I seem to need Ada 2012 purely for want of a predefined sorting subprogram. procedure Sort is new Ada.Containers.Generic_Array_Sort (Index_Type => Index_Type, Element_Type => Index_Type, Array_Type => Result_Type, "<" => Sorting_Indirection); -- Were the sorting subprogram a function this would be unnecessary, and it would be a lone line. R : Result_Type := Iota(Data'First, Data'Last); begin -- With this preparation finished, the remainder of the body is trivial. Sort(R); return R; end Grade; This is more useful than simply sorting, in some ways, when other information needs to change based on the new ordering. I may find myself using Ada.Containers.Generic_Sort to use a more efficient data structure than arrays for the final program, but Ada is more suited to an approach that delays long computation to be paired with others. So, rather than use an approach which defers giving numerical indices until all transformations are finished, it may be nicest in Ada to do it and transform at the last moment, when it could go unnoticed. This was tricky to get right, but also the most satisfying to finish. I've posted a Lisp version here: >>26270
Irvise · 2021-06-20 08:53
>>26271 It is almost aesthetic. The colour pallet really makes it nice. Adding to the conversation. The new release of GNAT CE 2021 is already up. It comes with some very nice additions! See https://blog.adacore.com/ada-202x-support-in-gnat https://blog.adacore.com/going-beyond-ada-2022 and https://www.adacore.com/download Also, since last year SPARK has been able to prove more stuff from Ada and work continues to get access types (pointers) into Spark. The goal is to make it even more capable than Rust's borrow checker. Also, Paul Jarrett made this snipped to show how to leverage the type system to create a much safer workflow to sanitize input. The source is from the Gitter #ada-lang group. I think it is a fantastic example! type Sanitized_String is new String; type Unsafe_String is new String; -- ... From_User : Unsafe_String := Get_User_Input; Safe_To_Use : Sanitized_String := Sanitize (From_User); -- ... procedure Do_Stuff_Where_Injection_Is_Possible (Str : Sanitized_String) is begin SQL_Thing_Or_Bash_Thing_Or_Whatever (Str); end Do_Stuff_Where_Injection_Is_Possible;
Morpheus · 2021-06-22 10:55
>>14446 >6. surprisingly expensive: I contacted AdaCore expecting prices like maybe 500 USD, 1000+ USD. Instead prices start at 5000 USD for a one-man project. It's worth noting that this is (a) the support contract, and (b) the cutting-edge GNAT PRO. RRSoftware has an implementation of Ada95 + most of 2005 and 2012 (as needed/able to be funded by customers) for, IIRC, $300. >>14470 >>Ada's use of generics is futuristic. Brand new programming languages still show up without discriminated unions--what's wrong with the world? Someone tell me about the religion that explains this. >I blame C and UNIX fanatics. I believe C and Unix has set the world of computer science back decades. >>16166 >How does one start Ada in 2019? Typically by (a) reading, and/or (b) getting a compiler and doing stuff with it, searching up the error-messages when you run into problems. Here's a playlist of a guy with almost no Ada experience teaching himself the language: https://www.youtube.com/watch?v=ljeYMzDThMY&list=PLpM-Dvs8t0VYbjaU8rJmPMVVw6ERnj7GO >What package do I install to get an Ada compiler? getadanow.com The FSF GNAT download off FSF. The GNAT Community edition off Adacore's downloads. yum or the like often also have GNAT. >How are libraries distributed? There's a package manager now, called Alire. I haven't used it though. >>16169 >Nested subprograms are less important in Ada than in Common Lisp, because Ada has better information hiding facilities and really just doesn't encourage the kind of programming where you need subprograms in the same way often. I find nested subprograms super-useful; especially for processing-heavy operations; you have your outermost function as the public-interface, but then break off complexity inside the subprogram so that your body between the BEGIN/END pair is relatively simple.
Pris · 2021-06-22 11:13
>>21194 >But does spark (I'm more interested in spark than ada) provide the same memory safety features as rust? Ok, Rust and Spark come from very different starting points. So, no; but this is a matter of how they "view the world". >> https://www.electronicdesign.com/industrial-automation/article/21804924/rust-and-spark-software-reliability-for-everyone >> While both consider safety, Rust focuses on memory integrity, providing a model that allows the use of dynamic memory without risk of memory corruption. SPARK focuses on analyzability and provability of program properties and doesn't permit direct use of dynamic memory or even pointers. >What does this mean. I'm noob to programming so please teach me. Rust is a response to C (and C++) and the horrible tendency for pointers/arrays to screw over memory; this is why they target "memory safety". SPARK is a toolset [theorem provers] applied to a rather large subset of Ada; because Ada simply doesn't have the pointer/array confluence that C does, this means SPARK focuses on ensuring the how-things-work rather than focusing myopically on memory. Note 1: The creator of D wrote a short article on the array/pointer mixup of C here: https://www.digitalmars.com/articles/C-biggest-mistake.html Note 2: Here is a video on Ada's memory management; it might be too much for a self described complete noob, but it does touch on some of the same issues/concepts being used: http://video.fosdem.org/2016/aw1124/memory-management-with-ada-2012.webm
Irvise · 2021-06-22 12:12
>>26338 >>21194 Well... Since June 11 2021, SPARK Pro (yes, sadly not the open version) can prove the correctness of `access all` types. Meaning SPARK can now prove memory integrity and safety. And it goes even further than Rust, as it does not need explicit lifetimes. See the entry here https://www.adacore.com/devlog hopefully we will get it in the public releases in a year or two at most.
Otto Normalverbraucher · 2021-06-22 16:23
>>26339 >Meaning SPARK can now prove memory integrity and safety. That's a little misleading, since in Ada 99% of code you write doesn't need to worry about manual dynamic memory allocation anyway. Memory safety hasn't been a pressing concern since... Ada 2005 introduced the standard Containers library, I guess?
Moore · 2021-11-16 01:05
I'm working on some more Ada libraries, but nothing's ready. Surely there will eventually be more Ada programmers here, right?
Knuth · 2021-11-16 06:23
>>28561 I tried it, but it was way too much verbose for myself. I was also trying to find a reason to use Ada. I already use C++ for the same reason I'd use Ada and while it's not better to Ada, it's far easy to find resources and solutions to problems I may have with it, sadly.
quote · 2021-11-16 10:47
>>28561 Ada's too low-level for my tastes and needs, so I'm not going to use it much. I sometimes do some embedded programming, though, so if I can get Ada working for that it'll definitely be my main language for that use case. >>28562 >it was way too much verbose My subjective experience (subjective and worthless, as I've only written a small test project in Ada) is that It's definitely verbose, but that is a boon. When I wrote my usual language-testing program in Ada, I found myself thinking about the problem (a trivial problem that I'd already solved a few times, mind you) at a deeper level of detail than with any previous language. That was largely because of the precise type system, but my perception was that the verbosity was also reducing my cognitive load: by having so much information laid out in front of me in writing, I had to do less remembering and was free to do more thinking. Folk wisdom says that terse languages are better for programmers, because at any given time we can only think about the code we see on screen. I have found that to be the case, so I was surprised to find that verbosity also helped me think more clearly. I should like to hear what the couple usual Ada users around here have to say on this. >while it's not better to Ada, it's far easy to find resources and solutions to problems I may have This could be paraphrased into mockery, for people who like that sport: with language X, it's not only easier to find solutions, it's also easier to find problems! It must have been done before.
nibble · 2021-12-23 07:08
Hey hey Ada people, an those who are interested in Ada. Ada will have a room in FOSDEM 2022, which is taking place online on the 5th and 6th of February. Some of you may want to give a talk there, see https://lists.fosdem.org/pipermail/fosdem/2021q4/003331.html the deadline for a short abstract is somewhat close, but only a small paragraph is needed to join. But I suppose most of you will simply want to enjoy joining the room that day to see what is going on. Either way, happy Ada hacking!
The Phantom Phreak · 2022-02-19 05:32
Hello everybody! The FOSDEM Ada devroom videos with Q&A have all been uploaded and made public. You can watch all the presentations here https://fosdem.org/2022/schedule/track/ada/ There are a few Introductory ones that I would recommend anybody interested in Ada to watch. They are: Jean-Pierre's "Introduction to Ada for Beginning and Experienced Programmers" https://fosdem.org/2022/schedule/event/ada_introduction_beginning_experienced/ and Paul's "The Outsider's Guide to Ada" https://fosdem.org/2022/schedule/event/ada_outsiders_guide/ They are both truely wondeful in their own right. We also had two SPARK (verifiable subset of Ada) talks that were on their own league. They are Rod's "SPARKNaCl: A Verified, Fast Re-implementation of TweetNaCl" https://fosdem.org/2022/schedule/event/ada_sparknacl/ and Yannick's "Proving the Correctness of GNAT Light Runtime Library" https://fosdem.org/2022/schedule/event/ada_proving_gnat_light_runtime/ Of course, there are many more presentations that I would recommend you all to see them :)
Spike Spiegel · 2022-02-19 10:48
>>30181 The Ada room is one of my usual stops in my yearly check on FOSDEM. In fact, I just watched 'program a game without knowing anything', but it wasn't what I expected - I thought I was in for a demo on building something from scratch, like with that guy that did sound programming in Haskell, but it was about a furry mammal recounting how it learned Ada and dishing out random pieces of advice. Will check out 'outsider's guide' next.
Donna Hawthorne · 2022-02-27 23:27
>>11673 Ada lovelace, full of grace. Pray for us C-niles, now, and at the hour of our segmentation faults. Amsegmentation fault (core dumped)
Leto Atreides I · 2022-04-07 21:06
I'll be writing a network program soon; one possible interface will use UDP, and the others can be implemented in terms of it. So, I've written a binding to the UDP POSIX Sockets functionality: http://verisimilitudes.net/2022-04-05 I intend now to bind over this with an ideal UDP interface I may use with all of my programs. My first attempt at doing this failed, because I tried to combine these things, but Ada is designed for more separation than to what I've been accustomed. I wanted to use a protected object, but this is unnecessary, since UDP is message-based, and so can't have race conditions and the like; sending needn't wait for receiving, and vice-versa. It was a great and unnecessary bother to simply send a UDP packet, but now I've done that, and may begin to move on from this, to greater things.
list · 2022-04-07 23:42
World space agencies and military already are funding projects to replace Ada with some new language, most probably functional. It's cool however, I have a pleasure to be Ada programmer.
FILLER · 2022-04-08 02:18
>>30684 Could be https://www.fstar-lang.org/
Boris Grishenko · 2022-04-10 23:22
Why don’t projects like OpenBSD and OpenSSL use ADA? I’m sure someone has suggest it at some point. Yes, I did see the verisimilitudes link but that’s one small thing. The F* TLS implementation is interesting.
Hacker · 2022-04-10 23:25
>>30712 By “one small thing” I mean compared to the whole OS.
bit · 2022-04-11 07:51
>>30684 Sauce? Because if that's the case it's kind of a shame. I've been looking to get into Ada for low-level stuff. I wanted something safer than C++ and with a more certain future than Rust, and Ada seems to fit the bill. Also, I feel like FP is the new OO. I love FP for certain things, but pure FP makes simple things really obnoxiously hard to express.
bit · 2022-04-12 12:41
>>30712 >Why don’t projects like OpenBSD and OpenSSL use ADA? The simple explanation is UNIX programmers love the C language and will continue to use it without reason. They scoff at writing in an assembler language, what a waste of time, and then they stop thinking so before they would also notice writing in the C language is a similar waste of time, compared to a higher language. They'll gladly continue plugging each hole they find, rather than eliminating them entirely. >I’m sure someone has suggest it at some point. This usually results in Theo or some other UNIX programmer arguing from authority that they can't have been doing things incorrectly for decades, so everything be fine. It doesn't help that most of this comes from the Rust rabble, as someone who knows Ada likely also sees UNIX for what it truly is. >Yes, I did see the verisimilitudes link but that’s one small thing. Which link in particular is being referenced here?
Special Agent Bob · 2022-04-12 16:16
>>30736 Ada has really good interfacing for C though.
Nobody special · 2022-04-12 18:29
>>30739 Sure but, since the goal is to always use the C language no matter what, they always shift to some other complaint. GCC supports Ada, but Clang doesn't, so that's just another reason to not use Ada. Why, it just so happens about the only languages which fit their strict and certainly not arbitrary requirements are the C language, sh, and Perl. One of the project's goals is as follows: >Work towards a very machine independent source tree. Support as many different systems and hardware as feasible. They wouldn't use the C language if they truly cared about this. They interpret machine independent as supporting a bunch of C language machines. Now, let's not discuss OpenBSD too much more. They're very boring compared to Ada.
Delilah · 2022-04-12 23:09
Has anyone here worked with ADA without an engineering or physics background? Has anyone here worked with ADA in something unrelated to engineering? What is your background? What did you work with? How did you get into it? How much domain knowledge was required?
Zhora · 2022-04-14 23:18
>>30747 >Has anyone here worked with ADA without an engineering or physics background? >Has anyone here worked with ADA in something unrelated to engineering? It's Ada, and I've. >What is your background? I'd be considered a hobbyist. >What did you work with? I write what I want to exist, and write it alone. >How did you get into it? I wanted to write robust software, and also figured it would be a good learning experience. >How much domain knowledge was required? I was already a top programmer, but all I needed to do was read the Barnes Book.
hash table · 2022-04-15 05:37
>>30743 >GCC supports Ada, but Clang doesn't, Boy do I have news for you: https://github.com/AdaCore/gnat-llvm Yes, it is using the GCC libraries, but it does not matter. It is like GCC using the Clang libstd++, it is still GCC. It is 100% LLVM and it was developed to have a WASM target. Yup, Ada can now be compiled for your browser using WASM: https://github.com/godunko/adawebpack/ >>30747 I am an engineer. I learnt Ada after working in some near-safety critical Fortran code from the 60s. I wanted to know whether there was something that could warrantee a safer system. So I ended up finding a bunch of languages but most of them were for specific porpuses or too heavy on maths. Ada with SPARK was brilliant. I started learning it and the more I learn it, the more I realise that most languages do not care about making things better, but just making things different enough and marginally better. If they genuinly cared, a lot of good ideas from older languages would be reused and improved upon. Rust is a good example. A bunch of people realised its potential and wanted it to have the ability to have a finner grained type system... They didn't do it... And it also does not have contracts. I mostly use it for embedded systems (for fun, I am a mechanical engineer). The Ada community is quite knowledgable and has pretty much though about everything, which is reasuring. They also ackowledge its shortcomins and issues. Their honesty tends to set them appart from most other communities. My previous knowledge was mostly C and some Matlab and old Fortran.
Cutter · 2022-04-17 10:40
>>30788 where do you find a community for ada ppl?
Knuth · 2022-04-17 23:21
>>30825 Librera #ada for one.
Dujour · 2022-04-18 13:57
this is a pretty good reference
Netrunner · 2022-04-20 08:40
>>30825 For whatever reason I thought I had already created a list of communities here, but I had not. So here it goes: As already said by >>30834 that is the Ada group in IRC Then there is the Telegram group, it is probably the most widely populated one of this list https://t.me/ada_lang The classical place to discuss Ada in depth is the Usenet group. You can find a wealth of resources there. The most complex discussions take place there https://t.me/ada_lang Then there is the Gittercommunity. Also quite active https://gitter.im/ada-lang There is also a Matrix group (you can use the Gitter one from Matrix) #ada-lang:matrix.org I am personally in all of them. If you join, say hello to Irvise :) If you would like to get started with Ada from the ground up, I would recommend to read/follow https://learn.adacore.com/ Regards, Irvise
Armitage · 2022-05-08 18:27
>>30682 This is the other main piece of that upcoming program, a simple trie: http://verisimilitudes.net/2022-05-05 It's named Trivial_Trie, and suffices for my need to have a long-lived trie for reading. I'm very pleased with my naming here. It was fun to play with limited private types; I accidentally made the full view of the type limited as well, but learned that lesson and others, after fighting with the compiler.
Aristóteles Amadópulus · 2022-06-04 11:02
What does this mean for Ada FOSS community? >https://blog.adacore.com/a-new-era-for-ada-spark-open-source-community >Two years ago we thought about modernizing the ecosystem. A cleaner and more familiar ecosystem with two variants: >GNAT Pro provided and supported by AdaCore for commercial/industrial projects, >GNAT FSF provided by the community for open source projects with familiar licensing and without pure GPL run-times >This results in a decision by AdaCore to stop further releases of GNAT Community Will this slow down free software Ada compiler development? How does the FSF GNAT compare with AdaCore's GNAT community?
Rick Deckard · 2022-06-05 01:01
>>31427 >Will this slow down free software Ada compiler development? How does the FSF GNAT compare with AdaCore's GNAT community? I do not think so. Regarding the license change: 1. Most ecosystems and tooling already uses the Apache v2 license or MIT. See Go, Rust, Elixir, Erlang, LLVM/Clang/Flang, etc. 2. The license was an "issue" that most people who did not work with Ada tend to point out: "If it is GPL, then it is too restrictive", "AdaCore just wants you to pay for the Pro version", etc. So this should fix that. 3. Lawers and companies tend to favour MIT/Apache v2 over GPL. 4. Apache v2 is more broadly compatible with other licenses. Regarding the relation of GNAT Pro and FSF/GCC/GNAT. It used to be the case, several years ago (basically a decade) when GNAT Pro had many more features than FSF/GNAT. However, in the last few years, that has no longer been the case. AdaCore is developing on the GNAT Pro version what they want and what their customers want. Then they trickle down those changes to FSF. The speed at which these changes are sent to GCC is becoming faster and faster. And they tend to be somewhat complete patches/features. For example GNAT Pro does have some nice extras not present in GCC, but they are features that are still evolving and are not considered stable. Nowdays, the most that it takes for a Pro feature that has been stabilased to reach FSF/GNAT is about 1 year. That is because of the FSF/GCC release cycle. Regarding the ease of deployment of the tools and ecosystem using the deprecated community edition. Alire has pretty much everything you need. From compilers, to libraries, to tools, to provers. The GNAT Studio IDE just had a Release Candidate (RC) very recently, so it should see a stable release soon. All this replaces what the Community edition did completely. But now, thanks to Alire, all the ecosystem and the actual tools/compilers/etc are transparent to the user. For example, now you know what compilers you have available and what features they support. Cheers
Agent Smith · 2022-06-17 21:41
>>30682 >>31131 I've finished that program, and a few others, by now: gopher://verisimilitudes.net/12022-06-13 http://verisimilitudes.net/2022-06-13 It's only a body, so I'll also attach it to this post. I understand the work as a whole is unimpressive, so read this reflection on it before critiquing it: gopher://verisimilitudes.net/02022-06-17 http://verisimilitudes.net/2022-06-17 >>31427 It means capitulation to those who won't use Ada regardless. The GPL is better than the loose licenses.
Spike Spiegel · 2022-06-30 20:54
Does ADA have AST macros? From my research it doesn’t seem to have. Why is that?
Chani · 2022-07-04 00:39
>>31718 It's not about pure power (i.e. Lisp), but making a reliable, featureful and "easy" to read (verbose and a bit noisy, but quite predictable/explicit with few indirections) for use by mediocre and boring DoD corporate drones. As much as I love proper macros, modifyin the language you use can certainly impede readability.
Anonymous · 2022-07-23 20:05
https://github.com/ohenley/awesome-ada
nibble · 2022-08-25 01:53
I'd almost feel bad about posting so many links to my website, if I didn't seem to be the only Ada programmer posting here. >>30682 >I intend now to bind over this with an ideal UDP interface I may use with all of my programs. As planned, I've covered up that UDP package with a package much better: http://verisimilitudes.net/2022-08-22 I'm reasonably pleased with the name I've given to this, Usable Datagram Package. >>31518 Here's an updated version of this program. Compare them; isn't this latest version so much nicer?
synchronized · 2022-09-01 00:24
>>31718 Lisp style macros are massively overrated. Consider, if you will, how little difference there is between a Lisp macro and an inlined function done by a mildly optimizing compiler. And as a tradeoff for this power, Lisp burns your eyes with ((()))(()()). I'll take the much more readable Ada syntax, thanks.
Agent Jones · 2022-09-01 03:22
>>32598 >thinking macros are only about performance Stop talking about stuff you don't understand.
drop · 2022-09-01 04:27
>>32601 >thinking I was talking about performance It is you who does not understand. A Lisp macro is a function executed at compile time that generates some new Lisp code that replaces the macro call. In a different language such as Ada, an inline function achieves most of the effect of a function being replaced with generated code at compile time, and any mildly optimizing compiler will compute function calls that have known arguments and no side effects at compile time which achieves the rest of the effect. You may argue that there is no equivalent for the homoiconicity of Lisp, and there isn't, but that isn't really a major factor here.
Agent Richard Gill · 2022-09-01 04:42
>>32602 No, you still don't unerstand. The major point of Lisp macros is that its arguments aren't evaluated, allowing you to extend the language syntax seamlessly.
Miho Iwakura · 2022-09-01 04:52
>>32604 >supposedly extends language syntax seamlessly >everything is still lists inside parentheses Are you high? Homoiconicity directly implies that you can't extend the language syntax beyond the standard abstraction methods available, and quoting things to prevent immediate evaluation is a basic feature. No, the key feature is the compile time computation and code replacement. Which other languages can do, to varying extents and convenience. Now go be a Lisp cultist somewhere else please. This is an Ada thread.
XERXES · 2022-09-01 10:26
>>32605 You're being disingenuous. Now, stop talking bullshit and show me how you implement unless (or the missing do/while) in Ada so that it looks like another keyword. (defmacro unless (cond then-form else-form) `(if (not ,cond) ,then-form ,else-form)) Be careful with the sour grapes overflowing from your pockets by nitpicking about the chosen example. And before you call me a blind Lisp fanboy, I'm >>31749 so I say Ada has some good reasons for not having macros.
Technician · 2022-09-01 11:00
>>32608 >so that it looks like another keyword That's not how it works. What you meant to ask for was an implementation that looks just like another subprogram, since that's what Lisp macros do. They look like just another function call. Thus... procedure Unless (Condition : in Boolean; Then_Form : access Procedure; Else_Form : access Procedure) with Inline is begin if not Condition then Then_Form.all; else Else_Form.all; end if; end Unless; >the missing do/while The hell are you talking about? It's right there already. Just put an exit statement with an appropriate condition on it at the end of a loop.
Netrunner · 2022-09-01 11:57
>>32609 >That's not how it works. What you meant to ask for was an implementation that looks just like another subprogram That's not what I meant. I meant something that looks like the original if. It just happens to not be exclusive in Lisp... >since that's what Lisp macros do. They look like just another function call. Thus... ...because there are no keywords (unless you count special operators as such) and no syntax difference between functions, macros and special operators except for evalution time. Anyway, sorry for continuing, but what does it look like being called? Because this looks like the equivalent of passing a function pointer in C, from a profane point of view; which would be unreadable, removing all the interest of an "unless" operator.
sizeof · 2022-09-01 12:03
>>32609 >>the missing do/while >The hell are you talking about? It's right there already. Just put an exit statement with an appropriate condition on it at the end of a loop. That's not a do/while, that's a while(1) with an ugly crutch to emulate a do/while. That's like saying for (int i = 0; i < 100; ++i) { do_some_stuff(); } // is the same as int i = 0; while (i < 100) { do_some_stuff(); ++i; } which it is, functionally (if you ignore the i variable scope leak), but that's certainly not as comfortable to read.
Ivan Horvat · 2022-09-01 23:24
>>32611 >what does it look like being called? Depends on if you have some no-args procedures lying around already. If you do, then calling it would be as simple as something like Unless (X = 1, Do_This'Access, Do_That'Access); But if you don't already have such procedures lying around you will have to declare them first, which makes the whole thing less appealing. Making a function to replace a keyword structure has issues like that. >>32612 >that's a while(1) with an ugly crutch to emulate a do/while You mean an elegant merger of exit condition syntax for at the end of a loop with exit condition syntax for in the middle of a loop.
Pulse · 2022-09-02 10:54
By choosing to ignore the whole point of Lisp-style macros (readability equivalent to built-in forms with no runtime cost), anon has succeeded in proving that a poor substitute for them with no practical use could be implemented in any language that has procedures. For this feat, anon has chosen the thread devoted to Ada, a language that avoids syntactic extensibility by design, favored by programmers wary of the maintenance costs that such tricks sometimes carry. What was the point, the world wonders?
Hououin Kyouma · 2022-09-02 11:28
>>32620 You neither understand Lisp-style macros, nor what syntactic extensibility actually means. But whatever. How about I blow your mind again and tell you about how you can do functional programming in Ada? See, all you have to do is realise generics are really higher order functions...
Roger Pollack · 2022-09-02 11:40
>>32612 What's the difference between i++; and ++i;
Neuromancer · 2022-09-02 11:56
>>32623 The first option returns the value of i then increments. The second option increments then returns the value of i. In the context that anon used them, there is no practical difference. The closest equivalent in Ada is the @ target name symbol that is getting introduced in Ada 2022. For a few reasons, reasons Ada has never had the C-style increment, decrement, or self-referential += -= /= *= stuff. https://learn.adacore.com/courses/whats-new-in-ada-2022/chapters/assignment_target.html
array · 2022-09-03 09:23
Is Ada a good language for high-performance low-level stuff? I haven't used Ada before, but from what I've read it seems to be around C++ in terms of both speed and closeness to the hardware. Is that accurate?
Hitomi · 2022-09-03 11:44
>>32632 From what I know, the C++ approach is continually adding more and more things for questionable gain. The Ada approach is getting it about right the first time, but allowing for overriding certain qualities. As an example, most things have no address by default in Ada, but I can force them to have one, or even a particular address. Most of the time, there would be no need for these qualities, which means most code is high-level. Another nice quality is that Ada's generics were designed to avoid several problems present in C++ templates, because C++ templates were thrown together with no foresight in comparison; Ada generics state the category of their parameters, basically, and don't have issues relating to instantiation so long as they follow these rules; also, they're not Turing-complete.
John Titor · 2022-09-04 09:26
>>32635 Interesting. I've always gotten the impression that Ada was at roughly the same spot on the high-to-low-level spectrum as C++, but targeted a roughly different domain and did so in a different way. How does it fare in terms of performance and resource use, and how does memory allocation work in it in general? I've heard that it does some pretty exotic things in that regard.
null · 2022-09-05 04:37
>>32649 It is in the same spot (manual memory management with quite extensive/powerful stdlib) but it was done pretty well, instead of being accreted Big Ball of Mud (http://www.laputan.org/mud/) style by a team of Katamari Damacy playing monkeys. And it has cool features C++ lacks like standard dynamic multidimensional arrays, optional parameter naming, integer range types, etc...
Irvise · 2023-01-03 08:57
I just want to announce that Ada will have a stand over at FOSDEM. I will be there. Feel free to come and ask questions or just say hi! Best, Irvise
Fred Nurk · 2023-01-03 16:25
>>11676 >even Rust You are talking like Rust is something really big. While it didn't bring anything really new. It's well done but it didn't revolutionise anything like soyboys use to talk. It's just another widely advertised C/Cpp killer which stepped on the same soykaf as previous safety seekers. >C++, Java, C# are all behind the times This need explanation otherwise it's just complete nonsense. In which way they are behind? In implementing new features? Why do they need to rush it? If they all have ways to test it in experimental libs and branches? >>11674 You first choose what you want to do. And then use what ppl in that field use. >>11685 >large companies, ie banking, medical technology, aerospace, etc Which all prefer to sit on other tools. >>11763 >I'm particularly interested in using Ada on a microcontroller like the AVR, MSP430, or Cortex M series Why tho? Why don't just use what manufacturer made for you to use? >>11802 >'me too' features It's not 'me too' feature, usually someone like feature and implement it. If more ppl find it useful they add tool into language, which is good to have options to choose. >>11803 >Yes, and this is terrible. It all depends on internals and way of implementation. Nothing terrible if done right.
Wirth · 2023-01-03 17:21
The story of Ada is a whole fuarrrking mix of everything from fascinating engineering to corruption and chain of unfortunate event for language. It might be very interesting to read good book summarizing whole that story in the future. Some interesting quotes: >A striking example of this phenomenon has recently been provided by Ada. If Ada is going to provide a standard, that standard had better be unambiguously documented. At least two groups have had a go at it; both efforts resulted in formal texts of about 600 pages, i.e. many times longer than needed to ensure the impossibility of ever establishing firmly that the two documents define the same programming language. The fault of the patent unmanageability of these two documents lies neither with the two groups that composed them, nor with the formalisms they have adopted, but entirely with the language itself: only by not providing a formal definition themselves, could its designers hide that they were proposing an unmanageable monstrum. That Ada will decrease the pain of programming and increase the trustworthiness of our designs to within acceptable limits is one of those fictions for which a military education is needed in order to believe in it. The best thing I can report on this front are persistent rumours that even a military education does not suffice to maintain faith in the effectiveness of this Stone of the Philosophers. I have mentioned Ada explicitly because it provides a perfect illustration of what I alluded to at the beginning of this talk: its adoption was a political process in which computing science, whose warnings were viewed as a nuisance, was not allowed to have any influence, and, consequently, just maintaining one's well-considered doubts becomes, beyond one's control and intentions, a politically loaded act. Edsger W. Dijkstra Archive EWD952 >Hoare expressed his regret that "rattles and trinkets have prevailed over the fundamental requirements of reliability and safety" and warned against "an armada of missiles flying the wrong way because of an error in the Ada compiler that was not detected in time." Niklaus Wirth expressed himself more restrained, but also negatively. He said: "There is too much falling out on the programmer. I don't think that, having studied a third of Ada, it is possible to work normally. If you don't master all the details of the language, then in the future you may stumble on them, and this will lead to unpleasant consequences." Jean Ishbia, the head of Ada's development team, expressed his "respect and admiration" for Wirth, disagreed with him, saying: "Wirth believes in simple solutions to complex problems. I don't believe in such miracles. Complex problems require complex solutions." >The procedure for verifying the compiler's compliance with the language standard by testing is also questionable. From general considerations, it is clear that testing can find a discrepancy, but cannot guarantee correctness. A practical confirmation of this is the fact that certified compilers, when tested on another set of tests, found non-compliance with the standard. >Ada's supporters also note that the idea of the complexity of development in Ada is only partially true: writing a simple program in Ada does require more time than in other, less formal languages, such as C, but debugging and maintenance of programs, especially large and complex ones, is greatly simplified. According to Stephen Zeiger of Rational Software Corporation, software development on Ada as a whole is 60% cheaper, and the developed program has 9 times fewer defects than when using the C language. >Is the Programming Language All That Important? The choice of programming language is only one of many factors in project successes and failures. In our opinion, it is NOT the most important. Among factors with greater influence on project outcomes, we would suggest looking at: Architecture and Design, Configuration, Management, Testing (Effectiveness, Coverage, Rapidity), Support for Iterative/Spiral/Object-Oriented Development, Programmer Skill, Management Skill. >The language choice can do little to make up for weakness in these key areas. A mistake in any of these can kill a project. The language choice may only change expenses by a factor of two. Of course, a million dollars here and a million dollars there and pretty soon you're talking about real money. >During the design of the language, the Pentagon assumed that all new software would be created only on Ada. Because of this, Ada received extremely primitive means of interacting with programs in other languages. In practice, it turned out that it was unrealistic to write everything in Ada at all (if only because there was a need to interact with ready—made developments in other languages). Therefore, in industries where there was no strict requirement to "write only in Ada", other languages more adapted to the multilingual environment were preferred. In the 1995 standard, the problem of interaction with other languages was solved, but the time was lost. >Paradoxically, the spread of Ada was prevented by the financial and organizational support of the Pentagon. The Ada programs written for the military ran on the most powerful computing technology available, so compiler developers took care first of all about passing ACVC tests, and only then about the effectiveness of the compiler and the code it created. In the early 1980s, the boom of microcomputers began, and translators for common languages (Pascal, C, Basic) were quickly optimized for low-power systems. For Ada, there was no incentive in such modernization, as a result, personal computers that became the bulk of the world computing park in a few years turned out to be without a high-quality Ada translator. Naturally, Ada has lost this market segment. It was only relatively recently that the GNAT compiler appeared, high-quality and productive, but even here the time was lost.
↑ · 2023-01-04 11:47
>>33858 >You are talking like Rust is something really big Considering what Rust is and when it started, I'd say yeah, it is pretty big. Don't get me wrong, it's not The Most Popular Programming Language In The World or anything; far from it! But out of all the attempts to directly challenge C++, it is far and away the most successful. That people spend so much time arguing about it is a testament to that fact. With that said, this is an Ada thread, and I'm not really much of a Rust programmer anyway, so we should probably stop talking about it and get back to the topic at hand. >Why tho? Why don't just use what manufacturer made for you to use? Because it's fun? Not everyone codes solely to get work done. Sometimes you just want to write a program for its own sake; to have a hobby project you can work on at your leisure. It's the whole reason something like an OS written in Python exists; the people making it have no expectation that it's ever in a million years going to overtake the likes of windows, because that's not really the point; the point is that making a thing is neat. >It's not 'me too' feature, usually someone like feature and implement it. If more ppl find it useful they add tool into language, which is good to have options to choose. Not to be rude, but did you even read his post?
Zhora · 2023-01-08 08:44
Let's say I'm working on a server program, which is capable of servicing multiple clients at the same time using their respective sockets. So far so good, right? Now, there's state that's shared between multiple clients which should be accessed in a concurrency-enabling manner, i.e. that two clients A and B should be able to access independent resources E and F at the same time, where E and F are addressed in the same identifier space. The first approach I tried was a protected object that would transfer ownership of the resource using Indefinite_Holders' Move procedure, but that failed because an entry's parameters cannot appear in its guard clause -- so I couldn't implement locking with a complex monitor condition. The second approach I'm thinking about is reference counting, where the client-serving tasks would use a reference type to first get an automagically counting pointer to a heap-allocated record w/ a protected object on it, the latter serving as a mutex. Reference type would be exactly the limited controlled thing one would expect. My questions are: what's the usual way to do this, over my second approach? Is there a way to make the first one work instead? (It'd involve fewer checks for resources being deleted, so I'm holding a candle for it.)
drop · 2023-01-22 10:04
>>33895 This problem was solved with a protected type representing a reference count and status, included in each of the shared records as a field. Those are in turn referenced in an ordered map from the containers package, wrapped in a protected unit. This enforces reference counts and pointer lifetimes, so that a RCU-like mechanism isn't necessary. Takeaway lesson is that protected types and units allow the programmer to cook his own concurrency primitives, and that whatever misgivings one might have about efficiency are most likely made moot by how good the compiler is. (not like anyone benchmarks their soykaf anyway before even thinking about low-level efficiency. wankers)
St. IGNUcius · 2023-02-13 15:01
Introducing AdaCore, a Rust Foundation Silver Member >https://foundation.rust-lang.org/news/member-spotlight-adacore/ What!?! Why? Are they going to slowly abandon Ada?
Yet Another Lainon · 2023-02-13 16:54
>>34323 They are working together, dipshit They have a lot of goals in common and it's worth comparing notes, especially on the features that aren't in both languages
roll · 2023-02-15 02:20
>>34323 >Why They've been working on a qualified Rust toolchain for over a year now, which is honestly a good business decision on their part. https://blog.adacore.com/adacore-and-ferrous-systems-joining-forces-to-support-rust
string · 2023-04-07 10:43
>>11674 its fun to learn. just the basics. but no reason to use it for me
xolatile · 2023-06-16 13:31
My very old games made in Blender GE...
xolatile · 2023-06-16 13:39
>>36253 Old C text adventure game... S: Source code is like kicking dead whales down the beach, long ago.
Agent Smith · 2023-07-07 04:49
>>14444 >OpenBSD How did you install GPRbuild? Did you follow these guides? https://thierr26.github.io/first_steps_with_openbsd.html#installing-the-gnat-8-3-0p4-package https://thierr26.github.io/gprbuild_on_openbsd.html
Cat Mother · 2023-07-07 21:46
>>36253 that's very cool lain
SHODAN · 2023-07-08 01:53
I figured whoever made the posts in this thread which were lost would remake them, only to remember that I was he. I released an implementation of the Serpent cipher in Ada a little ways back: http://verisimilitudes.net/2023-04-30 gopher://verisimilitudes.net/12023-04-30 It may be compared with the much older Ada implementation: https://www.cl.cam.ac.uk/~rja14/serpent.html Most recently, I've finished an optimized implementation of a generic HMAC in Ada, which may be compared with my previous toy experimentation of the same: http://verisimilitudes.net/2023-07-07 gopher://verisimilitudes.net/12023-07-07 http://verisimilitudes.net/2023-03-07 gopher://verisimilitudes.net/02023-03-07 I'll soon enough finish my comprehensive SHA implementation, and will then have no more easily-identified pieces to finish before working on Pest: http://pestnet.io >>36394 I don't use GPRbuild. I only use the compiler, with all source code in one directory and all files named so that the compiler may find them for me automatically and with no effort of me.
Lukasiewicz · 2023-08-18 14:33
Hello, Ada lainons. Let me start with some context. The 21 hour long days of midsummer, and viewing a fellow wizard's Youtube videos on his "Cowgol" language and its implementation particulars, led me to a crazy summer idea of implementing Ada for 8-bit microcomputers such as those running on Z80 (CP/M) and 6502 (C64, 128, and +4). And not just implement, but self-host as well -- a task regarded impossible for 64k "bitty boxes" of my early youth, and even the smaller minicomputers of 1983. Practically speaking I got as far as building a lexer-tokenizer pass that ingests a single body source and its context dependencies' spec sources and emits them in an efficiently tokenized form in a hash-seekable file on a storage volume. So far so good, I suppose I'll pick it up again next year with parser and bytecode intermediate compiler stages. My main question here, however, concerns a high idea I had (and then further elaborated) concerning implementation of tasking on a single-processor old-school computer. Since there's no useful preemption or scheduled task switching on those platforms, I investigated the possibility of using coroutines to achieve conforming behaviour to the point where tasks and protected objects could be implemented and interrupts processed just as one would in a preemptively threaded contemporary operating system. And what I found to my great wonder was that the language specification seems to have anticipated a coroutine-based implementation! So the question is, to those who're knowledgeable in these matters: is it definitely infeasible to implement Ada's tasking model using coroutines, in the absence of any operating system support of context switching?
Faye Valentine · 2023-08-18 18:23
>>36825 >and viewing a fellow wizard's Youtube videos on his "Cowgol" language and its implementation particulars Cool guy, learned how to write an Assembler from one of his video some time ago.
word · 2023-10-20 01:55
I got recently interested in Ada again (partly because I kinda like FreePascal and Ada looks similar). Noob question: How is memory management done in Ada. Does Ada use reference-counting? Does Ada have something similar to Rust's unsafe{} that allows using pointers? I'm interested in memory safe languages because apparently about 70% of bugs in Chromium are memory safety bugs: https://www.chromium.org/Home/chromium-security/memory-safety/ The main reason why I'm more interested in Ada than Rust is that I find Ada's syntax to be much more readable. I don't get why Rust has so much momentum currently but Ada doesn't.
Lain Iwakura · 2023-10-20 20:06
>>37490 >How is memory management done in Ada. Most Ada can be designed as a finite state machine. So, subprograms accept out parameters they use as a workspace. Most temporary working storage can go on the stack. Anything more complex can generally be done at the top-level of a program, or can otherwise be easily contained. >Does Ada use reference-counting? That must be done manually. >Does Ada have something similar to Rust's unsafe{} that allows using pointers? Ada calls pointers access types, and they're not restricted, but usually unnecessary. Dynamically allocating storage of a certain type works, but deallocation is unchecked, and requires instantiating a generic function, Unchecked_Deallocation. Note that access types don't allow for asinine operations like addition; there's the option to use direct addresses, but it requires a special package, and is rarely needed. >The main reason why I'm more interested in Ada than Rust is that I find Ada's syntax to be much more readable. It was designed to be readable. >I don't get why Rust has so much momentum currently but Ada doesn't. The computing corporations want to pretend that none of these concepts existed in the 1980s, because otherwise they would have to explain why they ignored them all this time. It should be criminal negligence, but it isn't. Anyway, that's why every time we read about Rust we'll never see Ada mentioned.
stack · 2023-10-22 17:15
>>37490 >I don't get why Rust has so much momentum currently but Ada doesn't. Corporations have this weird thing where they judge entirely based off first impressions. If a language can't get a foothold in X field in the first ten years of its existence, they'll assume it's unsuited to the task forever. Ada saw use in embedded and safety-critical real-time software early on, and as such it got pigeonholed as a language that can only do that, despite being more than capable of, say, doing a web browser. As for Ada vs Rust, Ada is better because it's significantly more mature. I don't dislike Rust per-say, but the whole thing feels like a giant work-in-progress to me.
Joey · 2024-02-03 16:01
This is a dumb little challenge: https://www.morling.dev/blog/one-billion-row-challenge/ I recently joined an Ada forum, and even like it enough to not delete the account I made, which is how I learned about the challenge: https://forum.ada-lang.io/t/a-nice-challenge-for-performance-suckers-the-1-billion-row-challenge-in-ada/ Anyway, here's an implementation thereof I recently finished: http://verisimilitudes.net/2024-01-30 I originally used fixed-point types, but the results were slightly off, because it demands floating-point rounding, which is unfortunate. Besides this, I need to finish another trie library, Less_Trivial_Trie, before I can move on to a Bencoding library, and from there an implementation of uTP and perhaps an entire BitTorrent client. I've not touched the implementation of Pest I started so far in this year. Anyway, what are your current Ada projects?
Sabo Engle · 2024-02-05 07:53
>>37490 >I don't get why Rust has so much momentum currently but Ada doesn't. Online sentiment is going to differ by community more than technical merit. A significant chunk of Ada projects are locked up in SCIFs. Rust advertises as a Hacker's memory safe systems language, so it's natural there's more buzz around Rust than Ada in open source. I'm getting into Rust because it's starting to ossify. Before it would have taken too much attention to keep up. I also personally like the syntax more than Ada and VHDL (throwing that in because I used it a lot more than Ada and they are related).
limited · 2024-02-05 17:06
>>11673 If anyone is interested in an ada project, bootstrapping ada so it can be included in guix would be a big help https://lists.gnu.org/archive/html/guix-devel/2023-07/msg00092.html
The Fin · 2024-04-11 12:42
I've been messing around with Ada a bit, and one of the first things I noticed is just how damn readable the syntax is. It can be a bit verbose at points, and I prefer C-style curly-braces, but overall, I like how it manages to be highly explicit without feeling like you're diving into worthless minutia every time you want to define a variable.
Hopper · 2024-04-11 19:04
>>38797 Also, how big is Ada in terms of usage, and how much has Rust cut into that usage?
Irvise · 2024-05-28 23:03
Hi all, maybe some of you may find it interesting. The Ada Developers Workshop[1], taking place on the 14th of June, will allow for FREE online participation. If you would like to participate, feel free to sign up! Registration is still required. However, the recordings will be made available for everyone at a later date! [1] https://www.ada-europe.org/conference2024/adadev.html >>38803 Ada is not big at all... However, the people that have been using Ada for the past few decades, still use it. No other language can substitute the clarity, correctness and performance that Ada provides. These sectors are transport, military, space, etc. I would say that Rust has not eaten any of Ada's market as the people who want/need to use Ada, will use it. It has also brought a lot of attention to Ada, as Ada (with SPARK) goes one step further into building reliable software than anybody else (including Rust). We are also seeing new companies (and some _very_ large ones) embracing Ada [2] [3] [4]. [2] https://www.adacore.com/nvidia [3] https://www.adacore.com/papers/nvidia-adoption-of-spark-new-era-in-security-critical-software-development [4] https://www.adacore.com/papers/latencetech-innovating-network-tools
Erik Johansson · 2024-05-31 00:53
>>39219 >FREE online participation I hope they will share videos.
Irvise · 2024-07-18 12:28
>>39243 You asked and we delivered! Here is the playlist with the recordings: https://www.youtube.com/playlist?list=PLlAtvZuAzANYfdpDqoJ4Se-hN7YYYWhiN The AEiC 2024 webpage has still to be updated with the links. However, for the time being you can find the slides here: http://irvise.xyz/AEiC-2024_Ada_Workshop_Slides.zip Cheers and enjoy hacking!
Dujour · 2024-07-18 16:26
In anything where security is concerned wouldn't Ada be a bad choice not because of anything to do with the language just the fact the US government for a long time has been using it so they likely have some of the best programmers out there who can spot security holes better than most?
Mentat · 2024-07-22 01:15
>>39618 Thanks comrade, now I need VPN to download those.
Irvise · 2024-07-24 13:44
>>39649 Feel free to use my webpage :) https://irvise.xyz/Ironclad.mp4 https://irvise.xyz/Ada-Community-Advocacy.mp4 https://irvise.xyz/Ada-Time.mp4 https://irvise.xyz/Alire-2.mp4 https://irvise.xyz/Avoiding-Access-Types.mp4 https://irvise.xyz/Controlled-IO.mp4 https://irvise.xyz/G-NAV.mp4 https://irvise.xyz/HiRTOS.mp4 https://irvise.xyz/SweetAda.mp4 Happy hacking comrade
Frank Garza · 2024-07-27 01:51
>>39674 Noice. Big thanks man.
Faye Valentine · 2024-09-05 11:41
>>38281 Discussion seems to have died for more than a year now, and the only ones interested in it are the coreboot folks. The latest info we have is that GNAT was bootstrapped from a Ada83 compiler, but nobody has the source code.
Irvise · 2024-11-06 12:11
Hi Lain, just as a heads up, there will be an Ada devroom @ FOSDEM! https://fosdem.org/2025/schedule/track/ada/ I will be there, as I am part of the organisation team. If you come to FOSDEM, feel free to say hi! I also hope to get quite a few nice and fresh Ada talks for you to also enjoy. >>39928 I agree that things have stalled, however, we are still here! Currently, the worst part of bootstrapping Ada is the absurd lack of time that we have... But we will keep on going at it :)
dup · 2025-01-30 01:03
woah, finally, a thread about my new favourite language. I do have just one question: when i try to run pretty much any ada program that could print out integers (eg, fizzbuzz), it prints them out with this weird formatting. Pic rel. Does anyone know what i'm doing wrong?
Cowboy · 2025-01-31 11:53
>>41074 I don't really know Ada and I'm not in the position to try this out, but that looks like it might be reserving space for the whole range of the integer type and then printing whitespace instead of leading zeroes. What happens if you try printing with Put(i'Image)?
Batou · 2025-02-01 03:03
>>41080 thanks lain, that works perfectly. >>40357 I can't wait until tomorrow...
Irvise · 2025-02-04 13:46
>>41074 As >>41080 said, if you use the numeric printing procedures, you will get a very nicely formatted output which saves space for all possible symbols the number may have. And yes, I said symbols, which include all potential digits and the optional minus sing! Hope you enjoy the language! We hope to get the FOSDEM Ada Devroom videos published in the next few days for everybody to enjoy! Best regards, Irvise
Motoko Kusanagi · 2025-02-04 16:17
>>41106 Thakns Irvise, After reading the docs a bit more, I discovered that you can just pass *Integer_Text_IO.Put the width argument like so: ada Ada.Integer_Text_IO.Put(126, Width => 3); And I managed to catch the Ada Devroom live, it was great! So many cool projects and interesting talks.
Undisclosed · 2025-02-07 08:02
>>41107 (unrelated comment) thanks for the wallpaper lainon!!!