Literate.jl icon indicating copy to clipboard operation
Literate.jl copied to clipboard

FR: Provide a way to play nice with Distributed

Open marius311 opened this issue 1 year ago • 0 comments

I understand the motivations for why Literate evaluates things in a temporary non-Main module, but it makes simple things like this file fail:

using Distributed
@everywhere x = 1 # this evals in Main on all workers
#-
x # this accesses the temporary non-Main module Literate creates

which would work in a real notebook. You'd need @everywhere @eval $(@__MODULE__) x = 1 but thats really painful if your notebook has lots of @everywheres, and it can get hairier for other constructs. Generally Distributed stuff that works in a notebook or script won't work in Literate.

Could Literate have an option (off by default) to just execute in Main? Or some other solution?

marius311 avatar Sep 16 '24 23:09 marius311