Julia & PyQt

Hello,

I consider that PyQt (or PySide) is the best option for my open-source & multi-platform desktop project…however, Julia as language is very attractive and, afaics, there is possibility to use it via PyCall.jl package, but I wonder how one does use PyCall to use PyQt, iow. is it similar to using Julia and calling 3rd party C library by using FFI, or using PyQt would bring to me the “two language problem” - I’d have to write gui front-end using Python and do back-end programming using Julia?

Do you recommend such approach or is it better to simply do everything in Python and use e.g Cython to speed up Python code when/if required?

I am aware that there is e.g. Gtk.jl and although I’m running GTK-powered desktop (Xfce), GTK, in general seems to be not so well documented besides more problematic to deploy on Mac/Win OS-es…

You can write everything in Julia. It should be easier than calling a C library, for the most part, because it’s much higher-level. You do need to know how to read the Python documentation and translate it to the corresponding call from Julia via PyCall.

Gtk.jl uses Yggdrasil to provide precompiled binaries for Mac and Windows, so deployment should not be as hard as you think — simply adding a package that depends on Gtk.jl should install all of the necessary libraries AFAIK.

2 Likes

That’s great!!

Wonderful! it means I can also take advantage of some PyQt book…

What about “general” build system for Julia project which requires e.g. bindings for 3rd party C library, building docs etc.?

Does Julia already have ability to create stand-alone executable?

If you really like Qt (and I can understand why), maybe consider to have a look at QML.jl which is probably the most straightforward option to build a Qt app with Julia and QML.

5 Likes

Depending on your needs, you can also use https://github.com/Gnimuc/CImGui.jl.
It’s blazing fast, installation is straightforward and examples are very useful.

BinaryBuilder.jl and Yggdrassil can be used to create cross-platform builds of any 3rd-party C library that integrate with Julia’s package system (so that they are automatically installed as dependencies along with your project). Documenter.jl and friends are used for building docs.

PackageCompiler.jl can do this. Note, however, that this is somewhat orthogonal to the questions above — the normal way to distribute Julia software is as packages, so that Julia users can then just type add YourPackage to install your package and all of its dependencies.

1 Like

Well, not so many options actually…if one does eliminate Electron and similar stuff…

I’ll take a look…not sure what would be QML’s pro/cons in regard to using pure (Py)Qt?

I must admit it looks interesting, but I’m a bit concerned how mature it is…my project has possibility to be developed during the longer period of time and that’s why I’m aiming at more stable and future-proof solutions…

Thanks a lot for all the pointers! It looks pretty good.

What is the prospect of running Julia GUI app on e.g. Android?

I know there is pyqtdeploy so wonder how would choosing Julia+PyQt over just PyQt influence ability to deploy on e.g. Android platform?