What in Julia is done in C?

I know that a force of Julia is that it is high level and yet, you can code low level routines natively in Julia and still obtain good performances, whereas in Python, you would be advised to bind and wrap C or Fortran code to obtain similar performances. At the same time, I hear and read that Julia is mostly written in C. However, what I do not understand is what is natively written in Julia and what is not, i.e., what is written in C? For example, say linear algebraic operations. In Python, every operation between NumPy arrays is actually coded in C, I think the same goes for Matlab, what about in Julia, does a matrix-vector product run C code or not?

Where do you get that information? Here’s the Julia language repository breakdown from GitHub:

image

The C part is largely very low-level internals like garbage collection and codegen (interfacing with LLVM; a C++ project).

3 Likes

Much of the Julia standard library is written in Julia itself, e.g. even things as basic as complex number arithmetic or fancier things like sparse matrix–vector multiplies and printf formatting

However, of course there have been decades of engineering effort poured into mature libraries, and we want to exploit those where possible. So, Julia uses pre-existing libraries (mostly in C and Fortran) for things like:

This is not because such things cannot be implemented in Julia, but more because we are mainly interested in using Julia to implement new functionality rather than simply re-inventing the wheel by replicating mature existing code.

24 Likes

(It depends on how you count. It’s true that the Julia implementation required little new C/C++ code.
However, we of course also utilize existing libraries as mentioned above, and these aren’t included in the github stats because deps/Makefile downloads a bunch of external libraries at build time.)

3 Likes