Announcement

Collapse
No announcement yet.

Linux Developers May Discuss Allowing Rust Code Within The Kernel

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

  • #61
    Originally posted by HadrienG View Post
    auto's type deduction is limited, and assumes that the compiler will have enough context to figure out the right variable type from the right hand side of a variable declaration alone. It breaks down in more complex cases, such as when you declare a variable without initializing it right away (as is common with arrays), or more generally when a variable's type is defined by how this variable is used later on (very convenient, but basically impossible to support in a language with function overloading).
    When auto is not enough sure compiler error will tell me to use a proper type. But I don't want a let keyword, at all. It is just so last century.
    Also even auto is not necessary to me when type can be inferred. Just use var = foo(), why it is not good enough?

    A variable type to be used later? Just do an implicit or explicit cast when it is used. A variable is for expressing the right type at the right time.

    Comment


    • #62
      These new languages have so many advanced features...
      But do they have features advanced enough to restrict use of advanced features?

      Comment


      • #63
        Rust sucks because its syntax is shit, too.

        Originally posted by goTouch View Post
        When auto is not enough sure compiler error will tell me to use a proper type. But I don't want a let keyword, at all. It is just so last century.
        Exactly.

        Originally posted by goTouch View Post
        Also even auto is not necessary to me when type can be inferred. Just use var = foo(), why it is not good enough?
        Because that assigns a value to a pre-existing variable, and doesn't declare a new variable. auto is perfectly fine and even makes sense: the type is automatic.

        You can always use an explicit type and not have to type auto, unlike the 'let' crap (which also sounds dumb).

        Comment


        • #64
          Originally posted by Weasel View Post
          Rust sucks because its syntax is shit, too.

          Exactly.

          Because that assigns a value to a pre-existing variable, and doesn't declare a new variable. auto is perfectly fine and even makes sense: the type is automatic.

          You can always use an explicit type and not have to type auto, unlike the 'let' crap (which also sounds dumb).
          Well, compiler always creates new variables on stack whenever needed at runtime. It really doesn't matter if the assignment is to a "new" or "pre-existing" variable. Compiler just decrease stack base pointer and gives you a new variable. The "define-then-use" syntax is solely to avoid human mistake to misspell variable names. But now compiler is able to detect uninitialized variable anyways. If a variable name is misspelled when you use it, it will either be detected as uninitialized, or happens to match another existing variable name and cause undetectable runtime error.

          Comment


          • #65
            I can't wait for a modular CPU scheduler written in Kotlin, that loads scripts as modules from some directory in the filesystem. Then you'd be able to extend your CPU scheduler by just adding modules to it, maybe writing them as simple bash scripts or whatever. Heck you could even consume some RESTful webservice from your scripts!

            Actually we could have something more: a pluggable kernel where userspace can attach hooks to almost any kernel function by means of writing a script path to a number of /sys/ magic files. It would render kernel development as easy as Python scripting...

            Comment


            • #66
              Originally posted by RahulSundaram View Post

              Rust is about to be 10 years old and it provides more than just wishes and assumptions. It is designed to provably eliminate entire classes of bugs and successfully does so. You seem to think it is used by just Mozilla in a major way and that is just not true for several years now. Linus and other kernel developers have already said they are open to new languages being used and perhaps you missed that as well


              Writing Linux Kernel Modules in Safe Rust - Geoffrey Thomas, Two Sigma Investments & Alex Gaynor, AlloyWith 65% of recent Linux kernel vulnerabilities being ...

              This week saw a special virtual edition of the Linux Foundation's annual Open Source Summit and Embedded Linux Conference North America, which had originally been scheduled to take place in Austin, Texas.



              Ok, this one is on me, let me clarify when we old timers say "Hot New Thing" we don't mean it as "LOL, is 6 months old" but more like "is the thing everyone is excited about but no one who matter uses it yet, so is a lot of wishes for now".

              I was clear here, i don't give a damn about 1000 github projects that are hardly used, Mozilla is the only big respected project using it atm, in the same way D was the previous "It will Fix C and be the future" but only Dtrace uses it at the time and today 20 years later no one who matter uses it but it have lots of github projects as well.

              Rust is not the only language that has promised those designs pattern and made bombastic claims and i don't doubt they are fairly well though through but i don;t trust design and concepts in theory, when Rust have at least 10 major projects in at least few different fields and have actually been battle tested those claims then we are talking.

              Well, in all honestly everyone is open to new languages, the point of inflection is "is worth the effort?" and that is where Rust and D have a hard time because sure if you are a semi decent C dev writing a lot of crap code either of those will let you write crap code safely-ish but for a veteran C dev(that may have missed few pointers here and there cuz he is human) is a lot less expensive to simply fix the C code. This is the language killing zone

              Comment


              • #67
                A language safer-to-use is still better than C/C++ if efficiency is on par. The key to its success is: backed by several big companies, and start teaching it in every college. The benefit in the long run is obvious. We could avoid creating so many slow website with bloated .Net, java, javascript, python, blahblah.

                Rust is one of the more promising candidates here.

                Comment


                • #68
                  Originally posted by jrch2k8 View Post

                  Ok, this one is on me, let me clarify when we old timers say "Hot New Thing" we don't mean it as "LOL, is 6 months old" but more like "is the thing everyone is excited about but no one who matter uses it yet, so is a lot of wishes for now".

                  I was clear here, i don't give a damn about 1000 github projects that are hardly used, Mozilla is the only big respected project using it atm,
                  This is just categorically not true though. We are not talking about random github projects. I am referring to huge users like Discord, Chef, Dropbox, Coursera, Wire, CoreOS, Stratis storage and that's just off the top of my head. There is plenty more if you do some cursory searches on this

                  Comment


                  • #69
                    Originally posted by jrch2k8 View Post

                    ...in the same way D was the previous "It will Fix C and be the future" but only Dtrace uses it at the time and today 20 years later no one who matter uses it but it have lots of github projects as well.
                    I skipped over this originally but it is worth pointing out that Dtrace is NOT written in D. D in that doesn't indicate the language used. It stands for Dynamic. It has always been written in C simply because it was part of the kernel code. You maybe confusing it because the scripting type of language written using DTrace itself is called D. This isn't intended to have any adoption outside of Dtrace itself. There is another language called D which was intended to a replacement for C++ but never gained any real traction. The adoption rate of D and Rust are not comparable in any way. If you want to compare that, you have to do it against other recent languages with much higher adoption rates like say Go or Swift.
                    Last edited by RahulSundaram; 10 July 2020, 02:23 PM.

                    Comment


                    • #70
                      It is very unusual watching someone at GUgl promoting someone else tool, especially from Mozilla... I think it will be refused, Rust is also a trademark, and Linus has always annoying itches when is facing controversial and potential license issues...

                      Comment

                      Working...
                      X