Announcement

Collapse
No announcement yet.

HOPE: The Ease Of Python With The Speed Of C++

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

  • #81
    Originally posted by pal666 View Post
    1. everyone who knows c++ would pretty much directly see what the previous c++ function did.
    I "know" C++, and I did not immediately see what that function did. So I wouldn't think so.

    3. boost is fully standard c++, it does not require some non-standard compiler. you have some ideas without basis in reality. on the other hand, no part of python is standard, because python standard does not exist.
    Uhm? Seriously?
    Boost is not standard C++ since it is not available in all C++ distributions. It is not part of the standard C++ library, or language specifications. If you compile your application against boost, it might not run if boost is not installed on the host system.

    As far as Python goes there is both a specification and a standard library. If I write Python code using only the standard library I can be pretty sure it will work on all Python installations.

    Comment


    • #82
      Originally posted by kigurai View Post
      I "know" C++, and I did not immediately see what that function did. So I wouldn't think so.
      you think that you know, but you don't
      Originally posted by kigurai View Post
      Uhm? Seriously?
      Boost is not standard C++ since it is not available in all C++ distributions. It is not part of the standard C++ library, or language specifications. If you compile your application against boost, it might not run if boost is not installed on the host system.

      As far as Python goes there is both a specification and a standard library. If I write Python code using only the standard library I can be pretty sure it will work on all Python installations.
      if you wanted to say that boost is not part of c++ standard library then that is fine. c++'s standard library is small compared to other languages(it is not like other languages have real standards, so it is easier for them to grow libraries). but what makes you think that you can not use other libraries ? that is ridiculous claim. you do not have to distribute boost, boost.range is header-only lib. it does not need to be installed to run application. and boost is available in all boost distributions. btw, python's library is not available in all python distributions and application might not run if some library part is not installed on host system.
      python does not have standard library at all because python does not have standard. you confuse standard with reference implementation. if you write code using reference implementation and distribute it and all used libraries to host system then and only then it will work.

      Comment


      • #83
        Originally posted by pal666 View Post
        i already told you that you first and third options have equivalent complexity. so you clearly ordered them by simplicity.
        No, they don't. As I said, the first and second example use hash tables, the third uses a linked list. I know for a fact the third one is slower, I timed it.

        Originally posted by pal666 View Post
        well, your third variant had 7 lines loop body instead of one. that's the ugly part.
        It is 7 lines because you need to find the index of the character in the list, and deal with situations where the character is not already present in the list.

        Comment


        • #84
          Originally posted by pal666 View Post
          you misunderstood what toy languages do. they disallow you to write fast program no matter what compiler you will use. so for long running calculations you start with using proper language and then compile it with profile guided optimizations.
          I know this is hard for you to understand, but just because it doesn't suit your particular use-cases or workflow does not mean it is a "toy".

          Comment


          • #85
            Originally posted by pal666 View Post
            you think that you know, but you don't
            He understood the line. I understood the line.
            So we do "know" C++.
            That line was still horribly unreadable, and if someone wrote something like that in one of the C++ projects I manage (as part of my job, for several years), I would simply reject it.

            Comment


            • #86
              Originally posted by TheBlackCat View Post
              No, they don't. As I said, the first and second example use hash tables, the third uses a linked list. I know for a fact the third one is slower, I timed it.
              first uses hash table but it iterates over it sequentially. timing is not going to help you because complexity disregards constants. it only shows yo how fast it will be slowed down with input size increase
              Originally posted by TheBlackCat View Post
              It is 7 lines because you need to find the index of the character in the list, and deal with situations where the character is not already present in the list.
              i didn't ask you why do you need those 7 lines. i told you that in c++ you need only one to do same thing.

              Comment


              • #87
                Originally posted by TheBlackCat View Post
                It is 7 lines because you need to find the index of the character in the list, and deal with situations where the character is not already present in the list.
                Out of curiosity, what happens in python if it is not?

                Comment


                • #88
                  Originally posted by erendorn View Post
                  He understood the line. I understood the line.
                  So we do "know" C++.
                  That line was still horribly unreadable, and if someone wrote something like that in one of the C++ projects I manage (as part of my job, for several years), I would simply reject it.
                  i think he said he didn't
                  as i already told you if you use this line once you can just break it into several. if you use it often, you can write oneliner wrapper around transformed and function and shorten it to one letter. if lamdas are unreadable to you to the point of rejecting then i lol.

                  Comment


                  • #89
                    Originally posted by pal666 View Post
                    you think that you know, but you don't
                    Let's just say I am not impressed with syntax if it confuses someone with the level of C++ knowledge I have.

                    if you wanted to say that boost is not part of c++ standard library then that is fine. c++'s standard library is small compared to other languages(it is not like other languages have real standards, so it is easier for them to grow libraries). but what makes you think that you can not use other libraries ? that is ridiculous claim. you do not have to distribute boost, boost.range is header-only lib.
                    There might be numerous reasons why you can't use anything not in the standard lib. Regardless of which, standard functionality is what was discussed, not third party libraries, e.g. boost.

                    btw, python's library is not available in all python distributions and application might not run if some library part is not installed on host system.
                    python does not have standard library at all because python does not have standard. you confuse standard with reference implementation. if you write code using reference implementation and distribute it and all used libraries to host system then and only then it will work.
                    There might be parts of the standard library that is only available in CPython. As far as I know, those exceptions are extremly rare for all relevant implementations.
                    For all practical purposes, CPython is the standard, and thus the entire standard library is available everywhere Python is installed.
                    (Also, in the example used, no module was used, so in this specific case the argument is moot)

                    Comment


                    • #90
                      Originally posted by pal666 View Post
                      i think he said he didn't
                      as i already told you if you use this line once you can just break it into several. if you use it often, you can write oneliner wrapper around transformed and function and shorten it to one letter. if lamdas are unreadable to you to the point of rejecting then i lol.
                      He said "not immediately". Which is exactly the difference between readable and understandable.
                      And I do not reject it because it is unreadable to me, but because it is unreadable/less readable to others. You know, maintenance, team work, etc..
                      Lambdas are a solution to some problems that would be difficult to solve cleanly otherwise. That does not make them readable.

                      You act a bit like the diva type programmer that I would not really like to have in my team :/

                      Comment

                      Working...
                      X