Julia is a free and open-source general purpose programming language made specifically for scientific computing. It combines the ease of writing in high-level languages like Python and Ruby with the technical power of MATLAB and Mathematica and the speed of C. Julia is ideal for university-level scientific programming and it’s used in research.

Some time ago Viral Shah, one of the language’s co-creators, got in touch with us at the Raspberry Pi Foundation to say his team was working on a port of Julia to the ARM platform, specifically for the Raspberry Pi. Since then, they’ve done sterling work to add support for ARM. We’re happy to announce that we’ve now added Julia to the Raspbian repository, and that all Raspberry Pi models are supported!

Not only did the Julia team port the language itself to the Pi, but they also added support for GPIO, the Sense HAT and Minecraft. What I find really interesting is that when they came to visit and show us a demo, they took a completely different approach to the Sense HAT than I’d seen before: Simon, one of the Julia developers, started by loading the Julia logo into a matrix within the Jupyter notebook and then displayed it on the Sense HAT LED matrix. He then did some matrix transformations and the Sense HAT showed the effect of these manipulations.

Viral says:

The combination of Julia’s performance and Pi’s hardware unlocks new possibilities. Julia on the Pi will attract new communities and drive applications in universities, research labs and compute modules. Instead of shipping the data elsewhere for advanced analytics, it can simply be processed on the Pi itself in Julia.

Our port to ARM took a while, since we started at a time when LLVM on ARM was not fully mature. We had a bunch of people contributing to it – chipping away for a long time. Yichao did a bunch of the hard work, since he was using it for his experiments. The folks at the Berkeley Race car project also put Julia and JUMP on their self-driving cars, giving a pretty compelling application. We think we will see many more applications.

I organised an Intro to Julia session for the Cambridge Python user group earlier this week, and rather than everyone having to install Julia, Jupyter and all the additional modules on their own laptops, we just set up a room full of Raspberry Pis and prepared an SD card image. This was much easier and also meant we could use the Sense HAT to display output.

Simon kindly led the session, and before long we were using Julia to generate the Mandelbrot fractal and display it on the Sense HAT:

The Julia team have also created a resources website for getting started with Julia on the Pi: juliaberry.github.io

There never was a story of more joy / Than this of Julia and her Raspberry Pi

Many thanks to Viral Shah, Yichao Yu, Tim Besard, Valentin Churavy, Jameson Nash, Tony Kelman, Avik Sengupta, Simon Byrne and Elliott Saba for their work on the port. We’re all really excited to see what people do with Julia on Raspberry Pi, and we look forward to welcoming Julia programmers to the Raspberry Pi community.

Hmmmm interesting, particularly the built-in parallel processing functions which seems more robust than python’s built-in implementation. However, though I realize it may not be needed as much in scientific computing, I did not see any option for general socket programming beyond websockets. Though at least there is a python wrapper. May have to investigate a little more to see if it warrants me learning another “general purpose” programming language.

C slow !!! compared to what? Well written C is about as fast as it gets, beaten only by hand-tuned (non portable) assembler.
As to bloat, there was never a language yet that you couldn’t bloat programs in if you really tried.

I think he meant this image “rather than everyone having to install Julia, Jupyter and all the additional modules on their own laptops, we just set up a room full of Raspberry Pis and prepared an SD card image”…

Julia is intended to be more a better faster MATLAB than it is a general purpose programming language. Proper MATLAB isn’t available for the Pi and the open source alternatives Octave and Scilab are too slow. Thus, Julia being available and working well on the Pi could serve as an important tool for teaching numerical computation without resorting to Fortran, C or C++.

While Fortran, C and C++ are used for most high performance computing (and in the case of C and C++ many other things), there is also real work being done with MATLAB-like programming languages. Julia is new, but being available on the Pi may make it more popular.

This is good to see – I’ve been meaning to play around with julia for a couple of years..

r.e. your comment on julia with the sense hat. I did suggest switching to using a numpy 3D array to represent the LEDs (see my pull request from 2015!) which would seem more intuitive and significantly faster (than python not julia), oh well.

I got around to playing with something like that a while back. Didn’t make a PR out of it (except for the joystick stuff) as it departs quite significantly from the existing library, but it’s here in case anyone wants a play: https://github.com/waveform80/pisense

Didn’t really know Julia existed until I stumbled upon some people using it to solve Project Euler problems, and thought to myself that it looks…interesting (and that’s usually enough to get me going). Thanks for making it more readily available!

Oh, and take a look at Project Euler if you’re in for some programming challenges. Cheers

When it does most computations it looks like Julia from Raspbian apt is using only one core on htop. I uses rather lot of RAM the first time a command is run. I run the commands in the LXTerminal first.

Thank you for your hints about getting past the failure to install jupyter. Unfortunately, after all the pip upgrade etc. I still got all the red error messages, just as before. This is a fully updated Pi3 (as far as I can tell) with very few added programs, such as the Okular .pdf reader. That doesn’t seem to be working properly any more. Have you any more advice for failed jupyters?

Problem over, so no need to reply thanks. Being rather inept, I failed to notice that the above “sudo pip3 install pip -upgrade” was a misprint for –upgrade.After running that, sudo pip3 install jupyter and thence to PKg.build(“Ijulia”) within Julia, did the trick. I include that for others who, like me, don’t know what they’re doing.

Sorry- more clarification required for others like me- the screen printing is distorting the input: what you need is sudo pip3 install pip – – upgrade. There is no space between – and -, but the screen lumps the 2 minuses together.

I have Raspian Jessie running in a virtual Raspberry Pi. I have only been able to install Julia 0.3 but the extra packages, SenseHat etc, require Julia 0.4 or 0.5 so Pkg.add fails. I haven’t even found an appropriate forum in which to post this question!
Is Julia 0.5 available for the Pi somewhere?