Announcement

Collapse
No announcement yet.

Ada++ Wants To Make The Ada Programming Language More Accessible

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by uid313 View Post

    Thank you!

    The hyperlinks you provided were insightful. I never realized these operators were so bad.
    It would be OK if it were limited to stand-alone increment statements and disallowed in compound expressions. This is restrictive, but it would allow idioms such as incrementing the value if an index variable in a for-loop, so it would still be useful.

    Comment


    • #32
      Originally posted by wizard69 View Post
      It is too bad that ADA never really caught on outside of the aircraft and missile industries.
      outside of government contracts
      Originally posted by wizard69 View Post
      So much potential that has gone unused for years now
      what potential?

      Comment


      • #33
        Originally posted by jacob View Post
        Of course if network services, among others, were written in Ada instead of C, we would have much less security problems and the Internet would be a lot better place, but it's too late for that now.
        or we wouldn't have internet at all(where are all those network services written in ada?)
        Originally posted by jacob View Post
        The ecosystem (FOSS included) has moved on and none of the tooling, frameworks, runtimes etc. are Ada-friendly.

        Since it looks like Rust now has all the momentum for safety or security-critical code,
        umm, wasn't that java? btw, why lack of ecosystem is problem only for ada, but not for rust?
        Originally posted by jacob View Post
        maybe the best way forward would be for it to incorporate those useful features from Ada that it's currently missing, mainly first class support for range types, generic modules and custom memory allocation (getting there with the placement operator?).
        why not incorporate features into language in which all those network services are already written instead?

        Comment


        • #34
          Originally posted by pkunk View Post
          It is actually dangerous, hard to understand and weird:
          it's trivial and no more dangerous than its manual replacement
          no different from manual replacement
          Originally posted by pkunk View Post
          The analyzer detected an expression leading to undefined behavior. A variable is used several times between two sequence points while its value is changing. We cannot predict the result of such an...
          no different from manual replacement
          probably like everywhere in rust, argumentation is pure garbage. proposed replacements have exactly same downsides ("require knowledge of evaluation order, and often lead to subtle bugs and undefined behavior in C and C++"). does rust have anything but bullshit propaganda?
          only first and third points have any substance. first is laughable, third is swift-specific
          Last edited by pal666; 04 April 2020, 08:51 PM.

          Comment


          • #35
            Originally posted by pal666 View Post
            or we wouldn't have internet at all(where are all those network services written in ada?)
            Nowhere of course. Ada would have been a much better language than C to write internet-exposed code (I'm thinking DNS resolvers, firewalls etc.) but it was not meant to be. Today Rust seems on track to succeed there though.

            Originally posted by pal666 View Post
            umm, wasn't that java? btw, why lack of ecosystem is problem only for ada, but not for rust?
            No it wasn't Java. Java is used for application services (Web Service APIs etc.), that's not what I was referring to, but also Java is not a particularly good language for that sort of thing either. Ada's ecosystem problem started virtually on day 1. It took the "defined by specification" approach way too literally and too stringently. It's a gigantic and complex language and the name Ada itself was made a trademark to ensure that only products that passed validation could use it. In other words you weren't and sill aren't allowed to call something an Ada compiler unless it implements the whole spec, noting but the spec, and is validated as such. As a result, until GNAT arrived, compilers were rare and very expensive and it was impossible for enthusiasts and hobbyists to start playing with Ada or for other than government contractors with deep pockets to develop in Ada. so the language never really found any uptake outside of its niche of RT applications in aerospace.

            Rust doesn't have an ecosystem problem.

            Originally posted by pal666 View Post
            why not incorporate features into language in which all those network services are already written instead?
            Because whether you take Java, C++, C# or any other such language, you can't "incorporate" Rust's or Ada's features into it without turning it into something it's not, and breaking all compatibility with its own ecosystem. C++'s appeal for example is the wealth of libraries and tools that exist for it, nobody will want to sacrifice that in order to become a worse Rust.

            Comment


            • #36
              If this is their understanding of the C/C++ binary operators, then I have no faith in their project whatsoever:

              The difference is that && and || are short-circuit operators, which evaluate terms only as necessary, and & and | will unconditionally evaluate all terms.
              That quote is straight from their tutorial page .

              Anyone who has written more than two C programs knows that the & and | operators are binary AND and OR operators, not logical operators. And && and || are the logical AND and OR operators. The result of (1&2) is 0, whereas the result of (1&&2) is true. The result of (1|2) is 3, the result of (1||2) is true.

              Sheesh!

              Comment


              • #37
                The problem with Ada is not that scope delimiters are spelled "begins" and "end" instead of "{" and "}". The problem is that its requires an entire replacement of OS userspace runtime. See, most modern programming languages leverage the C-language OS userspace runtime (libc.so, MSVCRT.DLL, etc). Ada does not, which means someone has to write and maintain one for each and every OS out there. Without that, applications are not portable and without portability, you aren't going to have widespread adoption.

                The C runtime is usually offered by the OS developer -- Microsoft and Apple offer their own C runtime for their OSes, GNU offers one for GNU/Linux and Google offers one for Android/Linux. Heck, Microsoft offers one for WSL, which could also be described as GNU/Windows. Who develops and maintains the Ada equivalent for those popular OSes? In each case, some organization is investing a lot of resources into developing and maintaining the C-language OS userspace runtime, and interestingly they distribute it for free with their OS.

                You'll find the Go programming language is in a similar situation, except that Google invests in providing the Go runtime for a select few OSes. Again, the OS userspace runtime is distributed for free by the developer, this time with a free distribution of the language.

                Comes along Ada, and the only people that develop the language runtime charge an arm and a leg in license fees and distribute under very restrictive commercial conditions. The only free alternative is the GNU gnat system, and it's hardly accessible or up to date with the latest kernel changes. It is no mystery why few developers choose Ada as their development environment and that mystery is not that it doesn't look enough like C.

                Comment


                • #38
                  Originally posted by usta View Post
                  As far as i know, in C++ it came with C++11 , Still in both of them they are optional and still some older compilers exist which devs need to keep their code more compatible.
                  I am still waiting that c and c++ 's 2020's standard became available and all new compiler sets them as default. But it looks like it will take about 10 more years to see that
                  The <stdint.h> header and its contents were mandated by C99, and when the C base of C++ was made C99 by C++, <cstdint> has been mandated since C++11.

                  In other words, the various fixed-width integer types have been mandatory parts of the C language for 21 years, and of the C++ language for 9 years.

                  If you depend on a compiler more than 21 years old for your target, it's unlikely you're worried about portability. On the other hand, pretty much everything in C++20 is implemented in the big three compilers as extensions before being accepted into the standard (by policy of the standards committee), so you'll find any new features available the day the standard is published. C21 not so much because Microsoft has yet to provide a C99 compiler, but the other guys are on top of things.

                  Comment


                  • #39
                    Originally posted by bregma View Post
                    The problem with Ada is not that scope delimiters are spelled "begins" and "end" instead of "{" and "}". The problem is that its requires an entire replacement of OS userspace runtime. See, most modern programming languages leverage the C-language OS userspace runtime (libc.so, MSVCRT.DLL, etc). Ada does not, which means someone has to write and maintain one for each and every OS out there. Without that, applications are not portable and without portability, you aren't going to have widespread adoption.

                    The C runtime is usually offered by the OS developer -- Microsoft and Apple offer their own C runtime for their OSes, GNU offers one for GNU/Linux and Google offers one for Android/Linux. Heck, Microsoft offers one for WSL, which could also be described as GNU/Windows. Who develops and maintains the Ada equivalent for those popular OSes? In each case, some organization is investing a lot of resources into developing and maintaining the C-language OS userspace runtime, and interestingly they distribute it for free with their OS.
                    Ada has a runtime, like C++ has its Standard Library (libstdc++), and this is often compiler vendors that provide them. This runtime library provides bindings for a lot of basic features (text output, file manipulation, numeric operations, containers, sockets, etc.) and relies largely on the C runtime (libc). Ada runtime's packages are sort of high-level bindings of lib C features for most of them. Therefore it's as portable as C. Now if some system functions are missing, you can create your own bindings (or for using non-Ada libraries). The language allows that and tools exist to help generating Ada bindings from other languages.

                    Originally posted by bregma View Post
                    You'll find the Go programming language is in a similar situation, except that Google invests in providing the Go runtime for a select few OSes. Again, the OS userspace runtime is distributed for free by the developer, this time with a free distribution of the language.

                    Comes along Ada, and the only people that develop the language runtime charge an arm and a leg in license fees and distribute under very restrictive commercial conditions. The only free alternative is the GNU gnat system, and it's hardly accessible or up to date with the latest kernel changes. It is no mystery why few developers choose Ada as their development environment and that mystery is not that it doesn't look enough like C.
                    The Ada runtime is provided by compiler vendors such as AdaCore which develops GNAT, a GCC front-end for Ada. The compiler is available in two licenses:
                    - GNAT Pro, the paid commercial version (note that you pay development licenses, not runtime licenses) which allows you to do what you want commercially speaking.
                    - GNAT Community Edition, for free and under GPL (same compiler, but less tools and no support). If you link with this runtime, your software will be tainted by GPL. If you already do free software (GPL), that's not an issue.

                    There's a third distribution of GNAT which is the GNU's GCC one. GNAT being a GCC front-end, AdaCore synchronizes with the GCC project once a year. They take latest changes from GCC, and they commit their Ada changes to GCC. And this distribution has a special license, the "GNAT Modified General Public License", which is the GPL with the exception of allowing to link with the runtime without being tainted by the GPL. So you can do proprietary software with this version. And it is available in most distributions that package GCC (debian, fedora, raspbian, cygwin, ...).

                    The three versions contain the same software (compiler and runtime), but vary in license terms and the GNU's version can lag by one year compared to AdaCore's versions (but one can live with that).

                    There are other Ada compilers but I don't know them, so I won't talk about them. GNAT already covers a lot of hardware targets.

                    Comment


                    • #40
                      Originally posted by phuclv View Post

                      It's only dangerous when it returns an lvalue. If it returns nothing then we can just use i++ alone in a single line and no problem would occur
                      I'll also say it's dangerous. Your example is fine but that's not how it ends up being used. From my experience, people want to stuff as much convoluted crap onto a single line that they can. A lot of people don't have the concept of making "maintainable" or "readable" code I've come to learn. That's apparently not something taught in schools or something that people pick up along the way somehow (along with things like git, basic code design, code documentation, file organization, common concepts such as networking, using the right container for the right situation, and so on). Forcing people to do the right thing is something I'm learning is a good thing because it potentially means less garbage I have to dive through myself in the long-run.

                      EDIT: As a side-note, Rust removes operator altogether, which I'm an avid fan of: https://github.com/dtolnay/rust-faq#...ment-operators

                      Comment

                      Working...
                      X