A plea from an old scientist for someone to write the Kernighan & Ritchie of Julia

I don’t learn from videos. I read. Back in the Stone Age days of my undergrad, they first taught us Pascal and then PDP 11 assembly. I then worked in a lab programming PDP’s in assembly Since then I’ve programmed extensively in C, python, R, and dabbled in a a half dozen others.

When I wanted to learn the newest hot C way back then, someone handed me a copy of Kernighan and Ritchie, and that was that. 150 pages plus appendices. Read through it a few times and worked through all the examples, and that was enough to get the syntax and basic patterns learned and to start programming .

All I want is a terse 150 pages to explain the syntax and basic idioms. All the current books (and I believe I’ve looked at them all) are too verbose and deal with too many other issues in parallel. I don’t need chaptersstrong text explaining why I should learn Julia - assume I know why. I don’t want to learn about handy libraries and shaving microseconds off my code. I can learn all of that later after I have the basics mastered, and all of that can be put into appendices.

Yeah, the documents are excellent and clear, but too unstructured for what I’m after and also intermix numerous extraneous issues. They don’t address the basic goal of juststrong text giving a clear, concise, and thorough linear introduction for someone completely new to Julia, but is an otherwise a relatively experienced programming who just wants to sit down with one source to work through learn the basic syntax and idioms.

Maybe this exists and I just haven’t come across it. Tell me about it if the K&R of Julia already exists. Otherwise, please, someone write it!

9 Likes

I don’t think such a resource exists, and I think you’re right that it should. I think the quickest way to go from C/C++ to Julia is probably Noteworthy Differences from other Languages · The Julia Language, which combined with reading a simple library or two to see what idiomatic code looks like (Primes.jl is pretty good for this).

I do think K&R is of a very specific era from when a lot more was very up in the air. I think if I were to try my hand at a definitive Julia book it would likely be shorter than K&R (at least in core), and would probably be called “Julia ex Nihlo” and would largely focus on how Julia (fairly unlike C) has an incredibly small core, with almost all of the much more expansive language being built on top of these primitives from within Julia itself.

If I had a few people that wanted to be coauthors, I might actually take a stab at this. It sounds like a fun time. Maybe a JuliaCon hackathon project?

23 Likes

Feel in 2 minds in replying to you publicly, because of course nowhere close to the quality of the publications you cited about C, but ny online "Concise tutorial" and the “Julia Quick Syntax Reference” book that followed (of which you can easily find the PDF online..) have quite at least the objective that you describe: go quickly to the syntax for people that already know programming in other languages..
(you may me interested in the first part, the second one is about the scientific ecosystem)

7 Likes

I too learned C from K&R, and prefer to read reference manuals rather than some verbose text based on somebody’s intuition which I do not share.

I like the idea, though learning julia from Base.Core.Intrinsics and the type system is somewhat like learning LaTeX from initex. (I learned TeX from Knuth’s The TeXbook).

I could be interested in joining such a project, though I’m not at JuliaCon.

It’s not exactly what you’re after, but I’m steadily compiling a brief introduction to Julia. It’s designed for beginners in programming, but I try to introduce key concepts efficiently and include exercises and problems. The goal is for students to get up and running quickly to do analysis on their experimental data in our lab, so I don’t spend a lot of time with anything they won’t immediately need to use. I keep the course very short.

It was originally just lectures notes for students in my lab but now I’m having others teach Julia, so I needed to write something a bit more complete. This is an ongoing project so it’s still very rough.

In any case, it’s at the point where it might start being useful for others outside of my lab.

On your point about “why Julia”, I include a brief section on this because students ask why they can’t just use Excel or even Python, and other teachers don’t understand why I’m teaching this language no one has heard of (in my university). That’s at least my reasoning.

5 Likes

The manual is pretty close to that. It is a bit more verbose, but you just skip the parts you don’t need initially. Reading it up to conversion & promotion is about 200 pages in PDF (though I would recommend HTML), and gives you a good introduction to the language core, which you can build on and read what interests you on demand.

That said, unless you were exposed to a language with multiple dispatch before (Common Lisp & friends), understanding the motivation for various features of methods and the type system may be valuable. Similarly, unless you are very familiar with the concepts of asynchronous programming, sources that add a bit of background help a lot.

Also, keep in mind that Pascal, C, R, PHP, Perl, JavaScript, etc are either very simple or not performance oriented. Julia is quite complex, and makes it very easy to end up with non-performant code it you don’t understand how things work. This is not about

but ending up with code that may be 100x slower if it is not type stable etc.

10 Likes

It’s not 150 pages (about 1/6th of that), but the Julia appendix to the Algorithms for Decision Making book is a no-frills dive into the language that I found very useful as an experienced programmer new (at the time) to Julia. It maybe a bit too terse though for what you’re looking for - its scope is also probably only 1/6th of your ask - but it’s a pretty good start.

7 Likes