# Examining an older and simpler version of Julia

**URL:** <https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142>\
**Category:** General Usage\
**Tags:** question, history\
**Created:** [December 24, 2016, 10:09pm UTC](https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142 "2016-12-24T22:09:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pitao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pitao/32/116_2.png) [@pitao](https://discourse.julialang.org/u/pitao)\
**Post date:** [December 24, 2016, 10:09pm UTC](https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142/1 "2016-12-24T22:09:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihnorton/32/26_2.png) [@ihnorton](https://discourse.julialang.org/u/ihnorton)\
**Post date:** [December 25, 2016, 5:12am UTC](https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142/2 "2016-12-25T05:12:58Z")

</div>

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

- the first 10-20 commits: basic parser
- beginning of codegen: [https://github.com/JuliaLang/julia/commit/17f383fec059f](https://github.com/JuliaLang/julia/commit/17f383fec059f)
- beginning of dlopen / ccall support: [https://github.com/JuliaLang/julia/commit/18f456233b280f](https://github.com/JuliaLang/julia/commit/18f456233b280f)
- beginning of ast translation to C: [https://github.com/JuliaLang/julia/commit/89247a6bf2eeb](https://github.com/JuliaLang/julia/commit/89247a6bf2eeb)
- beginning of interpreter: [https://github.com/JuliaLang/julia/commit/6c2b43c2b3e2986b](https://github.com/JuliaLang/julia/commit/6c2b43c2b3e2986b)

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](https://discourse.julialang.org/t/run-the-half-life-of-code-analysis-on-julia/763).

A few other comments:

- read the [dev docs](http://docs.julialang.org/en/stable/#developer-documentation)!
- watch [Jeff’s internals talk from 2014](https://www.youtube.com/watch?v=osdeT-tWjzk). 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](https://www.cs.princeton.edu/~appel/modern/ml/) 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](https://racket-lang.org/) 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)

---

<div class="post-metadata">

**Author:** ![pitao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pitao/32/116_2.png) [@pitao](https://discourse.julialang.org/u/pitao)\
**Post date:** [December 25, 2016, 9:24am UTC](https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142/3 "2016-12-25T09:24:47Z")

</div>

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)](https://www.youtube.com/watch?v=2CdtvRKVuhE) – 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!

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [December 25, 2016, 5:56pm UTC](https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142/4 "2016-12-25T17:56:15Z")

</div>

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](https://github.com/JuliaLang/julia/blob/17f383fec059f87bef490e57b388c6a0fb113bb0/int.j)

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [February 6, 2017, 9:09am UTC](https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142/5 "2017-02-06T09:09:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [February 6, 2017, 9:01pm UTC](https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142/6 "2017-02-06T21:01:56Z")

</div>

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` 😮

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [February 6, 2017, 9:11pm UTC](https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142/7 "2017-02-06T21:11:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [February 6, 2017, 9:50pm UTC](https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142/8 "2017-02-06T21:50:28Z")

</div>

The current incarnation of macros was introduced here:

[https://github.com/JuliaLang/julia/commit/a1b9fee4e72e8438693eddc25d769fab4cc98c9d](https://github.com/JuliaLang/julia/commit/a1b9fee4e72e8438693eddc25d769fab4cc98c9d)

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

[https://github.com/JuliaLang/julia/commit/3e6fcd19b805f0fbc713a06a3e6ddb3f88da1b89](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](https://github.com/JuliaLang/julia/commit/b03aaade41a95b4233a7b65a043b387d4e5ba73b)

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