4 ms·
I really wish the language doesn't force me to use the REPL.
by aliceryhl 6y ago
I really wish the language doesn't force me to use the REPL.
- moelf 6y agomost 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 https://github.com/dmolina/DaemonMode.jl
- aliceryhl 6y agoThanks, 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.
- krastanov 6y agoHow is it forcing you!?
- ecnahc515 6y agoI'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.
- gugagore 6y agoWhy do you want `julia-pkg add StaticArrays` when you can do `julia -e 'use Pkg; Pkg.add("StaticArrays")'`, though?
- krastanov 6y agoI 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.
- ecnahc515 6y agoShell 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.
- aliceryhl 6y agoThis 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.
- aliceryhl 6y agoBecause 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.
- pkofod 6y agoYou 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?
- aliceryhl 6y agoMaybe 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.)