Examining an older and simpler version of Julia

question
history

#1

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 @viral @Keno @jameson @mit.edelman et al.) point to any particular moment(s) in time that would be of educational benefit?


#2

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)


The role of femtolisp in Julia?
#3

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!


#4

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.:


#5

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


#6

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:


#7

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


#8

The current incarnation of macros was introduced here:

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

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:

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