Curated Series: Learn Julia

As I am required to develop all kinds of high-performance computing solutions, I am increasingly bothered by the limitations of Python’s Global Interpreter Lock and memory management. Its slow speed forces one to make weird workarounds so that the utilization of packages written in C can be maximized. This usually results in poor memory complexity and inferior speed. Recently, I learn about the Julia programming language, which targets to be a language that has excellent performance with high development efficiency. It is widely used among the scientific computing community. This series is a documentary of my Julia learning process.

Julia: Hello World

Let’s begin with the biggest cliche in the programming world.

Julia: Flajolet-Martin Algorithm

I choose to pick up Julia because of its high performance. The problem for Python is that it works nicely 95 percent of the time, when all the computationally expensive operations can be replaced by function calls to C libraries. However, it fails completely when the rest 5 percent of nasty situations show up. Recently, such an annoying instance just showed up for me. I am trying to migrate my code to Julia to see if there is a performance boost.

Julia: Calling C Module

In one specific task, I need to extract the DCT coefficients from a JPEG image and export them into Julia. Since there are a number of existing C libraries that are capable of doing this, it is more convenient to call them directly with Julia.

The Awkward Case of the Julia Language

Since last year, I happily started to learn Julia, hoping that this promising language will drastically increase my work efficiency and change the way that I work. Unfortunately, I find out that the reality is hardly similar to what I expected. So far, my conclusion is that there is barely a situation where using Julia can consistently boost work efficiency.

Managing Objects in OpenGL Smartly

A large proportion of my OpenGL coding style comes from learnopengl, which is a wonderful website for GL beginners. Props to the unselfish author, Joey de Vries, for keeping and sharing such wonderful contents.

One of the biggest obstacles of using OpenGL is the huge amount of code needed for a simplest project: check out the program of drawing a static triangle, which has ~180 lines of code! As it turns out, trivial works in OpenGL, such as compiling shaders, linking programs, declaring VAOs, contribute to a huge amount of code. If we can somehow construct a template to simplify these highly similar procedures, we can greatly speed up the development efficiency of (simple) OpenGL programs.

Because I am trying to explore Julia’s potential to write graphics programs, the examples in this article are written in Julia. It is worth noticing that these design can be extended to other languages as well, especially those that are object-oriented.