Follow us
Breaking
Software

Breaking the two-language barrier with Julia for scientific computing

Julia offers a solution to the two-language problem by combining ease of use with high performance. In economic research tests, Julia outperformed Python, MATLAB, and R in calculating standard deviation, while IQDigitec used it to optimize collateral for a $1.4 trillion asset client.

Share

I recommend Julia for researchers who need to escape the two-language problem. Researchers often prototype in slow, friendly Python but, for performance-critical parts, they rewrite code in faster, less friendly languages like C++ or Rust to overcome the inherent speed limitations of their initial scripts. Julia avoids this binary trade-off because it combines the ease of interpreted languages with the performance of compiled ones. In large data set tests for economic research, Julia calculated the standard deviation of returns faster than Python, MATLAB, or R. You must realize, if you already know how to optimize code, that your first Julia script will likely be slow if you do not use specific performance tips. If you put your code in a function and fix the loop order, it becomes more than 30 times faster. You can make it another 2x faster by eliminating the Tk-1 array or achieve a factor of 3 more speed by using the LoopVectorization package. Python is terribly slow, a flaw that even its most ardent defenders would not deny. In GARCH log-likelihood speed tests, C was the fastest, followed by Python with Numba, then Julia, then MATLAB, and finally R.

The ecosystem and documentation reality

The assumption that Julia possesses an ecosystem as vast as Python is false. Python maintains the largest community and the most developed packages for scientific computing. While R provides the best library support for finance, Python remains the best for machine learning and data pipelines. Julia’s library ecosystem is growing, but it remains less mature than Python or R. While MATLAB documentation is best in class and easy to search, Julia’s documentation is the worst because it focuses on computer science arcana instead of practical uses. Python documentation is also inferior because it focuses on computer science theory rather than applications. In loading speed tests for large data files, R was the fastest, followed by Julia, then Python, and then MATLAB. RedMonk rankings show Julia has climbed to 31, but it remains far from the top.

Enterprise scaling and parallel tools

IQDigitec successfully replaced the legacy APL language with Julia to optimize collateral assignment for a multinational insurance client with $1.4 trillion in assets. This implementation beat APL benchmarks for speed and achieved better governance through auditable code. The team analyzed alternatives including Python and R, as well as MATLAB, before choosing Julia to execute compute intensive matrix math for optimization scenarios involving large volumes of alternate solution sets. The implementation addressed the complexity of multiple counterparties and the numerous dependent conditions that govern the valuation of thousands of different collateral instruments. To minimize the pool of liquid assets needed to collateralize future liability exposure, the project managed thousands of bond instruments in multiple combinations. Because the client is a market maker for fixed income instruments, they manage large value non-cleared OTC derivatives with counterparties among the top 120 banks in the world.

Parallel Computing Paradigm Functionality
Asynchronous Tasks Maximize efficiency within single threads
Multi-threading Leverage multiple CPU cores
Distributed Computing Scale across multiple machines
GPU Computing High-performance GPU programming

For teams needing to scale, Julia supports several specific parallel computing paradigms. You can use the @spawn and @threads macros for multi-threading or @distributed and pmap for distributed workflows. This allows you to turn 9-second sequential processes into 3-second concurrent execution. Is it possible for Julia to reach the same level of documentation quality as MATLAB?

Share

Technewsdaily

Senior tech writer covering AI, gadgets and cybersecurity. Breaking down the news that matters, every day.