Announcement

Collapse
No announcement yet.

Ada Gets Promoted To Being A First-Class Language In Coreboot

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

  • Ada Gets Promoted To Being A First-Class Language In Coreboot

    Phoronix: Ada Gets Promoted To Being A First-Class Language In Coreboot

    Coreboot has mainlined a months-old patch to make the Ada programming language "a first class citizen" in this low-level open-source project...

    http://www.phoronix.com/scan.php?pag...ot-First-Class

  • #2
    What safety critical features does Ada have that other languages don't?

    Is the type safety any stronger than in other languages?

    Comment


    • #3
      Originally posted by uid313 View Post
      What safety critical features does Ada have that other languages don't?

      Is the type safety any stronger than in other languages?
      It's stronger than C and C++, but it's not stronger than Rust, which is easier to get support/talent for.

      Comment


      • #4
        Originally posted by mmstick View Post

        It's (type safety) stronger than C and C++, but it's not stronger than Rust, which is easier to get support/talent for.
        I'd like to disagree. In Rust, there are signed and unsigned integers according to machine properties (i32, u8, etc). I do not know whether there is automatic conversion from one to the other.
        In Ada, you declare your numbers (integer (signed, unsigned), float, fixed) according to your needs and let the compiler figure out the mapping to machine numbers.

        For instance: I need an integer number (e.g. as an array index) in the range from -10 to 42.

        type Index is range -10 .. 42;

        Further I need an integer to count something:

        type Count is range 0 .. Integer'Last; -- never negative

        Then variables of type Count and Index are of different types and cannot be mixed in an expression. You need explicit conversion for this, and you get an exception if the value to be converted does not fit into the target type.

        Comment


        • #5
          Originally posted by mmstick View Post

          It's stronger than C and C++, but it's not stronger than Rust, which is easier to get support/talent for.
          Nah. Rust is about fast and safe programming, allows unsafe blocks.
          Ada(SPARK) is used to write safety-critical software, has formal verification tools etc.

          Comment


          • #6
            Originally posted by log0 View Post

            Nah. Rust is about fast and safe programming, allows unsafe blocks.
            Ada(SPARK) is used to write safety-critical software, has formal verification tools etc.
            Unsafe blocks doesn't infer unsafe code. Safety checks still occur in unsafe blocks. Unsafe blocks are therefore still safer than C and C++.
            Rust is also used to write safety-critical software and includes 'formal verification tools' as well.

            Comment


            • #7
              Originally posted by Christoph Grein View Post

              I'd like to disagree. In Rust, there are signed and unsigned integers according to machine properties (i32, u8, etc). I do not know whether there is automatic conversion from one to the other.
              In Ada, you declare your numbers (integer (signed, unsigned), float, fixed) according to your needs and let the compiler figure out the mapping to machine numbers.

              For instance: I need an integer number (e.g. as an array index) in the range from -10 to 42.

              type Index is range -10 .. 42;

              Further I need an integer to count something:

              type Count is range 0 .. Integer'Last; -- never negative

              Then variables of type Count and Index are of different types and cannot be mixed in an expression. You need explicit conversion for this, and you get an exception if the value to be converted does not fit into the target type.
              I'm not sure what the point is that you are trying to make. It's not even remotely related to my comment which you quoted.

              Comment


              • #8
                Originally posted by mmstick View Post

                I'm not sure what the point is that you are trying to make. It's not even remotely related to my comment which you quoted.
                He's saying that Ada's compile-time checks aren't weaker than Rusts but merely different. The example he gives involves constraining the valid range of a value, which Rust can't do. (However, it IS possible to use Rust's type system to assign units to numbers, which can't be mixed without explicit conversion. Servo uses that within its CSS engine.)

                As for the "let the compiler figure out the mapping to machine numbers" part, the whole point of Rust is to combine performance equal to or better than C++ with strong safety guarantees.

                The Rust community sees abstracting away the number type's underlying representation as being of the same "already got more than enough languages that do that" bent as garbage collection. (In fact, /r/rust just recently had an article shared about a research language which goes the other way, baking in annotations that enable better CPU cache optimizations by letting the programmer indicate when functions are accessing data in a sparse fashion.)

                Comment


                • #9
                  It's about time that Ada got supported by coreboot - Ada is well suited for close to hardware applications.
                  Is somebody able to point out which languages are "First-Class" languages on coreboot? My search only brought up C as other language, and C++ by implication. Is rust "first class" at all on coreboot?

                  Comment


                  • #10
                    Originally posted by lowflyer View Post
                    It's about time that Ada got supported by coreboot - Ada is well suited for close to hardware applications.
                    Is somebody able to point out which languages are "First-Class" languages on coreboot? My search only brought up C as other language, and C++ by implication. Is rust "first class" at all on coreboot?
                    That would be very interesting to know!

                    Comment

                    Working...
                    X