Julia written in Julia?

With regard to the overall compiler discussion, I have these thoughts:

Julia has a lot of implementation languages:

  • Scheme for the parser
  • C for the runtime.
  • C++ for LLVM
  • Julia (because the first thing the parser does is convert a lot of of syntax into simple function and macro calls).

My opinion is that Julia doesn’t need to be rewritten entirely in Julia, but that there is virtue in minimizing the number of languages used in the implementation of any technology.

The parser is the easiest to replace with statically compiled Julia. Julia is almost a dialect of Lisp already (minus TCO, grumble grumble). The benefit of this is that Scheme is already the most obscure of these languages–aside from Julia itself of course, but we can take for granted that anyone interested in contributing to the compiler is already familiar with Julia. Scheme is a beautiful language, but it’s expendable as far as the Julia implementation is concerned.

While C++ is my least favorite language of those in which Julia is implemented, it’s the hook to LLVM and the most difficult to replace. (though, Rust was originally implemented OCaml and is now implemented in Rust, so I guess it’s not impossible)

On the other hand, converting C to the common subset of C and C++ isn’t the hardest thing in the world. On the third hand (ran out of hands) maybe C and C++ are similar enough that we could consider anyone who knows C++ also knows C (this is manifestly not the case, but maybe it’s close enough?)

In any case, I would be happy to see Julia be implemented in Julia and X lower-level language, since Julia isn’t the ideal language for granular control of memory or LLVM interop (yet). It looks like C++ is X language at this point.

The point of all this is, we may not need Julia in Julia, but are there any prospects for reducing the number of implementation languages? LIke, ideally to <= 2?

Of course, I’m not suggesting that *I* do these re-implementations. Don’t be absurd! My C is mediocre, my Scheme is insignificant and my C++ is non-existent. I’m merely suggesting that everyone else should implement the language exactly as I propose. Snap to it, boys.

8 Likes