liveBook · Manning

Two-language problem

As explained in Julia as a Second Language

The two-language problem is the need to combine a productive high-level language with a separate lower-level language to obtain both development convenience and performance.

The two-language problem arises when one language makes it easy to develop and experiment, but another is needed to make the finished program fast enough. In scientific computing, an interactive, dynamically typed language can help researchers iterate on large datasets. Performance demands may then force them to rewrite parts of the solution in a statically typed language. section 1.3 section 1.9

Julia aims to remove that forced rewrite by combining interactive development with high performance. Avoiding the two-language problem does not mean avoiding other languages altogether: existing Python, R, C, C++, or Fortran software may still be worth using rather than rebuilding. section 1.9 section 1.5

A climate-model rewrite

An MIT group rewrote part of a Fortran climate model in Julia. They were prepared to accept a threefold slowdown in exchange for a more productive high-level language; instead, they reported a threefold speedup. The point is not that every rewrite will speed up, but that choosing a productive language need not require accepting poor performance. section 1.4

How Julia as a Second Language covers it

How deep it goes
Defines the productivity–performance tradeoff and illustrates it with a reported rewrite, without giving an implementation procedure.
Examples
Uses a partial rewrite of a Fortran climate model that reportedly ran three times faster in Julia.
What you can do after
Evaluate/understand when Julia could avoid a performance-driven rewrite while still benefiting from existing libraries in other languages.
How it connects
Links dynamic typing, static typing, interactive programming, performance, and interoperability.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Julia as a Second Language. The section links point to the parts of the book it draws on.