Announcement

Collapse
No announcement yet.

Rust Core Team + Mozilla To Create A Rust Foundation

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

  • Rust Core Team + Mozilla To Create A Rust Foundation

    Phoronix: Rust Core Team + Mozilla To Create A Rust Foundation

    Given the uncertainty created by Mozilla laying off roughly a quarter of their staff last week that did include some Rust developers and in looking to further along the Rust ecosystem in its own right, the Rust core developers in cooperation with Mozilla are working to form the Rust Foundation...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Rust is pretty cool. It is a different beast, it is low level like C and C++ but provides zero-cost abstractions and features more commonly found in higher level languages such as foreach loops, generics, iterators, async and more. In C you only have a for loop, you don't have any foreach loop.

    Rust doesn't have classes, interfaces and abstract base classes, but it does have structs (which are like classes) and traits (which are kind of like interfaces, but perhaps more like abstract base classes, but different). In Rust you implement each trait (which is like an interface or abstract base class) in its own code block independent from the struct (which is like a class). You can do some things that are not possible in other languages, like have functions that accept an argument that implements two traits, so then it only accepts the argument if it implements both traits.

    By implementing a trait on an existing struct you can extend that struct, kind of like prototypes in JavaScript.

    You can also have use generics with traits (kind of like a generic interface) that conditionally implements methods depending on what trait the generic type uses.

    I don't know how practical these things are in the real world since I've never missed them in all my years of coding OOP, but its pretty interesting nonetheless that it has some different ideas and approaches.

    The Rust compiler is very helpful and is good at analyzing your code and figuring out what you probably wanted and describing that to you.

    Like C it is a rather difficult language tho, but it helps you by preventing yourself from shooting yourself in the foot. Unlike C which lets you compile stuff that is wrong, Rust is much more picky and will refuse to compile when things are not right.

    Personally I find the module system confusing though, with the "use" and "mod" statements, and how it does includes/imports. I find Java, JavaScript, C#, PHP and even Python much more intuitive.

    Comment


    • #3
      Originally posted by uid313 View Post
      Personally I find the module system confusing though, with the "use" and "mod" statements, and how it does includes/imports. I find Java, JavaScript, C#, PHP and even Python much more intuitive.
      It's pretty similar to python though except for use and mod being two different things while in python it's just import. With Rust 2018 you also no longer need to specify "external crate" so you can literally just use "use" the same way as with pythons "import" for external crates/modules. Otherwise lib.rs is same as __init__.py and main.rs is __main__.py.

      Comment


      • #4
        Originally posted by uid313 View Post
        You can do some things that are not possible in other languages, like have functions that accept an argument that implements two traits, so then it only accepts the argument if it implements both traits.
        You can do something like that in Java. If you have an interface A and another interface B, you can do:
        Code:
        <T extends A & B> void doSomethingWithSomeObjectThatImplementsBoth(T t) { .... }
        The compiler will block you from calling that function with an input parameter that implements just A, just B, or any other combination of interfaces that doesn't include both A and B.

        I'm impressed with Rust too, though I understand the learning curve for working with the borrow checker is a nightmare. I haven't had any issues yet, but I've only been dealing with toy code.

        Comment


        • #5
          Originally posted by uid313 View Post
          Rust is pretty cool. It is a different beast, it is low level like C and C++ but provides zero-cost abstractions and features more commonly found in higher level languages such as foreach loops, generics, iterators, async and more. In C you only have a for loop, you don't have any foreach loop.
          A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.


          C++ has extended for to support foreach usagle since nearly a decade....

          It's just declare an array of type

          type array[] = {1 , 2, 3, 4};
          for ( type x : array)
          cout<<x<<endl;

          Comment


          • #6
            Originally posted by uid313 View Post
            Rust is pretty cool. It is a different beast, it is low level like C and C++ but provides zero-cost abstractions and features more commonly found in higher level languages such as foreach loops, generics, iterators, async and more. In C you only have a for loop, you don't have any foreach loop.
            I find "low-level" and "high-level" to be confusing terms. It looks to me that they have mostly been stripped of any meaning, or are just being far too vague to compare different languages.
            C++ does have foreach, generics (templates are just that, and C++20 concepts are not unlike Rust traits), iterators, even coroutines by now in C++20.
            Borrow checking enforces safety that is not just useful to have a memory-safe program without a GC but also to have a safe program. That would be a "high-level" language feature. But then you have unsafe, which would be "low-level".
            Dunno, I may be missing something.
            Maybe these words made more sense in a world where anything that wasn't close to assembly was being called high-level, C included.
            I mean, even in C#, you can do reasonably "low-level" stuff (and some stuff like "struct" have no other reason to exist than performance).

            Comment


            • #7
              Originally posted by Phoronix
              Mozilla Laying Off Around A Quarter Of Their Employees
              Originally posted by Rust-Lang
              Laying the foundation for Rust's future
              Ironic

              Comment


              • #8
                Originally posted by AsuMagic View Post
                I find "low-level" and "high-level" to be confusing terms. It looks to me that they have mostly been stripped of any meaning, or are just being far too vague to compare different languages.
                C++ does have foreach, generics (templates are just that, and C++20 concepts are not unlike Rust traits), iterators, even coroutines by now in C++20.
                Borrow checking enforces safety that is not just useful to have a memory-safe program without a GC but also to have a safe program. That would be a "high-level" language feature. But then you have unsafe, which would be "low-level".
                Dunno, I may be missing something.
                Maybe these words made more sense in a world where anything that wasn't close to assembly was being called high-level, C included.
                I mean, even in C#, you can do reasonably "low-level" stuff (and some stuff like "struct" have no other reason to exist than performance).
                Here's how I see it - low-level to some degree is a euphemism for untyped/unsafe.

                C is really bad in this respect. While for simple programs C is type safe, as soon as you have a complex project, you end up doing the following:

                1. Pass around void* pointers, and cast them back into something useful - shitty way of implementing polymorphism. The language doesn't have a clean way of doing a generic hashtable ... ffs.

                2. Big switch cases with casts.

                Neither is type safe.

                C++ is a lot better in this respect (you can do far safer versions of #1 and #2), but unfortunately it is still based on C.

                Rust can do low level stuff while being safe ...

                Comment


                • #9
                  It is unfortunate that it took the layoffs to push the work of creation of a new foundation towards the top of the queue, but an independent foundation is a necessary step to insure that the larger Rust community process does not end up getting bogged down in the next Mozilla organizational adjustment (and I have a hard time believing there will not be another). Rust will survive, for it has achieved sufficient mind and market share, and it is time for Mozilla to set it free.

                  Comment


                  • #10
                    I'd feel a lot better if they where going to be a german "eingetragener Verein", compared to a foundation / something U.S. of A. based. But meh.

                    Comment

                    Working...
                    X