Any reason for not writing Backtrader in Java, Scala or C# for example?
Would that be a good idea?
The same reason other people choose other languages. It has nothing to do with it being a good or a bad idea. Python offers things which other languages don't. At the same time it lacks some things which other languages do. It is in any case one of the most popular languages, for good reasons (and in spite of its inherent drawbacks)
Sure! This is not about dividing the world of languages into good and bad programming languages. These are just tools after all. Python is definitely is a great language. Otherwise, it would not be as widely used as it is. I am just reading through the docs for Backtrader, which are sincerely of very good quality, and I am seeing that Backtrader had to make up for some Python limitations w.r.t. operator overloading, inheritance and multiprocessing, for example. I also came up across a forum discussion stating that people usually use Backtrader for prototyping, but for production, the strategies usually get re-implemented in java . Hence, my question whether this was a consideration at some point. Surely, the numerical and data science libraries in Python are unmatched by the available libraries for Java and C#.
All languages have limitations as to what can be overloaded and what cannot be. The
orlogical operators in Python are an example in Python of what cannot, due to the nature of the return value and how something is considered to be
Were one to develop a system for HFT, C++/C would probably be very good choices. HFT is usually carried out by people/entities with deep pockets, given that hardware/software/time investments will be rewarded with huge profits.
The quick development cycles, rapid prototyping, high level of introspection and metaprogramming facilities offered by Python cannot be matched by other languages, at the expense of speed (everything is a dictionary lookup), adding to the offense the lack of real CPU-bound multithreading (
Whether things in production are run in
Javaor something else is in many cases due to the pre-presence of such systems in engineering environments where a product has been bought. This means that if the pre-existing system works rules such as (do apply):
- The acquisition price has to be justified by further using the system
- If the system has proven to work (even with limitations which need workarounds), keep on using the system
- The time/effort invested in having everything integrated is deemed as part of the system price and people are not willing to pay it again
- Integration may run so deep in the house, that other systems may now rely on obscure/buggy/undocumented features that will be difficult to replicate with new entrants.
Many thanks for the detailed answer! I totally agree with most of the points you made. Though, I do think people also opt for Java and other strongly typed languages for other reasons than just ease of integration with legacy systems (stability, speed, better concurrency support, better inheritance support, etc.).
Out of curiosity, how do you see the emergence of languages like Julia? Do you think it has a chance to bridge the worlds of HPC and the development speed of languages like Python and R?
A similar explanation others pick different dialects. It steers clear of it's anything but a decent or an ill-conceived notion. Java, Python and PHP offers things which different dialects don't. Simultaneously it comes up short on certain things which different dialects do. It is regardless perhaps the most famous dialects, for valid justifications and notwithstanding its innate downsides