Announcement

Collapse
No announcement yet.

GNOME Might Need To Crack Down On Their JavaScript Extensions

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

  • #91
    Originally posted by Weasel View Post
    No because you don't specify the type so it's not equivalent hence your comparison is meaningless.
    Actually it would be "let x = 5;" vs "const auto x = 5;" - we're using modern C++ after all. Or "let x = 5i32;" vs "const int32_t x = 5;"

    Originally posted by Weasel View Post
    You can always use i32 if you want in C/C++, just make your own typedef?
    That's easier said than done. Luckily, there is lots of preprocessor magic in most libc-implementations, which do that for you.

    Originally posted by Weasel View Post
    let is completely superfluous and sounds stupid. This is not math, imperative languages have nothing to do with math. Maybe in Haskell only.
    Well, guess what influences rust a lot? Functional programming languages.


    Originally posted by Weasel View Post
    Huh? I said it should be the default, not that it's always what you want. If you want a constant instead of a variable, just use const?
    Sure, but usually most stuff can be constant. I should have a hotkey for "const", since most of my variables in C++ are const. Or const references. Or const member functions. Believe me, usually "const" is what you want. And that's why it's default in rust. A wise decision IMHO. It makes code a lot easier to reason about.

    Originally posted by Weasel View Post
    Bonus: it doesn't sound retarded like "let mut".
    Personal opinion. You don't like it? Choose something else and stop complaining. I like haskell, hence I like let.


    Originally posted by Weasel View Post
    There are some problems with C/C++ syntax, like the above with a bit confusing parsing, but it's nothing once you get the "hang" of it, at least it won't sound retarded in your head as you read the code mentally.
    Superfluous usage of the word "retarded" is retarded, you know?

    Originally posted by Weasel View Post
    I realize you don't like me calling them "retarded" but what do you want me to use instead? Most of the time you spend reading code in your head. "let mut" simply sounds retarded, idk how else I can put it.
    Maybe you should learn more words?

    Originally posted by Weasel View Post
    "let" by itself isn't much better though, why can't it just be simple assignment?
    Let is for disambiguating patterns. You can i.e. write (c.f the let binding in line 14):

    Code:
    struct MyFunkyType
    {
        h : i32,
        u : f32
    }
    
    fn build() -> MyFunkyType
    {
        MyFunkyType { h:32, u: 31.5}
    }
    
    fn main()
    {
        let MyFunkyType{h, u} = build();
        
        println!("h={}, u={}", h, u)
    }
    As you can see, the type is deconstructed in the "assignment". Expressions can get more complicated as you can use this kind of pattern matching in different places, not only in simple variable declarations. Thus, it makes the intent clearer and it's easier to parse -- for humans, as well as for compilers.

    Compare that to C++l I.e. what does "a * b;" mean in C++? Does it declare the variable "b" of type "a*" or does it multiply the variables "a" and "b"? Who knows, you need to know the full context.




    Last edited by oleid; 02 August 2018, 04:52 PM.

    Comment


    • #92
      Modern JavaScript is a beautiful language.

      Comment


      • #93
        Originally posted by cynical View Post
        Modern JavaScript is a beautiful language.
        I love it so much that most the sites that use it say, "your browser does not support java". In which case I don't use the site or carry on with it disabled.

        Comment


        • #94
          Why no one think in the obvious solution?
          1 Set back to X11 as the default session.
          2 Decouple the compositor to be able to recover on Wayland.
          3 Set again Wayland as the default session.

          The problem is not JS or Wayland, but putting all things on the same process. They only need to make a simple compositor daemon able to recover, not the whole window management.

          Comment


          • #95
            Originally posted by cochise View Post
            Why no one think in the obvious solution?
            1 Set back to X11 as the default session.
            2 Decouple the compositor to be able to recover on Wayland.
            3 Set again Wayland as the default session.

            The problem is not JS or Wayland, but putting all things on the same process. They only need to make a simple compositor daemon able to recover, not the whole window management.
            A) minus switching the default back to X, that's literally option 2 that they suggested... So they *did* think of it, not to mention it's already been mentioned several times in this thread.

            B) switching the default back to X11 really doesn't solve anything. You still have random extensions crashing your shell. You still have them crippling shell performance. The X11 session is still there for the distros who want it. For and for the bleeding edge distros that are using shell without any extensions, wayland is still a better default.

            Comment


            • #96
              Recent blog post on the topic by Eike Hein (current situation and ongoing work in plasma):
              https://blogs.kde.org/2018/08/02/eng...ent-and-future

              Comment


              • #97
                Originally posted by oleid View Post
                Actually it would be "let x = 5;" vs "const auto x = 5;" - we're using modern C++ after all. Or "let x = 5i32;" vs "const int32_t x = 5;"
                auto is not int32, in this case it would be just int. It is also a good keyword because it tells you the type is automatically deduced, unlike crap like "let". I don't know Rust that well but it seems it defaults to i32? In C++ you'd know since a numeric 5 is int, if you wrote 5UL it would be unsigned long, etc.

                Also, stop using const examples? You're intentionally using a default over a non-default to prove an invalid point, how about:
                Code:
                let mut x: i32 = 5;
                vs
                Code:
                i32 x = 5;
                or even just:
                Code:
                i32 x;
                (yes, you can typedef if you want it short like that, no need to use int32_t). mut is stupid but let is just superfluous. At least with auto you don't have to specify the type, while with let you can so it's completely useless. auto also just reads better.

                Originally posted by oleid View Post
                That's easier said than done. Luckily, there is lots of preprocessor magic in most libc-implementations, which do that for you.
                Huh?
                Code:
                typedef int32_t i32;
                at the top of your core header that everything else includes.

                Yeah very "difficult".

                Originally posted by oleid View Post
                I should have a hotkey for "const", since most of my variables in C++ are const.
                Then you code the wrong way. They're called variables for a reason, not constants. Do you code in SSA fashion or what?

                Originally posted by oleid View Post
                Personal opinion. You don't like it? Choose something else and stop complaining. I like haskell, hence I like let.
                Yes, personal opinion. I do choose something else. No, I won't stop complaining, just as morons don't stop complaining about C being "ugly" when in fact it's 1 million times more "beautiful" than Rust's crappy syntax. (for the record, I'm not referring to you)

                Originally posted by oleid View Post
                Compare that to C++l I.e. what does "a * b;" mean in C++? Does it declare the variable "b" of type "a*" or does it multiply the variables "a" and "b"? Who knows, you need to know the full context.
                It obviously means multiplication, given the space (or lack of) between the arguments.

                Oh, I'm not going to argue about badly written code or intentionally obfuscated. Why should a language prohibit that in the first place? It's not like they are hand-holding a guy who wants to obfuscate his code, he'll just find another way.
                Last edited by Weasel; 03 August 2018, 07:32 AM.

                Comment


                • #98
                  Originally posted by Sniperfox47 View Post
                  B) switching the default back to X11 really doesn't solve anything. You still have random extensions crashing your shell. You still have them crippling shell performance. The X11 session is still there for the distros who want it. For and for the bleeding edge distros that are using shell without any extensions, wayland is still a better default.
                  But GS is able to recover with a "blink" in X, without losing all client apps and to disable extensions in the restart. This workaround reduce the damage to users.

                  Comment


                  • #99
                    Originally posted by Weasel View Post
                    It obviously means multiplication, given the space (or lack of) between the arguments.
                    Wow, never thought about that. I'm not sure if the committee knows about that. I am sure you could speedup the parser tremendously!

                    Comment


                    • Hey I have a great idea that will solve everyones Gnome woes. Just use i3 its written in C there is no bloat, and integrates well with XFCE gtk apps like thunar and pasystray. It's functionality is 100x faster than anything Gnome has. While Gnome is pretty, thats all it is, it's pretty and its clunky, and slow. Using i3 right now, it's either XFCE or i3 for me and both are excellent. I use both but not at the same time.

                      But here is the thing you can integrate XFCE and i3 at the same time adding hyper functionality, while I have not done this it does seem like an interesting expirement to try, I know people are already doing it. I do feel as though it defeats the purpose of each seperate wm.

                      The cool thing about i3 is you can pull up thunar with the dmenu and goto your desktop folder and use all you desktop icons and shortcuts for XFCE which is very nice if your XFCE desktop is cluttered with tons of stuff to use as sort of a quick launch thing. I have a very cluttered desktop but I am also highly productive when working with graphics and DAW stuff. Often times though dmenu is so predictive that once you start typing what you want it is already there in the first few letters, if not keep typing and then you can scroll through or even isolate it before typing further if you can't remember something. i3 is simply genius put into practice.
                      Last edited by creative; 03 August 2018, 10:05 AM.

                      Comment

                      Working...
                      X