Issues encountered teaching classes with Julia for the first time

I knew the second part. The question then is more of a documentation thing: how to find this information when needed.

The first place to look would probably the documentation, specifically the part on installation:

https://julialang.github.io/IJulia.jl/stable/manual/installation/#Installing-IJulia

5 Likes

I’ve played a bit with it, but haven’t used it seriously. But it looks like the Pluto developers are quite open to ideas like marking cells for manual execution resp. introducing barriers, so there could be some interesting developments there.

1 Like

If so, then they have changed their tune a bit (in a welcome shift!). It was their obstinance on this issue tha prompted me to go to the trouble of creating Neptune in the first place (at considerable time, trouble, and expense). If you want something which is not fancy but ‘just works’, Neptune is a good option.

People have been trying to negotiate with the lead developer of Pluto for nearly a year now on this point, and he keeps talking about how difficult it would be … the truth is that it is not difficult at all… he just doesn’t want this kind of feature (hates the idea… he told me so himself before cutting communication). I think there is an avoidance of saying ‘no’ so as not to alienate followers, but (I predict) there will be more prevarication and little movement on this point.

Well, I don’t know the history here, so I can’t possibly express a qualified opinion.

My personal impression from my recent (and first) exchange with the Pluto team is that they are interested in widening the applicability of Pluto, and interested in feedback and new ideas that will fit in with the philosophy behind Pluto.

1 Like

I think the key is the last phrase you mention above ‘philosphy behind Pluto’. I see the lead developer as virtually a ‘reactivity’ fanatic… that is the only reason Pluto exists… static execution (or barriers) is diametrically opposed to his ‘vision’ and will not be allowed unless a major change of heart occurs.

I have taught programming courses in Julia two times now (for about 30 students each time). I cannot comment on the very specific problems you are having. But my experience was:

The first time I had a lot of problems in setting the environment for them to work. The computers of the university had limited disk quotas, and since it was not possible to install Julia system-wide to everyone, using the computers of the university was essentially impossible.

At that time I recommended to most students to install JuliaPro, which came with Juno. Unfortunately I am not a IDE user myself (I use vim and that is it), so when students started having any issues configuring the IDE that was problematic. The resources required by the IDE were prohibitive for many of the students laptops.

The best, less error-free, configuration was to install Julia as a standalone package, put it in the Windows/User path, and install a simpler text editor, I think Sublime was a good choice. I have recently seen cudatext and it seems a very, very, nice and simple option.

So, from a setup point of view, I would recommend raw Julia + cudatext now. Some students which are familiar with sophisticated IDEs install VScode and are happy with that, but I warn them from the start that I cannot really provide support for that.

Concerning the language and the content: In neither of the courses I have dealt with problems solvable with Excel by any means, neither with standard packages of other languages. They were courses to learn programming, and we implemented the integration of equations of motions or partial ODEs, and optimization methods, from scratch. Then at the end of the course we start using the packages. Thus, the motivation of the students was to learn programming, not to learn tools to solve specific problems, and then the issues are of course of different nature than in your case. I think most have found Julia very pleasant, even many of them that had experience with other languages.

What I will change is that next time I will show them a good development workflow using Revise before anything else. That makes programing of Julia much more pleasant. I had the strategy of letting them “play” with the REPL first, but really I don’t think that helps much. It is better to start coding functions in files from start and use the REPL for what it is, test stuff quickly.

10 Likes

I’m also using Docker at times but am not so happy about it. One of the main issues is that Julia within Docker creates files with weird permissions.

Try supporting a class of 50 students where each student decided to use a separate programming language or a tool. I let this happen once (I allowed one of Matlab, Java, Python, Excel, C++), and it wasn’t fun.

8 Likes

Weird permissions might be caused by the fact that Julia runs as root in the official images, as you can easily check yourself:

% docker run --rm -ti julia:1.6-buster bash
root@b616911dfd5e:/# whoami
root
root@b616911dfd5e:/# 

I have a Docker image that adds very little on top of that, but one thing it does is add a user (and Jupyter) and runs as a normal user:
statisticalmice/julia-jupyter

1 Like

I agree with that, and also I think that notebooks like Jupyter or Pluto are just extended and classroom-oriented versions of REPL. Without them you can just run a script file line-by-line and see the results in console, or inlined, or in Plots pane.

But the problem with notebooks is that students attach to it and then have problemns with learning how to organize their code into files, modules, packages - and generally how to design their working environment.

3 Likes

A method I used several times in the past, about 3 years ago last time, was to make a Virtualbox disk image with a Linux system, KDE, Julia, and the kate editor. The kate editor is pretty easy to use first try for just about anyone, and KDE is also fairly intuitive. That method worked ok. It was possible to avoid the “time to first plot” issue by snap-shotting the system.

1 Like

What about a “reset button”, deleting the contents of /.julia or /.julia/environments usually works for me. But after that you have to add all packages again. Also, I don’t know what education program was, but if students had to write their own packages, then maybe package manager could not resolve dependencies for private packages? Also, there might be some problems with version compatibility of dependent packages within one environment.

I taught numerical methods last semester and used Julia within an honors section only (the rest used matlab). They are not representative of the median student, but at least they had very few issues. I was pleasantly surprised. Of course I modeled a lot of coding for them, but either they had few of the non-language issues, or they just handled them.

Many undergrads outside of CS don’t even grasp the idea of a hierarchical file system, much less a command line. Maybe you could make them use the linux subsystem in Windows? :wink:

I looked into running a Jupyter Hub on my own and decided life is too short.

I would think that JuliaPro would be the most straightforward solution. It’s not far from a matlab-desktop style solution. If you or they don’t want to use the IDE, then presumably you could have them launch a notebook from within the REPL, though I have not tested this.

At the end, I was not certain I had done these students a great service. It’s primarily a math class, and matlab still does a better job at just getting out of the way for a weaker or less-motivated student. From a career prep point of view, the best choice clearly would have been Python, which they come in knowing a bit, but I dislike numpy for pedagogy.

10 Likes

Regarding plotting, I suggest to use PyPlot backend for more stability at the cost of longer compilation/bloat. The installation is fairly automated, there is no need to have python on the system.

add Plots
add PyPlot # the installation should be seamless without additional effort

GR is the future, but right now PyPlot feels more stable across platforms

2 Likes

I also used Julia for my classes.

  • data science for engineers, ~30 students [two yrs in a row]
  • process dynamics for chemical engineering ugrads, ~120 students [two yrs in a row]

10-20% of my students also experienced the Registry.toml error but I reported it twice and it will be solved in Julia 1.6 [source]. luckily I had talented LAs/TAs to help with these issues. but once we figured out the solution, it wasn’t so difficult to solve for folks that encountered the problem.

we use PyPlot.jl. I hv the students install anaconda for python, matplotlib, scikitlearn, and jupyter. many had trouble getting PyCall to find their python path, but again the LAs/TAs helped the students with this during office hrs.

other than these two issues, really no technical problems using Julia+Jupyter throughout the course.

I used Pluto for my datascience course but had trouble with (i) the matplotlib backend needing to be changed and (ii) crashing after so many plots are made. (i) is now solved so I’ll switch to Pluto for my next classes.

I explain to students that Julia packages are free and open source and constantly in development (they were surprised how many times they updated Pluto in the course). in addition to my enthusiasm for Julia and its inherent awesomeness, I’m hoping students are understanding of a few installation problems!

[teaching evals close on Fri-- maybe I’ll be back with an update ha ha]

11 Likes

Please let us know what they thought :slight_smile:

Kind regards

I do not agree with this at all. GR has been very robust for a long time but PyPlot on the other hand can be messed up by all sorts of things and I, and many around me have not been able to use PyPlot for the last couple of years. Installing MKL.jl used to be an easy way to make PyPlot unusable, not sure if this particular problem is true anymore though.

4 Likes

I am biased due to partiality to the matplotlib, but I am confident in my statement. I suggest you just to count amount of github issues flagged as GR and PyPlot. Perhaps also count the ration of closed to open issues.
If you find any PyPlot related critical issues, do let us know in the github issues.

My experience is also that GR is hard to set up. In a CI job, for example, I had to set an undocumented ENV var.

Gadly, on the other hand works practically always out of the box