Announcement

Collapse
No announcement yet.

Facebook Has Been Working On C++ Modules Support For GCC

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

  • #11
    Java SE 7 spec is 604 pages.
    C# 5 spec is 547 pages.
    And I have Read almost all of of C# spec, some of D spec, all of vala spec, source code of .net framework(mscorlib, System.Net.* System.Windows.Forms.* System.IO.* and a few others), some of C++ spec, parts of the boost library, every header in MFC and windows API, most of older versions of C spec, a whole lot of linux kernel code, bits and pieces of java spec, some javascript spec, specs for C++ script(yes, it was a thing in the web), I HAS lolcode tis numbar, and good old brainfuck.
    I can tell you from experience that anything in this list that's not named "C++ spec" is written in English. Reading every sentence in the C++ spec actually requires you to stop, think, re-read, imagine some code and how what you just read fits into the code, re-read, re-think, continue to next line, read, and say "WTF, this doesn't work the way I thought it did."
    Last edited by FastCode; 08 October 2017, 05:01 PM.

    Comment


    • #12
      Originally posted by FastCode View Post
      I can tell you from experience that anything in this list that's not named "C++ spec" is written in English. Reading every sentence in the C++ spec actually requires you to stop, think, re-read, imagine some code and how what you just read fits into the code, re-read, re-think, continue to next line, read, and say "WTF, this doesn't work the way I thought it did."
      But language specs are for compilers writers, and not for final users of this programming language. It's something obviously somehow, specs are harder to read or to be understood from the first time since, from the first reading. Not being very explicit

      Comment


      • #13
        Originally posted by onicsis View Post

        But language specs are for compilers writers, and not for final users of this programming language. It's something obviously somehow, specs are harder to read or to be understood from the first time since, from the first reading. Not being very explicit
        True that.
        But that's not the ONLY thing that specs should be good for. Say I want to understand how lambdas work in my language. I go to C# spec, lambda functions, there are a few samples, it says how the variables are handled, and what leads to what. simple as that.
        On the other hand the C++ spec has like half dozen variable designations. 3 ways to pass them, and each can be by ref or by val, and the type itself can be const or not like the reference that can be, the way the variables are passed is different, how you should always const it if it's byval or something like that(I don't remember now), the way they work in multi-threaded environments is different, the way you should pass a mutex is not straight-forward AT ALL, every time you write a lambda function you have to stop, remove your hands from the keyboard and say how do I pass that handle again and do the modifications affect the forked process or not?

        It shouldn't be this hard in the first place, and answering your question with the spec document shouldn't be this hard either, It's too cryptic to be decipherable with just reading the portion that you want to understand.
        Last edited by FastCode; 08 October 2017, 06:08 PM.

        Comment


        • #14
          [] Capture nothing (or, a scorched earth strategy?)
          [&] Capture any referenced variable by reference
          [=] Capture any referenced variable by making a copy
          [=, &foo] Capture any referenced variable by making a copy, but capture variable foo by reference
          [bar] Capture bar by making a copy; don't copy anything else
          [this] Capture the this pointer of the enclosing class
          Just why did they have to do this instead of having an explicit list? They missed APL so badly?
          Same thing also happens with the infered return type.
          Last edited by FastCode; 08 October 2017, 06:18 PM.

          Comment


          • #15
            Originally posted by FastCode View Post
            Java SE 7 spec is 604 pages.
            C# 5 spec is 547 pages.
            .....
            I can tell you from experience that anything in this list that's not named "C++ spec" is written in English. Reading every sentence in the C++ spec actually requires you to stop, think, re-read, imagine some code and how what you just read fits into the code, re-read, re-think, continue to next line, read, and say "WTF, this doesn't work the way I thought it did."
            well, i can tell you that you can't read english, because i explicitly told you to include libraries and you skipped libraries. so now homework for you: what is c++ core language spec size
            btw, java 7 is many years old, current one is 9, which is presumably larger
            Last edited by pal666; 09 October 2017, 01:36 AM.

            Comment


            • #16
              Originally posted by FastCode View Post
              [] Capture nothing (or, a scorched earth strategy?)
              [&] Capture any referenced variable by reference
              [=] Capture any referenced variable by making a copy
              [=, &foo] Capture any referenced variable by making a copy, but capture variable foo by reference
              [bar] Capture bar by making a copy; don't copy anything else
              [this] Capture the this pointer of the enclosing class
              Just why did they have to do this instead of having an explicit list?
              your explicit list is ambiguous and fails to list valid choices. it is painfully clear that you are not target audience of language spec, so why do you try to read it? failed to google for cppreference.com ?

              Comment


              • #17
                Originally posted by FastCode View Post
                But that's not the ONLY thing that specs should be good for. Say I want to understand how lambdas work in my language. I go to C# spec,
                you fail to understand that c++ standard is different from other "standards" in that it does not have default implementation. so someone has to implement it, using only standard spec. so spec is targeted at language implementers
                Originally posted by FastCode View Post
                lambda functions, there are a few samples, it says how the variables are handled, and what leads to what. simple as that.
                On the other hand the C++ spec has like half dozen variable designations. 3 ways to pass them, and each can be by ref or by val, and the type itself can be const or not like the reference that can be, the way the variables are passed is different, how you should always const it if it's byval or something like that(I don't remember now), the way they work in multi-threaded environments is different,
                i have no idea what are you talking about here, and i'm sure you too have no idea
                Originally posted by FastCode View Post
                the way you should pass a mutex is not straight-forward AT ALL,
                mutex is non-copyable(and for a good reason), so the only way to pass it is by reference
                Originally posted by FastCode View Post
                every time you write a lambda function you have to stop, remove your hands from the keyboard and say how do I pass that handle again
                every time you write function you have to stop and think how you pass arguments
                Originally posted by FastCode View Post
                and do the modifications affect the forked process or not?
                nothing affects forked processes regardless of language. maybe you are using wrong words
                Originally posted by FastCode View Post
                It shouldn't be this hard in the first place, and answering your question with the spec document shouldn't be this hard either, It's too cryptic to be decipherable with just reading the portion that you want to understand.
                don't read specs. read a book or reference

                Comment


                • #18
                  Originally posted by pal666 View Post
                  kid, c# and java(unlike brainfuck) are main c++ competitors. so how big is their spec size again?
                  Wrong. Java and C# target completely different type of applications, than C++. They are oriented towards stability and safety. But, C++ is oriented towards performance.

                  Java and C# is used mostly in business applications (ie. working with money and precious data,... ).

                  C++ is used mostly for games, desktop applications, and parts of operating system (ie. desktop environment, data transformation tools and libraries,...)

                  Comment


                  • #19
                    Wow. Could everyone in the comments focus on the future?
                    Do you use C++ and/or some other language that has packages?

                    The modules are the most needed thing to get a valid package manager in the future which in turn will help broaden the C++ ecosystem massively.
                    The lack of valid and central package management system (ala NPM) is why we still reinvent the wheel all the time. And why many projects are going header-only route to help mitigate this to some extent (which in turn increases compile time and well, beats the idea of the language header/source feature itself).

                    So modules are great as they can be. We need them. We use C++ for backend and networking and it's time to push C++ as a really general language. Without modules, you can't do that.

                    Comment


                    • #20
                      Originally posted by pal666 View Post
                      you fail to understand that c++ standard is different from other "standards" in that it does not have default implementation. so someone has to implement it, using only standard spec. so spec is targeted at language implementers
                      That list was copied from some site i googled last night, I did not write it or copy it from the spec, the spec explains that list over a few pages.
                      btw, This is what we programmers call an explicit parameter list:
                      (int a, char* b, bool c)

                      i have no idea what are you talking about here, and i'm sure you too have no idea
                      You're correct. Every time I read some C++ piece of code I encounter a new language construct. but what I said there is what I vaguely remember from one of my favorite(complex for no reason at all) parts of the C++ spec.
                      nothing affects forked processes regardless of language. maybe you are using wrong words
                      Meant clone; fork uses clone internally. There are lots of things that are shared and you can decide what things you can share, like file handles, virtual memory, etc.
                      https://unix.stackexchange.com/quest...ne-system-call
                      every time you write function you have to stop and think how you pass arguments
                      yes, when I have multiple processes with shared RW data I stop and think every time I want to modify something.
                      mutex is non-copyable(and for a good reason)
                      right, kill people who copy memory, specially doing things involving CoW like MVCC.

                      food for thought: The -> operator is optional in C++ lambda expressions. java and C# don't allow this.


                      And I'm done with C++ fnatics, should have known there is a lot of you in a benchmarking forum.

                      Comment

                      Working...
                      X