News for hackers. Stuff that matters.
Re:Julia 1.6: what has changed since Julia 1.0? by aliceryhl on Sunday February 14, 2021 @02:37PM (#26135458)
I really wish the language doesn't force me to use the REPL.
Re:Julia 1.6: what has changed since Julia 1.0? by moelf on Sunday February 14, 2021 @08:19PM (#26137980)
most of the users use an IDE or a notebook, no need to only use REPL.

If you're a old school editor -> terminal run kind of person, checkout https://github.com/dmolina/DaemonMode.jl

Re:Julia 1.6: what has changed since Julia 1.0? by aliceryhl on Monday February 15, 2021 @03:53AM (#26140614)
Thanks, I'll have to check this out. I really wish these things were more discoverable. It took me a month of using Julia until I figured out that the compile-times were even avoidable on the REPL by using Revise.jl.
Re:Julia 1.6: what has changed since Julia 1.0? by krastanov on Sunday February 14, 2021 @08:37PM (#26138097)
How is it forcing you!?
Re:Julia 1.6: what has changed since Julia 1.0? by aliceryhl on Monday February 15, 2021 @03:48AM (#26140562)
Because if I run it from the command-line, it takes 40 seconds before it has precompiled and prepared my project for use. The only way to avoid that wait on every change is to use the REPL, where I only need to wait on the first run.

Outside the REPL, every run is the first run.

Re:Julia 1.6: what has changed since Julia 1.0? by pkofod on Monday February 15, 2021 @03:55AM (#26140624)
You don't precompile just because it's run from the commandline though. There must be something missing from your workflow description, or you're somehow misunderstanding what is going on. Since this is a v1.6 blog post: did you try a v1.6 RC?
Re:Julia 1.6: what has changed since Julia 1.0? by aliceryhl on Monday February 15, 2021 @12:41PM (#26144982)
Maybe precompile is the wrong word, and I should have called it JIT or something else. I don't know.

The point is that running a .jl script that calls my algorithm on a small test case takes 40 seconds to run. If I change the script to run the algorithm more than once on that dataset, all calls after the first complete in less than one second.

Running it with v1.6-rc1, it appears to have improved the running time from 40 seconds to 30. That's pretty good, but still way too slow to enable any kind of workflow that doesn't involve the REPL.

(The 30 and 40 second numbers are very consistent from run to run.)

Re:Julia 1.6: what has changed since Julia 1.0? by ecnahc515 on Sunday February 14, 2021 @09:18PM (#26138321)
I'm assuming you may not be familiar with Julia, but basically every "tool" you use in Julia is a library.

It requires importing it in the Julia REPL or activating a new contextual REPL within the Julia REPL. You can then start calling the functions from the imported module. You don't really get standalone Julia tools, it's all libraries and you're always starting the REPL, importing something, then doing stuff from inside the REPL.

For example, installing a package in Julia is the following steps:

    julia
    ] # keybinding which activates pkg mode
    add StaticArrays
You could do it also like this:

    julia -e 'use Pkg; Pkg.add("StaticArrays")'
There is no `julia-pkg add StaticArrays`, unfortunately.
Re:Julia 1.6: what has changed since Julia 1.0? by krastanov on Sunday February 14, 2021 @10:02PM (#26138590)
I am pretty incredulous at this counting as "forcing you to use a REPL". It is a couple of extra characters compared to what pip, nvm, cargo do, and you can just make your own shell alias for it. And I am not even mentioning the significant advantages it has over pip, especially for binary dependencies.
Re:Julia 1.6: what has changed since Julia 1.0? by ecnahc515 on Sunday February 14, 2021 @10:12PM (#26138646)
Shell aliases aren't as useful in a CI pipeline, or when trying to provide instructions on how new to Julia installs a new package. Also, with Julia being so different from everything else does mean everyone has to learn a new way of doing things. This isn't a bad thing, I like that Julia has a programmatic API for most of these things, but the UX is definitely not amazing.
Re:Julia 1.6: what has changed since Julia 1.0? by aliceryhl on Monday February 15, 2021 @03:52AM (#26140607)
This is not a problem for me. I can write a `.jl` file and call it from the command-line with imports in that file. The problem is compile-times, since every run is first run when running a script.
Re:Julia 1.6: what has changed since Julia 1.0? by gugagore on Sunday February 14, 2021 @09:47PM (#26138501)
Why do you want `julia-pkg add StaticArrays` when you can do `julia -e 'use Pkg; Pkg.add("StaticArrays")'`, though?
Re:Julia 1.6: what has changed since Julia 1.0? by detaro on Sunday February 14, 2021 @09:50PM (#26138519)
it looks a lot more annoying to type. Would be an easy shell alias or script though, if one prefers that command style.
Re:Julia 1.6: what has changed since Julia 1.0? by ecnahc515 on Sunday February 14, 2021 @10:08PM (#26138623)
I don't use Julia regularly, it's just an example of making it clear how the REPL is core to using Julia.