0

Python offers various advantages including simplified rules of coding and ease of readability. It offers OOP, cross platform compatibility and has numerous libraries that have been added over time. It can be understood why the original Bitcoin Core client was in C++ as python was not that popular as it is now.

Apart, from having to tear down the entire code, and re-write it in python and check for vulnerabilities, why aren't the core bitcoin developers thinking of migrating the entire reference client implementation language to python?

3

Apart, from having to tear down the entire code, and re-write it in python and check for vulnerabilities,

This is what is known as a self-answering question. The obstacles you list are not trivial.

There is a considerable cost, a great deal of effort that could instead be spent on functional improvements to existing code.

There is also the matter of losing core developers who are skilled in C++ but may not care to use Python

Also if you are going to switch languages, it would be sensible to evaluate a much larger range. You advocate Python, I like Go, others may push for Rust, Haskell, Java, C# or any of a huge number of other possibilities.

This isn't a can of worms anyone would open lightly.

  • True, the question was self-answering, but what I was looking for was more to what capabilities are being offered by c++ to Bitcoin Core that is difficult to replicate with other modern programming languages. Losing core developers who are skilled in C++ but may not care to use Python, and opening can of worms for other recommendations are a valid point. – Ugam Kamat Mar 25 at 11:09
  • 1
    C++ is a compiled language, so lives much "closer to the metal" than Python, which is an interpreted language. This means C++ can be more than 100x faster at doing the same job. As I'm sure you're aware, someone who can mine 100x faster has a significant advantage so even if Python had been the original language used, it would have changed to C++ (or a similar language) since. – Alistair Mann Mar 25 at 13:52
  • 4
    "Not trivial" ... it would be impossible. The state of the art in engineering can't provide a reasonable level of guarantee that a piece of code in C++ and a piece of code in Python behave the same way in all circumstances (which is what is required to not introduce a fork when making this change). – Pieter Wuille Mar 25 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.