News for hackers. Stuff that matters.
Re:Julia 1.6: what has changed since Julia 1.0? by enriquto on Sunday February 14, 2021 @12:31PM (#26134210)
> I cannot fathom how ttfp is important.

I personally do care for my concrete usage pattern.

This is my use case: A long shell script that does a lot of things. At some point, inside a loop that runs hundreds of times, it needs to solve a couple of small linear systems and plot a simple graph. There's hundreds of png graphs, that are then combined into a video sequence. Right now, the computation is done by calling octave (inside the loop) and then gnuplot (to create the actual graph from the octave computed data points). I would like to replace each call to octave+gnuplot to a single call to julia. Yet, this would make my script run in a few hours instead of a few seconds, because for this usage pattern all plots are first plots

Before you suggest that I should rewrite the whole thing in julia, maybe you are right but

1) it would take me a few weeks that I don't have

2) that's not my point. A good tool is a tool that can be used for purposes that it was not intended to, like this. If the time to first plot in julia was a millisecond instead of 10 seconds, then julia would be a much better tool.

Re:Julia 1.6: what has changed since Julia 1.0? by stillyslalom on Sunday February 14, 2021 @12:46PM (#26134368)
You may want to look at [DaemonMode.jl](https://github.com/dmolina/DaemonMode.jl), which spins up a persistent Julia process in the background so you don't have to pay the TTFP penalty more than once, even when shell-scripting.
Re:Julia 1.6: what has changed since Julia 1.0? by jarvist on Sunday February 14, 2021 @04:12PM (#26136301)
As you already have the gnuplot commands, perhaps using Julia + https://github.com/gcalderone/Gnuplot.jl might work? It's a very lightweight package, so even using it directly should be OK.

I do all my plotting with Gnuplot.jl, as gnuplot is fast, and I can save .gpt files which reproduce the plots for later reference and making publication-quality.

Re:Julia 1.6: what has changed since Julia 1.0? by DNF2 on Sunday February 14, 2021 @12:46PM (#26134365)
But this is really the worst conceivable use case for Julia. Why are you interested in making this change, when Julia offers no advantage in this scenario?
Re:Julia 1.6: what has changed since Julia 1.0? by enriquto on Sunday February 14, 2021 @02:57PM (#26135658)
> Why are you interested in making this change, when Julia offers no advantage in this scenario?

Well I love julia the language. It's the interpreter quirks that I find annoying. If julia had something lean and superfast like luajit it would be incredible!

Re:Julia 1.6: what has changed since Julia 1.0? by The_rationalist on Sunday February 14, 2021 @07:08PM (#26137539)
If only they could switch to graalvm :m
Re:Julia 1.6: what has changed since Julia 1.0? by whateverwhynot on Sunday February 14, 2021 @03:14PM (#26135822)
I'm not the parent, but I faced exactly the same issue when I tried to switch to Julia from scilab. As for why I'd like to switch: Julia is a better language, it is way easy to run your script on a cluster and I've been bitten more than once by the two language problem... So Julia seems better for everything but for one of my most common use cases...
Re:Julia 1.6: what has changed since Julia 1.0? by aliceryhl on Sunday February 14, 2021 @02:27PM (#26135349)
It would be a perfectly fine use-case for Julia if it wasn't so damn slow.
Re:Julia 1.6: what has changed since Julia 1.0? by stjohnswarts on Sunday February 14, 2021 @02:59PM (#26135673)
I still have a soft spot for octave. It was my first matrix oriented program. I've moved on to pandas and c++ but I still pull up octave for signal analysis because it's just plain easier and has some great functions and I think it may have created folds in my brain as an EE undergrad that will always be there :)
Re:Julia 1.6: what has changed since Julia 1.0? by cbkeller on Sunday February 14, 2021 @12:35PM (#26134257)
It’s not trivial to do, but compiling plots into your sysimg might actually fix that
Re:Julia 1.6: what has changed since Julia 1.0? by enriquto on Sunday February 14, 2021 @12:36PM (#26134268)
Thanks! Is there a way to compile all installed packages into the sysimage? If so, why isn't that the default?
Re:Julia 1.6: what has changed since Julia 1.0? by cbkeller on Sunday February 14, 2021 @12:45PM (#26134350)
Technically yes, but then IIRC you’d have to recompile the whole sysimg any time you update any single package, which could get to be a pain. The usual compromise seems to be to include just a handful of your most used packages in the sysimg (say Plots + Revise)
Re:Julia 1.6: what has changed since Julia 1.0? by enriquto on Sunday February 14, 2021 @12:55PM (#26134444)
> you’d have to recompile the whole sysimg any time you update any single package

Are there any downsides to this? You never care how long does a system update take. You always care how long do your programs run.

Re:Julia 1.6: what has changed since Julia 1.0? by Sukera on Sunday February 14, 2021 @02:21PM (#26135305)
The downside is that PackageCompiler (or SnoopCompile, for that matter) can only pack into the sysimage what it sees. This is usually done by "recording" which methods get called during a session and putting the compiled native code for those into the sysimage. If it's not called during setup, you'll still have dynamic compilation (as for any code that hasn't ever run).
Re:Julia 1.6: what has changed since Julia 1.0? by cbkeller on Sunday February 14, 2021 @02:11PM (#26135170)
I’ve never tried it myself, but can’t think of any reason why it wouldn’t work in principle if you do want to go that route
Re:Julia 1.6: what has changed since Julia 1.0? by sgt101 on Sunday February 14, 2021 @02:10PM (#26135167)
Could you cache the requests or write the parameters into a file and then make the call to Juila, and ask it to loop over the requests?