6 Julia Frameworks to Create Desktop GUI’s and Web Apps

Logan Kilpatrick
Towards Data Science
5 min readJan 5, 2022

--

Photo by Alvaro Reyes on Unsplash

Julia is used for a lot of deeply technical applications like Machine Learning and Data Science. But as a general-purpose programming language, Julia can also be used for things like building websites and interactive visualizations. In this article, we will go over 5 Julia packages that can be used to create desktop GUI’s or web applications.

Web Apps with Genie 🧞‍♂️

Genie.jl is a pure Julia web framework based on Django. From the Genie website:

Genie Framework includes all you need to quickly build production ready web applications with Julia Lang. Develop Julia backends, create beautiful web UIs, integrate with databases and set up high-performance web services and APIs.

Like Django, Genie is not just a stand alone-package, it is an entire ecosystem! Let’s look at a basic hello world example with Genie:

# Genie Hello World!
using Genie
route("/helloworld") do
"Hello and welcome to Genie!"
end
# Powerful high-performance HTML view templates
using Genie.Renderer.Html
route("/html") do
h1("Welcome to Genie!") |> html
end
# JSON rendering built in
using Genie.Renderer.Json
route("/json") do
(:greeting => "Welcome to Genie!") |> json
end
# Start the app!
up(8888)

As you can see, Genie follows a similar design pattern to Django and comes with features like a web server, templating engine, cookies, encryption, authentication, a routing engine, backend views written in Julia, and much more!

If you want to build modern web applications and are familiar with Django, Genie is the right place to start! You can find out more here: https://genieframework.com

For a comprehensive video tutorial on Genie, check out:

GTK Bindings in Julia

Gtk.jl is a Julia package built on top of the very popular GTK windowing toolkit. You can find the getting started manual here: https://juliagraphics.github.io/Gtk.jl/latest/manual/gettingStarted/

Let’s look at a simple example:

using Gtkwin = GtkWindow("My First Gtk.jl Program", 400, 200)b = GtkButton("Click Me")
push!(win,b)
showall(win)

First, we set the name of the window and the dimensions. Then, we create a button object with a specific text label and push it into the app. Last, we display the app by calling showall.

Image captured by Author

Gtk.jl has been used to build some very cool applications. I highly suggest checking out this video:

Makie.jl 📊📉

Makie is one of the most loved visualization packages in the Julia ecosystem. There is an incredible depth to what you can build.

Gif captured from https://github.com/JuliaPlots/Makie.jl

Makie allows you to build interactive visualizations that run on the GPU and can also be run in your browser. The Makie docs also recently went through a large update so the content there is up to date and very helpful: https://makie.juliaplots.org/stable/

I would also suggest checking out https://lazarusa.github.io/BeautifulMakie/ which is a gallery of lots of really nice animations built using Makie.

Blink.jl, Web-based GUIs for Julia

Blink.jl is the Julia wrapper around Electron. It can serve HTML content in a local window, and allows for communication between Julia and the web page. In this way, therefore, Blink can be used as a GUI toolkit for building HTML-based applications for the desktop.

I could not think of a better way to re-state this, so the above is a quote from the Blink docs. What makes Blink different from other packages is that you can build HTML-based GUI’s using it.

julia> using Blink

julia> w = Window() # Open a new window
Blink.AtomShell.Window(...)

julia> body!(w, "Hello World") # Set the body content

julia> loadurl(w, "http://julialang.org") # Load a web page

We start off by creating the Electron window, then appending in some text to the body tag of the window, and finally, loading a URL in the window. If you run this code locally, you will see that the window changes dynamically as we execute these commands.

Image captured by Author

While I don’t think Blink is widely used, I have had a lot of fun playing around with it on various projects.

Dash, by Plotly 📈

Dash is a Julia interface to the Dash ecosystem for creating analytic web applications in Julia without requiring JavaScript. This means you can build impressive dashboards like https://covid-county-dash.herokuapp.com and deploy them with ease!

You might also want to check out the Dash site https://dash.plotly.com/julia for details on getting started. There is also comprehensive documentation available on Dash.jl: https://github.com/plotly/Dash.jl

Desktop Apps with Package Compiler 📦

Right now, the best way to create a desktop app that can be shared and run on computers without Julia installed is to use PackageCompiler. PackageCompiler allows you to take an entire Julia project and compile it to an exe file. This process bundles all of the dependencies together into a single file to make it distributable.

I will note that there are currently limitations concerning what you need to do to create an exe. There might be some code re-writing that is required to make it compatible. For a step by step walkthrough on using PackageCompiler, check out:

And you can read more about Package Compiler in the docs: https://julialang.github.io/PackageCompiler.jl/stable/apps.html

Other Packages 🥈

The 5 packages highlighted above are just a small sample of the packages available today in the Julia ecosystem. Below, I will add a semi-exhaustive list of all the visualization packages I can find in case the first 5 did not suit your use-case:

  1. Plots.jl, powerful convenience for visualization in Julia
  2. Interact.jl, Interactive widgets to play with your Julia code
  3. Stipple.jl, The reactive UI library for interactive data applications with pure Julia.
  4. QML.jl, Build Qt5 QML interfaces for Julia programs.
  5. ClmGui.jl, Julia wrapper for cimgui

Am I missing one? Feel free to comment on this article and I will append the package to this list!

--

--