Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 11 submissions in the queue.
posted by martyb on Friday July 13 2018, @12:58PM   Printer-friendly
from the pass-it-on dept.

On a python developers' mailing list for the core developers, Python Committers, Benevolent Dictator for Life Guido van Rossum has announced that he is stepping down effective immediately and with out appointing a successor.

Now that PEP 572 is done, I don't ever want to have to fight so hard for a
PEP and find that so many people despise my decisions.

I would like to remove myself entirely from the decision process. I'll
still be there for a while as an ordinary core dev, and I'll still be
available to mentor people -- possibly more available. But I'm basically
giving myself a permanent vacation from being BDFL, and you all will be on
your own.

After all that's eventually going to happen regardless -- there's still
that bus lurking around the corner, and I'm not getting younger... (I'll
spare you the list of medical issues.)

I am not going to appoint a successor.

[...] I'll still be here, but I'm trying to let you all figure something out for
yourselves. I'm tired, and need a very long break.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by Knowledge Troll on Friday July 13 2018, @04:30PM (11 children)

    by Knowledge Troll (5948) on Friday July 13 2018, @04:30PM (#706685) Homepage Journal

    I'm just starting to learn C++ and I started with C++14 then moved up to C++17 for a few extra types and some attributes. Template programming is brand new to me and I've really enjoyed it (and hopefully am learning to not abuse it, I've got people mentoring and doing code review to help with that) so I'm particularly curious about what new template technology is coming up and how head exploding it is. Would you mind elucidating?

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 2) by c0lo on Friday July 13 2018, @05:03PM (7 children)

    by c0lo (156) on Friday July 13 2018, @05:03PM (#706697) Journal

    Sorry, I got my mind fried at C++11 in the parameter packs expansion/loci [youtu.be].

    --
    https://www.youtube.com/watch?v=aoFiw2jMy-0
    • (Score: 2) by Knowledge Troll on Friday July 13 2018, @11:07PM (6 children)

      by Knowledge Troll (5948) on Friday July 13 2018, @11:07PM (#706822) Homepage Journal

      I'm not sure if I'm still soundly in happiness via ignorance but that video seemed to over complicate things quite a bit. I can write C and I'm used to variadic functions - one of the first things I needed to do in my C++ project was use a variadic function but then I found variadic templates. One major improvement is that variadic templates maintain the type information - I much prefer that over a variadic function.

      I was able to use a variadic template in C++ with nothing more than my C knowledge and stack overflow and that was either right before or right after I even made my first class. After that I implemented a class for doing promises/futures reusing the native C++ types for them with a cleaner interface and reference counted objects. That promise class is templated and works with any type you can throw at it and maintains the type information instead of having to cast it from a void pointer.

      At least for me templates turned out to be pretty easy. The biggest challenge I ran into was template abuse where I tried to use them way too much but I have a mentor to bring me back from that behavior. So far, for me, templates work well and solve real problems.

      If I had to use a template after watching the referenced video I think I'd slit my wrists.

      • (Score: 2) by c0lo on Saturday July 14 2018, @02:18AM (5 children)

        by c0lo (156) on Saturday July 14 2018, @02:18AM (#706885) Journal

        I was able to use a variadic template in C++ with nothing more than my C knowledge and stack overflow and that was either right before or right after I even made my first class.

        Basics, even with variadic params, is easy and many useful things can be done with the basics.
        The things start to go quite horendous when you get into template metaprogramming - not everybody's piece of cake, but it's insanely powerful. And useful.
        E.g. write a templated function implementing one behaviour if you detect at compile time the (class) parameter implements a method with given signature, and a different behaviour if it doesn't. Do it without relying on inheritance - because you can't always go and pad a 3rd party library with "marker interfaces" specific to your needs.

        --
        https://www.youtube.com/watch?v=aoFiw2jMy-0
        • (Score: 2) by Knowledge Troll on Saturday July 14 2018, @03:18AM (4 children)

          by Knowledge Troll (5948) on Saturday July 14 2018, @03:18AM (#706902) Homepage Journal

          That's awesome, thank you for sharing. I have yet to put together any template that has a branch that relates to the template variable but I've been wondering about what that might be useful for. Right now I just use templates to pass types through into the function so it can do something smart with them and the most sophisticated thing I think I've done so far is use T where the object name would go when using the name as a constructor in a templated class that provides constructors as static methods for the class that extends it. I was really pleased that it worked and it gave some nice shine to my base object interface.

          How do you do introspection in something like C++ at compile time to find out if a method signature exists on an object or not with out relying on the class hierarchy? Is that with typeinfo()? I didn't see an obvious way that would work in the documentation.

          Again, thanks for sharing, I truly appreciate it.

          • (Score: 2) by c0lo on Saturday July 14 2018, @09:35AM (3 children)

            by c0lo (156) on Saturday July 14 2018, @09:35AM (#707014) Journal

            If you haven't had any template metaprogramming experience, it will take you some time to get what's happening here. If this is the case:
            - SFINAE [cppreference.com]
            - see <type_traits> [cppreference.com]

            namespace detail {

            // SFINAE check for a method named `PostProcess`
            template <typename, typename T>
            struct has_PostProcess { // error case
                static_assert(
                    std::integral_constant::value,
                    "Second template parameter needs to be a function type."
                );
            };

            // specialization. Looking for a method named PostProcess declared by type X with rettype and args
            template <typename X, typename Ret, typename... Args>
            struct has_PostProcess<X, Ret(Args...)> {
            private:
                // constexpr data member - named `check` - of type function, will be used T has a PostProcess method
                // with matching arguments. The return type is either std::true_type or std::false_type
                template <typename T>
                static constexpr auto check(T*) ->
                    typename std::is_same().PostProcess(std::declval()...)),
                        Ret
                    >::type;
                // generic version of the check data member if the more specialized check
                // is not matched
                template <typename>
                static constexpr std::false_type check(...);
                // Realize that, by SFINAE, only one of the above definition of `check` will prevail.

                // this says "Would I be to call the 'check' function, what would be the return type"?
                using response=decltype(check<X>(static_cast<X*>(nullptr)));
            public:
                // the constexpre value will be true (X does have a PostProcess method matching the required signature)
                // or false otherwise.
                static constexpr bool value=response::value;
            };

            }// namespace detail

            Can you manage from here?

            --
            https://www.youtube.com/watch?v=aoFiw2jMy-0
            • (Score: 2) by Knowledge Troll on Saturday July 14 2018, @03:55PM (2 children)

              by Knowledge Troll (5948) on Saturday July 14 2018, @03:55PM (#707154) Homepage Journal

              Wow thanks again! Yeah that's beautiful, I just need a pointer really. I talked a bit with a friend and he introduced me to the type traits but said he had never done specialization. Thanks again! I will now explode my head.

              • (Score: 0) by Anonymous Coward on Saturday July 14 2018, @05:35PM

                by Anonymous Coward on Saturday July 14 2018, @05:35PM (#707216)

                > I just need a pointer really.

                Here you go: std::unique_ptr

                :D

              • (Score: 2) by c0lo on Saturday July 14 2018, @11:05PM

                by c0lo (156) on Saturday July 14 2018, @11:05PM (#707365) Journal

                Ah, shit, there are a few place where I missed to &lt; the <.

                //...
                        // constexpr data member - named `check` - of type function, will be used T has a PostProcess method
                        // with matching arguments. The return type is either std::true_type or std::false_type
                        template
                        static constexpr auto check(T*) ->
                                typename std::is_same<
                                    decltype(std::declval<T>().PostProcess(std::declval<Args>()...)),
                                    Ret
                                >::type;

                --
                https://www.youtube.com/watch?v=aoFiw2jMy-0
  • (Score: 1) by Ethanol-fueled on Friday July 13 2018, @06:34PM (2 children)

    by Ethanol-fueled (2792) on Friday July 13 2018, @06:34PM (#706727) Homepage

    Templates are slow redundant dog-shit -- a symptom of "Firefox Syndrome" pozzing C++ with its AIDS.

    • (Score: 2) by Knowledge Troll on Friday July 13 2018, @10:59PM (1 child)

      by Knowledge Troll (5948) on Friday July 13 2018, @10:59PM (#706818) Homepage Journal

      Redundant I can understand since each template gets expanded at compile time for each specific use case.

      But dog shit slow? Template functions/methods/classes are slower than non-template ones?

      • (Score: 0) by Anonymous Coward on Saturday July 14 2018, @07:24AM

        by Anonymous Coward on Saturday July 14 2018, @07:24AM (#706975)

        I don't know if that's what GP meant, but *compiling* templates is slow and linking requires gobs of memory (for larger projects, gigabytes). It's a trade-off; you sacrifice compiling complexity (plus some ease of writing) to get highly-optimized binaries. It's the literal opposite of languages like Python.