Announcement

Collapse
No announcement yet.

Rust 1.17 Released

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

  • #11
    Originally posted by TheBlackCat View Post
    Which seems the opposite approach from how I would expect modern programming language development to proceed.
    One of the reasons why it's better /sarcasm (with a bit of truth, though)

    Comment


    • #12
      Originally posted by davidbepo View Post
      i feel like rust could have been better, the threading and safety stuff is fine but the syntax is overly complex
      What do you expect from a systems language? C has a lot of ambiguous syntax and an overall lack of features needed in modern day systems software development, and thus two of Rust's major features as a systems language is explicitness and expressiveness. As people are going to spend a lot more time reading code than writing it, it helps to have a language with both an explicit and expressive syntax, so there is no question about the behavior of the code, and code can be simplified into simple expressions.

      In any case, I see no complexity issues with Rust syntax. The syntax is boiled down to:
      • :: means to access an item in a module / type
      • . means to access a method on a variable
      • <> is for explicitly defining type parameters
      • => is for match arms
      • -> defines the return type of a function
      • .. is an exclusive range
      • ... is an inclusive range
      • 'name is for naming loops and lifetimes
      • ? is syntax sugar for a match that returns on an error, else unwraps the Okd result
      • & means to create an immutable reference
      • &mut means to create a mutable reference
      • * means to dereference a reference
      • macro! is used to call a macro
      • fn declares a function
      • where clauses define type parameters for generic arguments in functions
      In any case, it's not C-based so I wouldn't try to compare languages based on C. Rust takes features and inspirations from Haskell, Cyclone, ML, and C++.
      Last edited by mmstick; 27 April 2017, 04:41 PM.

      Comment


      • #13
        Originally posted by mmstick View Post
        support for first class arrays -- something other shells completely lack
        In fish, every variable is an array.

        Comment


        • #14
          Originally posted by TheBlackCat View Post

          Which seems the opposite approach from how I would expect modern programming language development to proceed.
          Only if you consider "modern" to mean garbage-collected. Rust started out complicated because it was "safety without a GC", which meant it had to figure things out at compile time. Rust gets simpler as they find good ways to make the compiler smarter.

          Comment


          • #15
            Originally posted by mmstick View Post

            You should contribute to the Ion shell that I have been working on. It is currently much faster than both Bash and Dash, with a cleaner syntax and support for first class arrays -- something other shells completely lack. I am continually looking for people to mentor into the project, as otherwise it's just me working on the project, and that's no good for such a big project to scale into the future. One of the areas needing work is implementing more shell commands as builtin commands.


            https://chat.redox-os.org/redox/channels/ion
            I'm using Fish, how is Ion different from Fish (in terms of using it, not programming language) and how is it faster ('cause Fish is lightning fast to me)?

            (also, in Fish, every variable is an array, so you might want to retract your array statement)
            Last edited by Vistaus; 28 April 2017, 04:55 AM.

            Comment


            • #16
              Originally posted by mmstick View Post

              You should contribute to the Ion shell that I have been working on ...
              Cool! Will it be posix compatible?
              Edit: doesn't look like. But the syntax looks cool
              Last edited by treba; 28 April 2017, 08:05 AM.

              Comment


              • #17
                Originally posted by andreano View Post

                In fish, every variable is an array.
                Same goes for Bash, which is a terrible idea in itself. There is a difference between arrays and strings, and thus shells should treat them as first class citizens, not hybrids. By treating them as first class citizens, you open the door to more useful shell syntax capabilities. IE: there is a difference between @[command] and $(command) in Ion. As well, slicing a string will create a substring, whereas slicing an array will create either an array or a string.

                Comment


                • #18


                  Fish treating all variables as arrays doesn't make arrays first class citizens in Fish. Ion treats strings and arrays as two completely separate entities. The @ and $ sigils differentiate between the two. They each have methods of their own as well, such as @split() and $join(). No ambiguity.
                  Last edited by mmstick; 28 April 2017, 02:01 PM.

                  Comment


                  • #19
                    Wow, it seems like the amount of people using fish shell is nearly equal that of people rooting for Rust.

                    Same goes for Bash, which is a terrible idea in itself.
                    Gosh... Arrays in bash are very horrible too.

                    Comment


                    • #20
                      Rust is great. I love it!

                      And yes, shell languages are pretty terrible. The problem is that shells are used by people, who want the simple things to be very simple. But that, like using simple spaces to separate command arguments, means that spaces have to be escaped. And since people don't want complicated, explicit variable declarations in their shell, we have to handle weird things using $. Or @. Or %.

                      If you find yourself doing complicated things in shell just don't. Use literally ANY scripting language: it will be a better choice.

                      Comment

                      Working...
                      X