Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Monday July 13 2020, @08:41PM   Printer-friendly

Linus Torvalds' Initial Comment On Rust Code Prospects Within The Linux Kernel

Kernel developers appear to be eager to debate the merits of potentially allowing Rust code within the Linux kernel. Linus Torvalds himself has made some initial remarks on the topic ahead of the Linux Plumbers 2020 conference where the matter will be discussed at length.

[...] Linus Torvalds chimed in though with his own opinion on the matter. Linus commented that he would like it to be effectively enabled by default to ensure there is widespread testing and not any isolated usage where developers then may do "crazy" things. He isn't calling for Rust to be a requirement for the kernel but rather if the Rust compiler is detected on the system, Kconfig would enable the Rust support and go ahead in building any hypothetical Rust kernel code in order to see it's properly built at least.

Linus Torvalds Wishes Intel's AVX-512 A Painful Death

According to a mailing list post spotted by Phoronix, Linux creator Linus Torvalds has shared his strong views on the AVX-512 instruction set. The discussion arose as a result of recent news that Intel's upcoming Alder Lake processors reportedly lack support for AVX-512.

Torvalds' advice to Intel is to focus on things that matter instead of wasting resources on new instruction sets, like AVX-512, that he feels aren't beneficial outside the HPC market.

Related: Rust 1.0 Finally Released!
Results of Rust Survey 2016
AVX-512: A "Hidden Gem"?
Linus Torvalds Rejects "Beyond Stupid" Intel Security Patch From Amazon Web Services


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Insightful) by DannyB on Monday July 13 2020, @10:11PM (2 children)

    by DannyB (5839) Subscriber Badge on Monday July 13 2020, @10:11PM (#1020767) Journal

    Why is there a fashion for compilers (and languages) to become ever more complex

    Why do we have dishwashers when we can do dishes by hand?

    Why the noise and complexity of a backhoe when you can quietly dig a long ditch with a shovel.

    Because: human productivity.

    Compilers and languages have gotten more complex for the last sixty years. For that reason. To make humans more productive.

    In the last three decades we reached a point where human programming cost exceeds the cost of computers. Thus runtime inefficiency is a net dollars and cents gain if you can program the machine faster.

    Ask anyone (end users, customers, managers, etc), would you rather have your XYZ software delivered six months sooner, or have it be more efficient at runtime? Guess which one they will pick?

    There is also a consideration of languages protecting programmers from themselves. This is a Good Thing. As long as you can deliberately get around it when necessary by telling the compiler "I know what I'm doing". Fact: humans make mistakes.

    Now I'm going to mention Java as an extreme example, which is completely inappropriate when talking about the Linux kernel. But the economic reality is why Java has been the #1 or #2 language for the last 15 years in a row. [youtube.com] Java must be doing something right. GC must be a net economic win. (argument: the threads that service a customer request incur zero cpu cycles of memory management. GC threads on other cores incur that cost -- but not inline with servicing the customer request. The customer request naturally has to make enough money to pay the freight of the GC -- and it does.)

    There are different levels of abstraction, and protecting programmers, for different types of programming work. Writing kernels and microcontroller code is certainly different than business software. But some of these arguments apply about human productivity, economics, eliminating entire classes of bugs automatically if possible, using the compiler as your first line of unit testing. If the code won't even compile, then it fails the first unit test. :-) Letting those errors slide until runtime is simply a lazy approach and means that they might not be found in your unit testing, but will be found by your ultimate customer. I remember in the early 1980s reading about a rocket that was lost due to a type error that would have been a compile error in Pascal. Yes, early 1980s story.

    --
    You can not have fun on the weak days but you can on the weakened.
    Starting Score:    1  point
    Moderation   +1  
       Insightful=2, Overrated=1, Total=3
    Extra 'Insightful' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (Score: 4, Insightful) by turgid on Monday July 13 2020, @10:40PM (1 child)

    by turgid (4318) Subscriber Badge on Monday July 13 2020, @10:40PM (#1020793) Journal

    Compilers and languages have gotten more complex for the last sixty years. For that reason. To make humans more productive.

    My point is that, in my humble opinion, some have got so complex that they have the opposite effect. I have yet to see any "good" C++ code in a commercial setting. There are whole books written on what you shouldn't do when writing C++, for example.

    In the last three decades we reached a point where human programming cost exceeds the cost of computers. Thus runtime inefficiency is a net dollars and cents gain if you can program the machine faster.

    I agree that there are some languages that facilitate this. They tend to be clean, simple, elegant and high-level with a great deal of abstraction. Unfortunately, they tend not to get used much because they're not in fashion like e.g. Java, C++, C# and maybe now Rust.

    There is also a consideration of languages protecting programmers from themselves. This is a Good Thing. As long as you can deliberately get around it when necessary by telling the compiler "I know what I'm doing". Fact: humans make mistakes.

    There is often a lot of hubris involved when someone decides, "I know what I'm doing, and I'm going to ignore what the compiler is trying to tell me." It often ends in tears. If you are having to resort to such bodges, (1) check your understanding of the problem, (2) check your understanding of the language and (3) redesign your solution or (4) choose a better language.

    Java must be doing something right.

    It allows mediocre programmers to get simple programs working in a nice cross-platform sandbox. I use Java every day. It's too wordy. The standard class libraries aren't vert good.

    Letting those errors slide until runtime is simply a lazy approach

    Agreed, but compilers and static analysis can't catch all those bugs. The code has to be executed and made to fail. Branches must be checked. Use cases must be exercised. C++ and Rust and the intel itanics of programming languages. They are enormous, baroque and make magical promises which can never be fulfilled because code must be run.

    For this reason, there has to be a good balance between compile-time safety (good), static analysis (good), unit testing (good) and regression testing (good).

    If the language is so difficult and complex that it's slow to get something through the compiler, people will hack around it. Then you lose 1 and 2. You also don't get around to 3 and 4 until much later, if at all.

    Bugs are expensive the later they are discovered. It's best not to put them in in the first place.

    If your language is big and difficult, and your compiler is big and slow steps 3 and 4 get put off until much later than they should. Some people are so confident in their fancy languages and compilers that they think they don't have to write unit tests!

    There needs to be a healthy balance. Making languages more complex is not the answer. It doesn't work.

    • (Score: 2) by DannyB on Tuesday July 14 2020, @01:57PM

      by DannyB (5839) Subscriber Badge on Tuesday July 14 2020, @01:57PM (#1021228) Journal

      There are whole books written on what you shouldn't do when writing C++, for example.

      Both C and C++ are the kind of languages that I am arguing against not for.

      Unfortunately, they tend not to get used much because they're not in fashion

      It is unfortunate that some good languages never take hold and get the recognition they deserve. I've seen talk about that for a long time and no good solution. Betting on a programming language for a big project is a huge bet. A gigantic risk. It is amusing that the only modern languages to gain any traction are mostly created by corporations. Java, Swift, Rust, C#, Go, Dart.

      There is often a lot of hubris involved when someone decides, "I know what I'm doing, and I'm going to ignore what the compiler is trying to tell me."

      That can be true. I think back to languages like Pascal and Modula 3. It is important for small bits of code that might manipulate the hardware to turn off some features. In Pascal, I remember an example like:
      * Declare a constant, named "memory" that is a pointer to a byte array, and initialized to zero.
      Talk about instant PEEK / POKE. Anywhere you could do: memory^[16384] = 227;
      That is just an example, where if you were writing code to manipulate the hardware of an IBM PC's video display, being able to say "I know what I'm doing" is quite useful and not hubris. Since it's a constant, it doesn't use up a global stack slot as a variable. Once it is initialized, it is "safe" to use anywhere. But you might limit its visibility to a specific "unit" (pascal term) where you are providing an abstraction over some hardware diddling.

      It allows mediocre programmers to get simple programs working in a nice cross-platform sandbox. I use Java every day. It's too wordy. The standard class libraries aren't vert good.

      I use Java every day too. So far as I am able to determine, I have not yet been involuntarily committed to any mental institution. (But even if so, I can't tell, because I wake up every day and program Java.)

      Java has its warts. As do most languages. The things that it does well vastly outweigh the warts. Otherwise nobody would use it.

      The success of Java is an economic argument. And this is what most programmers miss. Programmers think too much in purely technical terms without other considerations. Completely unable to see what drove Java to success. Or why it is so widely used. Especially by huge financial institutions, banks, or other corporate enterprise software. So much so that Microsoft needed to try to steal it.

      The previous paragraph especially applies to garbage collection. People who hate GC don't understand the economic argument. But there are also technical arguments for it. I'm not saying GC should be used everywhere. But for higher level languages used to write applications, I'll let the evolution of languages speak for itself. How many modern high level languages have GC? Python. JavaScript. Go. Visual Basic. Visual FoxPro. Java. C#. Lisp and its variants. Haskell et all. Prolog style languages. Theorem provers. Computer Algebra System languages. I would add any language that runs on the JVM (Kotlin, Scala, Groovy, etc, etc)

      While people argue about languages that manipulate bits and bytes and teeny bits of technical efficiency, and lack of high level abstractions, the high level language users can get things done, much more quickly, and laugh all the way to the bank.

      compilers and static analysis can't catch all those bugs.

      Compilers CAN and DO catch certain types of errors 100%.

      Compilers can NEVER catch certain types of errors, that is 0%.

      A compiler is never going to know that a check should be subtracted, and a receipt should be added to a total. But a compiler can catch an error where you're trying to assign a String to an HtmlString or to an SqlString without going through an "escape" function, because those two string types are incompatible.

      It is important and beneficial that languages and compilers now catch more types of errors than long ago. Entire classes of bugs have been eliminated by language design. I would just point out that GC eliminated three different types of memory bugs that are the scourge of all software that has ever been written in C or C++, and the source of many security problems.

      If your language is big and difficult, and your compiler is big and slow

      You're preaching to the choir.

      Languages need to be small. Comprehensible. Never put something into a language that could go into a "standard library". Follow the "scheme" philosophy more than the "common lisp" philosophy.

      Compilers need to be FAST. At least for development. The speed of the Edit-Compile-Debug cycle is extremely important.

      --
      You can not have fun on the weak days but you can on the weakened.