• Ada vs. Rust for low level system software

    From Nasser M. Abbasi@21:1/5 to All on Tue Dec 12 22:28:40 2023
    Has anyone made study of difference between Rust and Ada for low level hardware system software?

    Since Ada is mainly used in this area, why has Rust, which is much
    younger language, and target this same area has gained so much
    popularity but not Ada?

    https://dl.acm.org/doi/fullHtml/10.1145/3551349.3559494

    "Rust is a rising programming language designed to build system
    software [4, 10, 20]. On the one hand, Rust offers access to and control
    of the low-level system resources. On the other hand,
    unlike conventional systems programming languages, Rust
    ensures memory and concurrency safety"

    "Rust often inserts bound checks at the execution time to rule
    out out-of-bound accesses"

    Well, does not Ada also "ensures memory and concurrency safety"
    and checks for out-of-bound accesses?

    I am just wondering what does Rust brings to the table that
    Ada does not have and why is Rust becoming so popular when
    Ada is not.

    I never used Rust myself, but used Ada.

    Any one done study comparing the two languages or knows
    both that can give some comments on this?

    --Nasser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Nasser M. Abbasi on Wed Dec 13 09:27:34 2023
    On 2023-12-13 05:28, Nasser M. Abbasi wrote:
    Has anyone made study of difference between Rust and Ada for low level hardware
    system software?

    What for? Any language comparisons lost their meaning long ago as the
    whole language business degraded into hobbyist/corporate bullshit.

    Since Ada is mainly used in this area, why has Rust, which is much
    younger language, and target this same area has gained so much
    popularity but not Ada?

    Because it is always someone's arbitrary decision.

    https://dl.acm.org/doi/fullHtml/10.1145/3551349.3559494

    "Rust is a rising programming language designed to build system
    software [4, 10, 20]. On the one hand, Rust offers access to and control
    of the low-level system resources. On the other hand,
    unlike conventional systems programming languages, Rust
    ensures memory and concurrency safety"

    "Rust often inserts bound checks at the execution time to rule
    out out-of-bound accesses"

    Well, does not Ada also "ensures memory and concurrency safety"
    and checks for out-of-bound accesses?

    I am just wondering what does Rust brings to the table that
    Ada does not have and why is Rust becoming so popular when
    Ada is not.

    In my view Rust brings nothing and moreover is a huge step back
    comparing to Ada. Its main and only idea is to force the programmer to explicitly manage memory through references where Ada simply uses object notation regardless the mechanism doing same under the hood.

    Safety comes not through references but by limiting the number of cases
    you must resort to using dynamic allocation for statically scoped
    objects. E.g. Unbounded_String in Ada.

    As for my major concern - the type system and the abstraction mechanisms
    in general, there is nothing in Rust at all.

    Then of course Rust continues the worst practices tried by Ada and C++: templates/generics, macros.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luke A. Guest@21:1/5 to Dmitry A. Kazakov on Wed Dec 13 09:10:20 2023
    On 13/12/2023 08:27, Dmitry A. Kazakov wrote:

    What for? Any language comparisons lost their meaning long ago as the
    whole language business degraded into hobbyist/corporate bullshit.

    True.

    Since Ada is mainly used in this area, why has Rust, which is much
    younger language, and target this same area has gained so much
    popularity but not Ada?

    I would say because they aimed to be a C++ replacement.

    Because it is always someone's arbitrary decision.

    True.

    Then of course Rust continues the worst practices tried by Ada and C++: templates/generics, macros.

    What's the alternative to generics?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeffrey R.Carter@21:1/5 to Nasser M. Abbasi on Wed Dec 13 09:44:34 2023
    On 2023-12-13 05:28, Nasser M. Abbasi wrote:
    Has anyone made study of difference between Rust and Ada for low level hardware
    system software?

    You might be interested in this discussion:

    https://www.reddit.com/r/ada/comments/18c2nr4/where_is_ada_safer_than_rust/

    --
    Jeff Carter
    "I used to manufacture escalator shoes for people
    who were nauseous in elevator shoes."
    Take the Money and Run
    142

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Luke A. Guest on Wed Dec 13 10:53:28 2023
    On 2023-12-13 10:10, Luke A. Guest wrote:
    On 13/12/2023 08:27, Dmitry A. Kazakov wrote:

    Then of course Rust continues the worst practices tried by Ada and
    C++: templates/generics, macros.

    What's the alternative to generics?

    The question is what is the alternative to static/parametric
    polymorphism. The answer is dynamic polymorphism.

    1. Dynamic polymorphism in Ada is as static as generics are. No run-time penalty unlikely to C++.

    2. It covers cases generics do not, e.g. you can have class-wide
    run-time objects and proper class-wide subprograms.

    3. It supports modular programming en large. E.g. you can put a class
    member in a dynamically linked library.

    4. It is fully testable. Generics are fundamentally non-testable, only
    concrete instances are.

    5. It is does not create a meta language layer with complexities for the compiler and programmer. Advanced generic code is close to unmaintainable.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kevin Chadwick@21:1/5 to All on Mon Dec 18 12:52:08 2023
    Since Ada is mainly used in this area, why has Rust, which is much
    younger language, and target this same area has gained so much
    popularity but not Ada?


    Adas ranged type system coupled with it's excellent record overlays make Ada
    a much better choice than Rust. For safe and easy hardware register and
    network protocols.

    I can't imagine that ownership for data structures on a single runtime is
    the reason (before SPARK got support).

    A lot of Ada code will not run on any runtime but Rust also has nostd for
    embedded use.

    They often say Rust has excellent C interfacing support but Adas appears to
    be even better.

    Perhaps it is ease of use and guide availability which has improved or
    simply perception and a lack of knowledge about Ada.

    Rather than language merits. A lot of people only care about job
    availabilty, money and library availability today but might consider a risk
    if they perceive a future demand increase.

    As to why the likes of Google and Microsoft are putting money behind it when
    Ada would have been a better investment. You would have to ask them. Tell
    me why Google continues to write security sensitive code like matter in
    C++? When it could be written in Ada or Rust with a C binding.

    Even javascript engines like Mozillas spidermonkey still has so little Rust
    code. Though Mozilla does have more financial concerns and it's competitors
    are already trying to say their browsers are faster. Yet Googles websites
    use umpteen domains slowing browsing down anyway.

    --
    Regards, Kc

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)