Announcement

Collapse
No announcement yet.

Experimental Support For C++20 Coroutines Has Landed In GCC 10

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

  • #21
    Originally posted by bug77 View Post
    a teacher told us in college it is mathematically proven that any program can be generated starting from proper specifications.
    yes, this is called compilation. you provide compiler with proper specification(source code), compiler generates program
    Originally posted by bug77 View Post
    And let's be pragmatic for a bit. How do you build such a system? For example, C/C++ artifacts need to be made available for Windows, Linux, macOS running on x86, several variants of ARM and whatnot. Probably with 32 and 64 bit variants. Java/JS/Python artifacts have no use for these distinctions. So how do you handle them? Do you go for the least common denominator and add the OS and architecture only for some languages, making your product hard to approach (i.e. you have to learn something new for each additional language) or do you add everything and the kitchen sink for every language and let it go unused mist of the time (again increasing the learning curve, because now you have to read about aspects irrelevant to the language you're using).
    this particular problem is solved by linux package managers. java and python go to noarch packages, c++ has multiple arch-specific packages

    Comment


    • #22
      Originally posted by klapaucius View Post
      Using coroutines will still require relying on external libraries such as cppcoro, right?
      no, you can just use coroutines like you don't have to rely on external library to use for loop.
      Originally posted by klapaucius View Post
      There are no STL class for generators, awaitable objects etc.
      i think you are confusing stl with standard library. there are no higher-level abstractions in standard library (yet)

      Comment


      • #23
        Originally posted by pal666
        i think you are confusing stl with standard library. there are no higher-level abstractions in standard library (yet)
        Exactly, I mean class templates and function templates like these: https://github.com/lewissbaker/cppcoro

        Comment


        • #24
          Originally posted by intelfx View Post
          Package managers are awesome, but having 20 independent package managers stepping onto each other's toes is anything but awesome. It is a royal pain in the ass to develop or deploy a project that has multiple languages in its dependency graph.
          ob. xkcd reference

          and that's only for python. If mixing language, it gets worse, much worse.

          Comment


          • #25
            Originally posted by klapaucius View Post
            Exactly, I mean class templates and function templates like these: https://github.com/lewissbaker/cppcoro
            bazed on its description it is implemented on top of subj. i.e. it was unusable on gcc in the past, now it is usable on gcc. this means "still require" part of your post is incorrect

            Comment


            • #26
              You're quite pedantic. If you try to write a trivial coroutine generating, say, ten ints from 0 to 9, with the current standard support, you must implement your own class for the coroutine's return type, which in turn requires a promise_type member class plus a number of member functions, all of which make writing a coroutine all but trivial. Without a dedicated STL or 3rd party library, that is.

              Comment


              • #27
                Originally posted by klapaucius View Post
                You're quite pedantic. If you try to write a trivial coroutine generating, say, ten ints from 0 to 9, with the current standard support, you must implement your own class for the coroutine's return type, which in turn requires a promise_type member class plus a number of member functions, all of which make writing a coroutine all but trivial. Without a dedicated STL or 3rd party library, that is.
                Well, great it is above the implementation and not below it, like with parallel_execution that requires a third-party library even when using the STL library.

                Comment


                • #28
                  Originally posted by carewolf View Post

                  Well, great it is above the implementation and not below it, like with parallel_execution that requires a third-party library even when using the STL library.
                  It's quite different. In the latter case you have just to link with -ltbb. In the case of the coroutines you need* the classes of a coroutines library to write some useful code.

                  *Unless, again, you don't implement them yourself. Which is not as trivial as passing an execuion policy to an algorithm.

                  Comment


                  • #29
                    Originally posted by klapaucius View Post

                    It's quite different. In the latter case you have just to link with -ltbb. In the case of the coroutines you need* the classes of a coroutines library to write some useful code.

                    *Unless, again, you don't implement them yourself. Which is not as trivial as passing an execuion policy to an algorithm.
                    I assume such classes will be in the STL too though, which means when the implementation is done, that a third party library isn't required, and at best just convinient.

                    Comment


                    • #30
                      Originally posted by carewolf View Post

                      I assume such classes will be in the STL too though, which means when the implementation is done, that a third party library isn't required, and at best just convinient.
                      Yes, in C++23, maybe.

                      Anyway, I'm not complaining too much. I like the fact that coroutines are in C++, finally.

                      Comment

                      Working...
                      X