In school, and at work, math has always been tons-o-fun for me. All 6 programming languages I have had to use have all been rather easy and fun as well (not counting Prolog; thank you so much Athens State…)
It’s been over three years now and I’m still not getting it. And I was always in the upper percentile for the maths. So, at 72, is my brain simply withered up? Is there an on-line, human based math course I can take to get Julia to stick? (I’ve only had up to Calc II).
Of the 5 books on Julia I’ve read and (tried to) study, almost none of them relate to the code that I see on Julia.
Oh, and C is my all-time favorite, if that helps.
well something to make you feel better, I have also started Julia and am also new to it, and I have been trying to proactively developing stuff and it does ease a lot of stuff, and there are lot of good series on yt, Julia is simple, you will do it
and bro ofc C is goat, can never forget that beast
If you are more specific about what you are not getting, you are much more likely to get useful help.
There are courses that use Julia, but usually they are on numerical methods, not “math”. That said, they are unlikely to be the best introduction to the language, usually it is about the subject domain, Julia is just the tool.
You may also want to check if the tools you use are right for you. Choosing the right IDE can make all the difference in how you approach a language, because they tend to do the ground work for you and you spend more of the time working on your core concepts.
And yes, i know i am saying this as one of the creators behind them, but I mean it: good tools make all the difference to how accessible a language is.
Adding to that: you may also try using jupyter or pluto notebooks more often. They show you results instantly and in a form that is easy to follow and you can split up your work in multiple cells and add notes. So it is a bit more structured than running a full project. And you can migrate them to standalone programs later as well…
The SGI debugger is the best I’ve ever used. Intuitive, fast, display variables of any type in your code, insert “test code” and test it without changing the actual source.
VS Code was handy, especially for correcting and improving 3D Printer control code. A bit of learning curve but not terrible.
The Julia books I’ve read/studied range from the very basics to the red one that is all about code optimization for speed of execution. It is very heady and I enjoy it a lot.
The typical Linux debugger is quite good but falls short in displaying arrays and structures; but then I have not used it for several years now so it may me better now.
Tried playing with Jupyter and it’s ilk but they are certainly NOT intuitive.
Biggest trouble I have is when looking at others working code, as in some of the packages, but their code is NOTHING like what the books display, as if they are a totally different language!
Maybe I’m mixing C concepts and practices with Julia norms in my head. Not sure.
Oh yeah, have logged HOURS of yt Julia “training.”
I find that really well written code often diverges from textbook examples. Experienced developers tend to get a feel for performance relevant optimizations, best practices, code structure and when or when not to use generic functions. Many leave little documentation behind, because “good code is self explanatory”. And then there is also something to be said about getting something done over “prettifying it”. So real-world examples may very much look different from whatever you see on YouTube.
That said, I’d still argue that for getting a feel for a language you are best served working away with it. 3 years is a lot of time and I believe you that you put it to good use. So I still bet that once you found a better rhythm, your own code will improve. If Jupyter notebooks are not to your liking, work more with REPL or the interactive windows, Pluto or Run/Debug sessions with hot-swapping enabled via Revise. Whatever makes it easy to see results and happy to try things out, is the best move forward.
I don’t know about you, but my personal gripe with Julia is just the time spent compiling, so any of the mechanisms that work around that are making me happy - and the ones listed do.
It’s hard to say where you’re stuck, is on the math, which math then? Or Julia, the typing system etc.? While I learned some linear algebra in one course (back then with no computer support), it’s now taught in many different ways with computers and visualization, and I guess these could help:
I’ve not read them, but I did buy this one and read or scanned and can recommend:
Tanmay Teaches Julia for Beginners: A Springboard to Machine Learning for All Ages. McGraw Hill, November 2019.
For me Julia was at first very intimidating because a lot of the packages and discussions here were very math heavy. But you can also use Julia for non-technical computing, e.g. web programming. For my background at least I would say, then it’s not a much harder language, in some sense easier than C, and you can go to similar low level and fast.
Julia enables linear algebra like MATLAB/Octave (or Python with numpy), but if you’re not familiar with such languages, or packages like numpy, maybe only Python without, then it’s going to be harder. Not so much because of the language, just because of the math.
Not stuck on the math, stuck on resolving the actual code in packages/examples as compared to the books that are guiding me. Been programming in C for decades, as well as DBMS’s, so there is some actual programming background (since 1977.)
The Tanmay reference is new to me. Will try to find it. The two Julia primers I have studied are straightforward enough. Except for twisting my head, eyes, and ears around the multiple dispatch because it is SO opposite that of C.
I probably just need a project that I can immerse myself in using Julia and make that work. All my other languages are self-taught as well. My customers and supervisors seemed to like my work. The Army tried to recruit me as a civilian but I will not work or live in Virginia or California…
Book authors and package authors have very different goals. (Source: I do both.) In a textbook, clarity, conciseness, and integration with the exposition are top priorities. In a package, clarity is still important, but so are efficiency, robustness, generality, etc.
For example, in my intro numerical methods text, I never decorate input arguments with types, because that’s of little consequence compared to other things the beginners absolutely must learn. But when I write a package, I may get specific with input types if I want to control dispatch or ensure type stability. In-place versus allocating is another topic I tend to leave out for beginners but watch more carefully in packages.
You might find an advanced course that covers such things, but the audience is so much smaller and more fragmented that it’s hard to justify investing time on sharing them. LLMs are not improving that value proposition. People on the frontier are generally teaching these elements to their own PhD students and postdocs.
Historically and currently, the way to learn to code like in the packages is simply to do it. I used to write only Julia code that looked a lot like MATLAB code, but over time and as needs arose, I picked up new tricks.
C was my first “real language” too (a brief exposure to FORTRAN in 1965 didn’t take) and when I took up R 20 years ago, it was hard going because my C-mindset was relentlessly imperative/procedural. It took a dose of Haskell to get me to see that R presents to the user as a functional language even though under-the-hood it is a fairly simple imperative. The paradigm is just y=f(x).
Same with Julia and when I became interested a couple of years ago that orientation found its home. See if that helps.
(I’m 79, so being a leading edge Boomer is no disqualification.)
Hard to know what this means exactly, but it’s very common for a language support many different and sometimes domain-specific programming styles. As tobydriscoll explained, books and YouTube videos for teaching tend to stick to an easier, “superficial” style to get us started. It also doesn’t help that Julia itself has gone through significant upgrades; at this point I wouldn’t recommend any source prior to v1.9, and that still omits a bunch of neat stuff I use every day. The most updated sources on the language would be recent announcements, highlights, and the documentation, and even the docs has sections in serious need of highlights or updates and won’t cover all the esoteric internals some packages resort to.
Maybe, and it might be fruitful to review the fundamental differences your intuition points to. Tamas_Papp is right that if you have more specific questions about how Julia works, it’d help readers help clear it up. You mentioned multiple dispatch so far, have you worked with a language that has function overloading e.g. C++? Basic multiple dispatch is like that but resolves for the runtime input types, whether inferred at compile-time or checked at runtime. Like any language feature, only use it when it makes things easier; plenty of Julia functions only need 1 method.
Think I have multiple dispatch down. Renamed, would be, “synonym”, or maybe “alias that procreates.”
Yeah, taking the simple stuff from the primers, and replacing the words used in actual programs is a daunting task. Especially the “.” usages. Extremely powerful, but -wow-!
Ok, this may be my method alone. When I started with Julia, I picked up a few of my old C programs and translated them. Then I refactored them so they looked more like Julia than a C program trying to get by in a different country with a new language.
I knew what the results should be. I knew where the corner cases were. I did not use an LLM - just books or the online reference.
Now the math stuff is a bit different. One program I had did a direct conversion to a Fourier series, did some convolutions, and then inverted the result via numerical integration. The tools are a lot better today. First I did a direct translation and then I worked through several FT options in different packages. Learned a lot, not sure I made the best choices at the time.
Is there an on-line, human based math course I can take to get Julia to stick?
Is not specific enough as it depends on what you are trying to achieve. What branch of mathematics? Primarily, you seem to asking for a math course, not a course on Julia. Perhaps try a math forum and if you find a problem you want to cast into Julia, I am sure someone could help.
My fav book on Julia has no math whatsoever, but it teaches you how to write good Julia code and how to take advantages of the Julia design ethos (e.g. traits) . : Design Patterns and Best Practices with Julia
I also think, if you are a seasoned programmer, the Julia Documentation is amazing.
I also spent many years with C as my main language, but also spent time using MATLAB for math, bash for all sorts of shell pipelines and a few other languages before getting into Julia. It took me some time to go from curiousity to really investing time in getting my head around it. Now I think I understand many of the core concepts but one of the things I find jarring when going from C is the macros. I suppose you can also say this about C preprocessor macro functions, but in general a lot of packages add their own “syntactic sugar” macros to make it easier to use them. To me it’s creating a new Domain-Specific Language per package, and knowing Julia syntax won’t teach you the macro syntax. As someone who understands C and likes to know what’s going on under the hood, I find that the macros add a bit of “hidden magic” that obfuscates my understanding of what the code is actually doing.
So if you see a package with ‘@’ in the code, that’s at least one reason why it’s harder to follow than the simple examples
I genuinely don’t understand what the hurdle is. On the surface, Julia is not very different from any of the Algol 60 family languages (C, C++, Java, Python, Perl, …). If you have seen one you can pick up the syntax quirks of any other quickly and be able to read it.
Julia does nothing special here; its magic is in multiple dispatch combined with parametric types and an AOT compiler.
David, I am 84 and use Julia all the time as my hobby programming language.
Here are my tips for you to initially learn Julia:
Use an IDE to make manipulating the program more enjoyable. I use VSCode which you have used.
Many scientists use the REPL to test little snippets etc. I do not and have found it more trouble than just changing the script in VSCode.
Make every script have a Main function that runs everything in the script. This will make the program run fast.
Forget about modules initially. They are hard to comprehend and can be supplanted by just calling in another script.
Learn how to create and use arrays.
Write your loops out manually. The magic in loop fusion only saves a few keystrokes and fogs up the mind. Unlike other languages like R and Python, loops in Julia are very fast.
I don’t use a debugger, rather just sprinkle in print statements.
Do not worry about multiple dispatch. This only comes into play in complicated scripts.
You are thinking too much about the correct way to program in Julia. Just do simple things and the the techniques will sink in.
Do not try to convert over a C program to Julia. Go to Wikipedia and get a template algorithm which you can then program up in Julia. A good one to start with is Golden Section Search. Do that and the creative juices will drool.
I have programmed in: Fortran, Cobol, Java, Basic, C#, Ruby, Python, and finally Julia. Hands down, Julia is my favorite and will be until my mind withers!