News for hackers. Stuff that matters.
Re:Julia 1.9.0 lives up to its promise by cwp on Saturday May 13, 2023 @04:36PM (#35932442)
I think Julia really dropped the ball on the execution model. Just-ahead-of-time compilation ends up being the worst of both worlds - you can't compile a small fast binary for deployment, and you can't quickly run a script or REPL for development. It turns out that this really matters for adoption.

And now Julia has competition from Mojo. Mojo makes some compromises for backward compatibility with the Python world, but it's really solving the problems that hurt AI most. And the folks behind Mojo have a lot of real-world experience migrating a community from one language to another.

I think Julia will remain a niche language, confined to science and statistical computing outside of mainstream data science and machine learning.

Re:Julia 1.9.0 lives up to its promise by ivirshup on Saturday May 13, 2023 @04:57PM (#35932637)
> it's really solving the problems that hurt AI most

Isn't this a bit premature? Mojo doesn't tangibly exist for most people (we can't run it ourselves), and I am unaware of any ML/ AI applications built with Mojo.

Re:Julia 1.9.0 lives up to its promise by garbagecoder on Saturday May 13, 2023 @05:37PM (#35933004)
I have tried it. Iirc, the company developed it, or its compiler, specifically for ML/“””AI”””.

If they successfully import Pythons libraries without a bunch of wrapping, its userbase will likely follow.

It was faster than Python and easy to do paralleization like go. But it’s not quite fully baked yet.

Re:Julia 1.9.0 lives up to its promise by cwp on Sunday May 14, 2023 @12:42AM (#35935368)
Yeah, definitely early days. But they're saying all the right things: fast code off the bat, easy to vectorize and parallelize, efficient use of memory, easy to create abstractions that execute efficiently on various architectures. The demos are impressive and they have the track record to be credible. I've played with it and the stuff that's been implemented so far works well.
Re:Julia 1.9.0 lives up to its promise by pjmlp on Sunday May 14, 2023 @07:51AM (#35937296)
Swift for Tensorflow was such a success.
Re:Julia 1.9.0 lives up to its promise by TurboHaskal on Wednesday May 17, 2023 @12:55AM (#35971412)
Oh boy, I remember reading about this for the first time and thinking it was April's fools.
Re:Julia 1.9.0 lives up to its promise by adgjlsfhk1 on Saturday May 13, 2023 @05:07PM (#35932733)
IMO Mojo isn't competing with Julia. It's competing with Rust. Manual memory management, you have to type annotate every variable (if you want good performance), and no overloading doesn't seem to me like a language aimed in the same area as Julia.
Re:Julia 1.9.0 lives up to its promise by pjmlp on Saturday May 13, 2023 @05:47PM (#35933096)
Right now, Mojo is as successful as Swift for Tensoflow.
Re:Julia 1.9.0 lives up to its promise by eigenspace on Saturday May 13, 2023 @08:13PM (#35934126)
> and you can't quickly run a script or REPL for development.

You know that the entire blogpost you're ostensibly commenting under is about how the JIT overhead has been greatly reduced via more static AOT compilation, right?

Re:Julia 1.9.0 lives up to its promise by shakow on Saturday May 13, 2023 @08:26PM (#35934175)
And that's good, but not enough. 1.7 seconds just to load libraries is just too much.
Re:Julia 1.9.0 lives up to its promise by adgjlsfhk1 on Saturday May 13, 2023 @09:53PM (#35934625)
good news is 1.10 already is shaping up to be about 2x faster.
Re:Julia 1.9.0 lives up to its promise by ksec on Saturday May 13, 2023 @10:21PM (#35934775)
When is 1.10 expected? Just wondering I did a quick google and it seems a lot of the 1.9 improvement were back ported from 1.10? Or is that really 2x on top of current 1.9?
Re:Julia 1.9.0 lives up to its promise by adgjlsfhk1 on Saturday May 13, 2023 @10:57PM (#35934943)
1.10 feature freeze is going to be in the next few weeks. after that it will be a few months depending on how much is required to fix all the bugs that have probably been introduced. 1.9 mostly doesn't shorten loading times (although weak dependencies end up helping a bit). 1.10 has had a bunch of load time optimization which became a lot more obvious once 1.9 got rid of all the stupid stuff. the exact speedups are package dependent, but 2x is a good estimate. some packages get a lot more, some are about the same.
Re:Julia 1.9.0 lives up to its promise by ksec on Sunday May 14, 2023 @12:19AM (#35935279)
Thanks. Exciting times for Julia!
Re:Julia 1.9.0 lives up to its promise by shakow on Saturday May 13, 2023 @10:00PM (#35934669)
So ~0.85"?

Python is not compiled and start & load pandas (which is comparable to the libraries loaded in the article) in ~0.4" on my computer, and that's a notoriously slow language.

If I were to use e.g. Rust with polars, load time would be virtually none. And when I have to process ~50k different datasets, I can't afford 0.85" per file, which would translate to ~11 hours of overhead.

Re:Julia 1.9.0 lives up to its promise by adgjlsfhk1 on Saturday May 13, 2023 @10:14PM (#35934740)
It's not 0.85 per file. It's 0.85 for the 50k files combined.
Re:Julia 1.9.0 lives up to its promise by shakow on Saturday May 13, 2023 @10:25PM (#35934807)
No, because the program has to be run by slurm over several compute nodes, so it can't process them all at once.
Re:Julia 1.9.0 lives up to its promise by adgjlsfhk1 on Saturday May 13, 2023 @10:58PM (#35934950)
as long as you don't have 50k computers, it still should be 0.85 seconds per node which is still tiny.
Re:Julia 1.9.0 lives up to its promise by shakow on Sunday May 14, 2023 @05:22AM (#35936606)
> it still should be 0.85 seconds per node

No it's not, because I will not architecture my whole pipeline & program around Julia inability to start in a second, I will just use another language.

Re:Julia 1.9.0 lives up to its promise by pjmlp on Sunday May 14, 2023 @07:53AM (#35937303)
In good company, that is what Python folks do all the time.
Re:Julia 1.9.0 lives up to its promise by shakow on Sunday May 14, 2023 @09:28AM (#35937784)
Python does not take 1.7" to load pandas.
Re:Julia 1.9.0 lives up to its promise by pjmlp on Sunday May 14, 2023 @11:38AM (#35938779)
> I will just use another language.

Hello C, C++ and Fortran.

Re:Julia 1.9.0 lives up to its promise by Nanana909 on Sunday May 14, 2023 @11:29AM (#35938707)
> If I were to use e.g. Rust with polars, load time would be virtually none.

Because you're compiling...

And if you need to do the same in Julia, you should also pre-compile or some other method like https://github.com/dmolina/DaemonMode.jl (their demo shows loading a database, with subsequent loads after the first one taking roughly ~0.2% of the first)

Re:Julia 1.9.0 lives up to its promise by Nanana909 on Sunday May 14, 2023 @11:25AM (#35938678)
Then precompile or use https://github.com/dmolina/DaemonMode.jl.

But 1.7 seconds at first startup isn't even enough time to articulate a serious thought, much less write any good code.

I struggle to believe it's a dent in anyones workflow.

Re:Julia 1.9.0 lives up to its promise by shakow on Sunday May 14, 2023 @07:59PM (#35942510)
I exposed my use case in the comment chain below; DaemonMode won't help there.

> I struggle to believe it's a dent in anyones workflow.

This is exactly what I dislike in the Julia community, the ‶if I don't have this issue, then the ones meeting it are holding it wrong″ attitude.

Re:Julia 1.9.0 lives up to its promise by Nanana909 on Monday May 15, 2023 @12:50AM (#35943995)
Perhaps we got off on the wrong foot here as I was a bit aggressive, my apologies for that. I see your use case below as you said, and just want to (hopefully politely) explain that your opinions on this startup atency are still likely incorrect.

I have no illusions that I'll convince you - I don't think anyones ever done that on the internet :) But for educational purposes and anyone else interested read on. Also to be clear - "performance" is probably not the number one you'll see people advocating strongly for Julia. It's moreso because if you're in a position where you're writing code that is being run on 50K databases, and not editing CSS styles - what you're doing fundamentally, at some point under the hood, is mathematics. And the flow and design of the code should reflect that. Julia gets us a lot closer.

A few things before I mention your use case specifically:

Running

    $ julia myprog file_$x.db
in a bash script, 50k times would indeed take that 0.85 seconds per run and would be a ridiculous amount of overhead.

But it would would be the equivalent of the bash script in rust (and actually quite similar, as at the end of the day they both target LLVM)

    $ cargo build --release
    $ ./target/myprog file_$x.db
## Solution 1: Precompiling to reduce startup latency

But obviously you wouldn't compile each time - you'd compile once and distribute the binary, or pre-install the compiled libraries beforehand, whatever. In rust you can obivously easily statically build things and distribute. In python you're just calling pre-built libraries in other languages anyways.

In Julia that's not so easy because we have to carry around the GC, compiler, and even a patched LLVM. (See Why is my "Hello World" executable 300MB?!" posts on PackageCompiler.jl....). But Python obviously has the same issue. Your first solution here is to just precompile all of your libraries and code

With a naive approach:

    $ time julia -q noncompiled_prog.jl                                 
    1.57s user 0.14s system 177% cpu 0.961 total
Using a compiled sysimage with our library:

    $ time julia --sysimage=DataFramesSysImg.so compiled_proj.jl
    0.16s user 0.21s system 21% cpu 1.691 total
## Solution 2: Julia already plays nicely with distributed computing Distributed tasks like you're talking about are literally baked into the language, with macros making it trivial to work with clusters, and yes there are people using it with Slurm. For example...

    @parallel for i=1:N
        someCoolFunction(args)
    end
to parallelize across your cluster.
Re:Julia 1.9.0 lives up to its promise by npalli on Sunday May 14, 2023 @09:24AM (#35937746)
If Julia can make good strides in Science/Engineering/Statistics world outside of DS/ML (that too mostly NN) I'm sure the Julia folks would see that as a major win. Basically a unified next generation language taking over R/MATLAB/Fortran space. I think that field is going to grow dramatically (in adoption of tools) over the next decade as opposed to DS/ML which are already overhyped.

If Mojo finds it groove and can convince people that static typing is a price to pay for performance I think Julia will have to adopt some sort of a pure AOT compilation mode and forgo the Dynamism that keeps that Just- portion lying around which does seem like an issue for DS/ML folks.

Re:Julia 1.9.0 lives up to its promise by Nanana909 on Sunday May 14, 2023 @11:19AM (#35938640)
>a nd you can't quickly run a script

What is wrong with the following to run a script?

$ julia myscript.jl

If you have specific needs that demand, after hitting return, the few seconds of delay for the vast majority of scripts is an issue, you can pre-compile it ahead of time or simply use something like https://github.com/dmolina/DaemonMode.jl

Julia has issues as with all languages but "not being able to quickly run a script" is by far one of the easiest to work around.

> and you can't quickly run a script or REPL for development.

REPL- I disagree. Of course you can - that's how many of use Julia.

> And now Julia has competition from Mojo.

...maybe. The code-samples we've seen from Mojo look very similar to Python, obviously. And that is specifically why a lot of poeple love Julia.

The problems people are more and more interested in (machine learning, etc) are at their base mathematical problems. These languages are all tools to translate mathematics into computer instructions. The code should then ideally look as close to that math as possible. Spamming np.linalg, sp.sparse, and so forth over and over again is just ugly, and the entire Python workflow overly encourages object oriented design for concepts that are mathematically functions. And, well, should be functions. If you're working in these or related fields at all and write any code with Julia, it's hard to not fall in love.

Mojo may make Python faster. But it will still be, roughly, Python.

And considering that the Python 2 -> Python 3 transition has still not completed, I think it's premature to conclude Mojo's python upgrades will get anywhere.