What do we have to attract C++ or other languages' power users to try Julia?

I know threads about increasing Julia’s adoption among the general programmer population have been done to death. I’m not making another one of those threads. Instead, this thread would focus on the top 1% of programmers. Moreover, to maintain the focus, I would like this thread to be about what Julia has that would attract these power users, not some hypothetical “What could we do?”.

One of Julia’s main strengths is easy high-performance computing. However, imagine you were a C++ expert at the moment.

Julia offers generic and metaprogramming. Well, C++ with templates, decltype, auto, etc, offers an extremely powerful generic and metaprogramming capability, and C++ experts would not need them. Moreover, while people might argue that not many people master these features, they might argue that you only need to know basic C++ to use the libraries they wrote, even if they used these advanced features behind the scenes.

Julia might make it easier to write high-performance code, but for C++ experts, they are already really comfortable with all the nooks and crannies of C++ and how to squeeze the performance through compiler options, intrinsics, etc. They would not find Julia very useful in this regard, especially if they found out that Julia is only 95% as fast as C++, if not slower.

Julia could also boast its package management and tools such as physics simulation, etc, but it’s not like the C++ folks don’t have their own, and even if it’s harder to use for normal people, the first point is that a lot of these things (like finite element analysis) are already hard no matter the language. The second point is that if you’re well-versed in high-performance computing, you’re probably already well-versed in C++. The final point is that a lot of times, the interface is no code at all, and then, the point that it’s easier to use these packages is moot.

What do we have to turn the tide?

As much as we love Julia over languages like C++, Java, maybe Rust, etc, we have to acknowledge that these languages, in the right hands, are very powerful. It would take some serious work to convince them that Julia is a good language. Micro-benchmark tricks and other gimmicks probably don’t work because it would probably take them <10 hours to get what they wanted in their languages, even if it’s easier in Julia. You need something where it’s pretty much not viable for them to make it work in their languages. That is pretty hard because, again, those languages, in the right hands, are very powerful. Even if the parallel features in those languages are harder to use, for power users, they could figure out ways to make them work.

I myself have coded a bunch of gimmicks that would be really hard for me to do in other languages, but again, that assumes my perspective. We’re talking about power users here.

So, back to the question. What do we have?

1 Like

Creating a programming language takes a lot of work, and people wouldn’t do it if they didn’t believe it is good or even the best (at something). So I’d argue that almost all programming languages are ‘good’. If an expert programmer in some other language refuses to accept even this (after brief argumentation), trying to convince them to try out (cf. title) or switch to Julia is a lost cause.

Sure, but if you can demonstrate that what takes an expert 10 hours in C++, only requires 1 hour of development time in Julia for almost the same performance, then that’s a solid argument. This is the same argument as advocates for Python would use. The fact you can easily experiment in the REPL is a powerful selling point. And in contrast to (pure) Python, Julia can be very performant. Hence, Julia gives you fast code fast. (Though to be more modest, the argument of solving the two language problem is more that you can quickly write prototype code in Julia, the essential parts of which you can then iterate upon (optimise internally, without switching language) to become very performant.)

4 Likes

I used to be a pretty competent C++ programmer. I am no longer that. While it was fun to spend entire weeks talking to labmates about how to micro-optimize some bitsets or other obscure code, I enjoy even more just doing using SomeLibrary and making things faster.

What do we have? I suggest you look around, Julia has a lot. A small list for you to ponder.

I have no idea what is a power user or “top 1% of programmers”. That doesn’t seem like a healthy way to think about adoption. I see university classes and labs adopt Julia and that tells me enough, that the next generation of programmers and scientists will be using it, and that’s good enough for me.

6 Likes

Julia has a number of technological limitations:

  1. Garbage collection - which does not allow you to stack data in memory as desired, thus making it difficult to write fast algorithms that depend on cache-friendly.
  2. heavy runtime - GC and the need to carry a compiler and environment make Julia unattractive for writing libraries (outside the Julia ecosystem) compared to C++ or Rust. For example, if I wrote scientific code in Rust, using PyO3 and jlrs I can easily bind to Python and Julia and share my code with my coworkers. If I want my code to work in production on big data, I just use plrs and make an extension for Postgresql. A lightweight runtime allows you to put and run your code anywhere.

There are also a number of aesthetic compromises in Julia:

  1. indexing from 1. This is not something you couldn’t get used to. However, this solution often causes annoying errors when serializing/deserializing data between peers in other languages.
  2. Lack of postfix notation as a language base. Often we know what data we want to work with, but we don’t know what function to use to do it. And for ordinary programmers who do not feel piety before mathematical notation it is often more pleasant to call a.sin().ln() than ln(sin(a)). After typing . the autocomplete will obligingly provide all available methods for working with the variable a. And it’s easier to read.
  3. I won’t talk about weak encapsulation and lack of static(stable) interfaces or their analogs.

As I see it, Julia was developed with Matlab in mind. That is, as a language for scientific calculations, not as a language for writing programs for scientific calculations. Therefore, adapting the language and technologies of Julia will require modifications in Julia 2.0. And these modifications may not be to the liking of the current community.

1 Like