Announcement

Collapse
No announcement yet.

Rust Support Is Being Worked On For The Linux Kernel's V4L2/Media Subsystem

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

  • Rust Support Is Being Worked On For The Linux Kernel's V4L2/Media Subsystem

    Phoronix: Rust Support Is Being Worked On For The Linux Kernel's V4L2/Media Subsystem

    As the latest effort in the quest of bringing Rust programming language usage to the Linux kernel, sent out on Thursday were initial patches for bringing Rust infrastructure to the Video 4 Linux 2 (V4L2) framework within the media subsystem...

    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
    I wish Rust had a better syntax. I know this is a matter of taste but the most popular languages share the same syntax: c, c++, java, javascript, c#. And Rust chose to be different with no reason.

    Comment


    • #3
      What kind of syntax are you referring to? Lowercase naming? Or the whole struct and pub fn?

      Comment


      • #4
        Originally posted by peterdk View Post
        What kind of syntax are you referring to? Lowercase naming? Or the whole struct and pub fn?
        fn, types after parameter names, lambda with | brackets, ! for macro.

        Comment


        • #5
          Originally posted by Sergey Podobry View Post

          fn, types after parameter names, lambda with | brackets, ! for macro.
          I'm using multiple languages, it is just a bit different, just like any other language.
          Not necessarily much better or much worse.
          And your claim "with no reason" is not true, almost everything in Rust has a very specific reason.

          Comment


          • #6
            Originally posted by nazar-pc View Post

            I'm using multiple languages, it is just a bit different, just like any other language.
            Not necessarily much better or much worse.
            And your claim "with no reason" is not true, almost everything in Rust has a very specific reason.
            The only thing that trips me is lifetimes. At the same time, I have no idea how I would have made those easier to read.

            Comment


            • #7
              Originally posted by nazar-pc View Post

              I'm using multiple languages, it is just a bit different, just like any other language.
              Not necessarily much better or much worse.
              And your claim "with no reason" is not true, almost everything in Rust has a very specific reason.
              So, what's the reason behind lamdas using || and not () like other languages?

              Comment


              • #8
                Originally posted by Sergey Podobry View Post

                So, what's the reason behind lamdas using || and not () like other languages?
                Most likely, collision with tuples that also use ().

                Comment


                • #9
                  Originally posted by Sergey Podobry View Post

                  fn, types after parameter names, lambda with | brackets, ! for macro.
                  1. The syntax you're complaining about is common in the world of functional languages, which is at at least as large as the world of languages with C-inspired syntax and, if you include the elements that were present in LISP, predates C by a mile.

                    You're essentially complaining that Polish isn't a Romance language when, if they'd chosen to use Cyrillic like other Slavic languages, rather than using the Latin alphabet, you would have taken for granted that it would be different.
                  2. Many of those syntactic decisions have solid reasons. For example...
                    • Using fn at the beginning and the return type at the end and putting types after parameter names is to simplify parsing by avoiding the need for the lexer hack. It's also very common in functional languages, either as fn, or fun, or func or function (which JavaScript borrowed), or defun (define function). (Types after parameter names, separated by a colon, is also how Wirth languages like Pascal do it.)
                    • Syntactic collisions aside, |args| syntax for lambdas will be familiar to anyone who uses Ruby.
                    • The postfix ! for macros is to denote that, unlike a function call, the macro call may contain control flow constructs like return which apply to the function that's calling it.


                  Last edited by ssokolow; 07 April 2023, 10:00 PM.

                  Comment


                  • #10
                    If a language is too syntactically similar to others, then what's even the point of making it? Sure, Rust has some inherent benefits with security and threading, but sometimes there's just a better way of doing things. Some spoken languages have some inherent benefits over others, to the point that it can reshape the way you interpret things.

                    Comment

                    Working...
                    X