JuliaGraphics / Luxor.jl

Simple drawings using vector graphics; Cairo "for tourists!"
http://juliagraphics.github.io/Luxor.jl/
Other
575 stars 72 forks source link

Drop dependencies like FFMPEG (in the long run)? #275

Open hustf opened 9 months ago

hustf commented 9 months ago

Open source dependencies may generally fail in the long run. I hope Luxor will drop or switch such dependencies in years to come.

Just an example of how dependecies are bad: I'm dabbling with combining data from the internet and condensing the info using Luxor. In my case, an issue arise like this:

(@Marey) pkg> why OpenSSL_jll
  Luxor → FFMPEG → FFMPEG_jll → OpenSSL_jll
  RouteSlopeDistance → HTTP → OpenSSL → OpenSSL_jll

In plain words, Luxor depends on FFMPEG, which is stuck on an old version of OpenSSL. This in turn downgrades HTTP.jl, which has consequences for other packages. I don't believe FFMPEG is heavily maintained. That's it for this example.

From the landing page: "Luxor is designed primarily for drawing static pictures. If you want to build animations, use Javis.jl"

cormullion commented 9 months ago

In this specifc case, I think FFMPEG.jl, although apparently not maintained very frequently, is a key part of the Julia graphics infrastructure - it's used by Plots and Makie, so it's unlikely to be abandoned. But perhaps it should be kept more up to date than it is - I think it's mainly a wrapper for the ffmpeg binary anyway? Have you opened an issue or asked on the various forums?

More generally, the ability to have package extensions now available in Julia (as introduced here: https://www.youtube.com/watch?v=TiIZlQhFzyk) should allow people to load packages only when they're needed, so you wouldn't have to load FFMPEG unless you needed to run Luxor.animate(). I think this mechanism can also be used to, for example, include the MathTeXENgine.jl LaTeX package as well. I haven't started working on this though - feel free to start investigating the process if you think it's a good idea.

"Luxor is designed primarily for drawing static pictures. If you want to build animations, use Javis.jl"

I'll rewrite that to say "if you want to build complicated animations... "... :)

hustf commented 9 months ago

Thank you for the quick reply and the good news. No, my instinctive reaction was to go for a Luxor issue (which paid already) . I have never understood the mechanism for artifacts properly, and will watch the video with interest. Perhaps learning more about this also solves Pango pinning. I may post a solution proposal or update here.

hustf commented 9 months ago

It's tempting to give package extensions a try with a PR for MathTeXENgine, but are you willing to drop Julia < 1.9 already?

cormullion commented 9 months ago

Well, all existing versions will continue to work, just the latest version will be 1.9+. It’s probably a good excuse for a version 4.0 anyway. 😂

hustf commented 9 months ago

Ok, I may give it a try this evening.

hustf commented 9 months ago

This method seems to work well with PR#276. If the PR is accepted roughly as is, I suggest field-testing it with a release < v4.0. If it works well, we could consider moving out other parts.