Is it possible to integrate Revise.jl into the Base library of Julia?

When the source file is revised, users want it be known by Julia immediately, which is a quite natural idea.

Is it possible to integrate Revise.jl into Julia Base library and let it track the source files whenever Julia is started?

1 Like

what about just putting using Revise into your startup.jl see How to set up Julia to always run a set of code at the beginning of each session?

3 Likes

Thanks! In fact, I use Revise the same way with the startup.jl in as follows.

# This file should contain site-specific commands to be executed on Julia startup;
# Users may store their own personal commands in `~/.julia/config/startup.jl`.
atreplinit() do repl
    try
        @eval using Revise
        @async Revise.wait_steal_repl_backend()
    catch
        @warn "Could not load Revise."
    end   
end

function my_include( path::AbstractString)
    include(path)
    Revise.track(path)
end 

Then, In the REPL or Juno, I include other file as

my_include("c:/temp/main.jl")

If Revise.jl is part of Julia, the users do not need to do anything to track the code.

Perhaps you mean the standard library, not Base.

It should be possible, but it’s not a good idea, as this would

  1. couple the release cycle of these packages to Julia,

  2. make development much more tedious.

Functionality is being moved out of Base and the standard libraries.

1 Like

Revise is a big piece of software with some fairly chunky dependencies.
They would all have to go into the started library.

The julia philosophy is to put almost nothing in the standard library that could be in a package.
Most things there are to support Pkg, or the REPL,
a few are things that used to be in Base but that noone could quiet bring to toss out entirely.

I am a big supporter of that.
Anything in the standard library is comparatively hard for anyone to just work on.
And for now has its releases synchronized against julia’s releases.

That would slow things immensely.

2 Likes

But Revise.jl is so central to a nice Julia experience, that bundling it somehow with the Julia installation would make sense.

I might be wrong, but I have the impression is less about where the code for Revise lives, and more that the Revise workflow be the way that Julia works out of the box. Of course that would require it living in the stdlib too.

But that’s not always the case right? If I have some script that I want to be fast, I don’t want Julia monitoring to see if the source code has changed. Revise is awesome for development workflow, but I don’t think it would be a great idea for it to always be running in the background.

Or am I misunderstanding?

1 Like

I think the key problem is not installation, but discovery. Installing Revise.jl takes 12 keystrokes (]add Revise + RET), so it is trivial.

Users just may not know about it. Mentioning it in the docs prominently could be a start.

6 Likes

Are you looking for includet?

help?> includet
search: includet include_string include include_dependency

  includet(filename)


  Load filename and track any future changes to it. includet is deliberately non-recursive, so if filename loads any other files, they will not be automatically tracked. (See Revise.track to
  set it up manually.)

  includet is intended for "user scripts," e.g., a file you use locally for a specific purpose such as loading a specific data set or performing some kind of analysis. Do not use includet
  for packages, as those should be handled by using or import. If using and import aren't working, you may have packages in a non-standard location; try fixing it with something like
  push!(LOAD_PATH, "/path/to/my/private/repos").

I thought Revise was mentioned in
https://docs.julialang.org/en/v1/manual/workflow-tips/

But I guess not, I think a PR to fix that would be good.
I was thinking of ProfileView,jl mentioned in the profiler section.

3 Likes