No announcement yet.

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

  • Filter
  • Time
  • Show
Clear All
new posts

  • #11

    "The speed of C"


    • #12
      Sounds like they should just pick up a better language, like Go.


      • #13
        Hey Michael, could you do some JITed language benchmarks in the future? Would be interesting to see how different JIT implementations compare.

        I think LuaJIT would be the fastest JIT implementation, but it would be better to see actual benchmarks.

        PS: If you do such comparisons, then do keep in mind that you should pre-compile the source files to their intermediate representations, otherwise implementations where pre-compiling is not required (LuaJIT, V8, PyPy, etc.) would be at a disadvantage vs Java where pre-compiling is required.


        • #14
          Originally posted by vladpetric View Post
          As a professional group, compiler writers more-often-than-not over-promise and severely under-deliver.
          Writing a compiler that works is hard, writing one that works and delivers fast code is harder.

          TTBOMK, no single JIT-ed dynamic language has even gotten close to the speed of C++. I'm talking about well-written, performance-optimized code. One can always write "crap" and then "prove" that one language is faster than the other.
          Sure. So the HOPE claims are exaggerations.

          The real question is not whether a JIT compiler can match a language that's as close to the bare metal as C or C++. It can't. The real question is whether your application has performance constraints such that writing it in C or C++ is worth the slowdown in development you get from not using a higher level language. For many applications - definitely not all, but many - writing it in Python on Hope (or PyPy, which does the same thing ) and then profiling it and rewriting the most-used portions to use an FFI to C code probably gives you performance within a factor of 2 of C++. That may be good enough, especially if using Python lets you develop faster.


          • #15
            I'd rather the ease of C++, with the speed of C++. Python is a horrible language. If the standard C++ library isn't bloated enough for you, there's a bajillion libraries and frameworks to pick from to 'fix' that 'problem'. But you can't make python unsuck, its suckiness is built right into its very bones.


            • #16
              This seems like a never ending quest

              I mean really how many Python speed up initiatives are there out there? Maybe it isn't meant to be fast.

              What is more bothersome is that if they would upgrade to Modern C++ they would benefit greatly and would develop the programming skills required to manage C++. In some ways modern C++ is just as easy to work with as Python.


              • #17
                Just use Julia already


                • #18
                  Originally posted by aidanjt View Post
                  I'd rather the ease of C++, with the speed of C++.
                  LOL - I think that you have hit the nail on the head.

                  C/C++ are languages for high performance.
                  Java/C# are the languages for enterprise software
                  Python/PHP are scripting languages for web.

                  As someone who once tried to drill a brick wall with a totally blunt wood-bit, I can definitely recommend picking the right tool for the job...


                  • #19
                    Originally posted by OneTimeShot View Post
                    Python/PHP are scripting languages for web.
                    Python is a scripting language also for other application areas, not just web:

                    In some ways modern C++ is just as easy to work with as Python.
                    Yes, for C++ experts who don't like Python, that's surely right.


                    • #20
                      Python is also by now often used in labs or sometimes even analysis.

                      I fell for example in love with python then I was tasked to write a program which would read data from a oscilloscope using gpib and print the mean values after 2h to a printer.

                      My college was writing for over 3 weeks in C and his program still was not working. I used python, installed one external libary and wrote a program of 10 lines of code and had it working. Just awesome. Sure, my program was slower then his would have been but most of the time was spend waiting on IO anyways so it did not matter.

                      Still, in some situations I like so see some speed improvements and be it only so I can use python even in high performance situations and not have to spend writing C for 3 weeks.