Examining an older and simpler version of Julia

I would like to gain a source-code level understanding of how Julia works. (I understand it’s going to be a lot of work!)

With Github one can examine each moment of Julia’s history.

There must be points at which the source code was much simpler yet still illustrates the same basic engine.

But there have been many thousand commits…

Could one of the developers who have worked from the earliest days (@jeff.bezanson @StefanKarpinski @viralbshah @Keno @jameson @mit.edelman et al.) point to any particular moment(s) in time that would be of educational benefit?

I haven’t been around quite that long, but here are a few interesting points to look at:

You can get a nice view of the earliest history by running git log --follow FILE (and then shift-G to go to the end).

That said, don’t spend too much time looking at the history. It is an interesting idea as a way to get a handle on small pieces, but much of the code has changed.

A few other comments:

  • read the dev docs!
  • watch Jeff’s internals talk from 2014. There have been other related talks at JuliaCon since then.
  • if you don’t have any compiler background, from personal experience I can recommend not trying to learn compiler theory by osmosis. I wish I had read Appel much sooner than I did. There are many interesting compilations of free resources you will come across on stackexchange/hacker news/etc., and I had read some of those – but frankly there is no substitute for a good book.
  • don’t try to learn Lisp/Scheme using flisp. Racket is close enough to be transferrable, but has a more user-friendly environment and many more resources.

(FYI: in the future, please don’t @-blast people with general questions. It’s kind of bad form)

10 Likes

Thanks, that’s exactly that kind of stuff I was after!

PS I am aware from IRC of the netiquette-fail-by-ping-spamming. In this (unusual) case I was deliberately pinging the 6 core devs sitting at Q&A: Julia Core Team Panel (JuliaCon Aug 2014) – if each of them has glanced through the thread, there is a good chance a strong learning resource will result. I hope it won’t upset anyone, but my apologies if it has!

In addition to the internals, I think it’s fun to see how the language has evolved. Looking at Julia code that far back, is quite fun. It’s very recognizably Julia, but yet eerily different, e.g.:
https://github.com/JuliaLang/julia/blob/17f383fec059f87bef490e57b388c6a0fb113bb0/int.j

3 Likes

Back when Unions didn’t have Unions! Make Julia Great Again!

Those aren’t unions – back then {...} was a syntax for literal Array{Any} construction. We got rid of that since it seemed like a waste of syntax. So those calls are passing a type and an untyped array of types to the def_binary_op macro – which is called using function syntax, rather than the current @m macro call syntax. Also note the file extension back then was .j :open_mouth:

Oh, I see. I can see the @assert macro was present in 2012. Got a quick guesstimate of when the @ was introduced?

The current incarnation of macros was introduced here:

https://github.com/JuliaLang/julia/commit/a1b9fee4e72e8438693eddc25d769fab4cc98c9d

There was, however, temporarily another macro system, introduced here:

https://github.com/JuliaLang/julia/commit/3e6fcd19b805f0fbc713a06a3e6ddb3f88da1b89

That was ten days before the above commit that Keno linked to, and the first “simple” macro system was introduced specifically to do things like def_binary_op. The simple macro system was removed again here:

https://github.com/JuliaLang/julia/commit/b03aaade41a95b4233a7b65a043b387d4e5ba73b

As you can see, macros in Julia are very much a @jeff.bezanson thing.