JuliaParallel / Dagger.jl

A framework for out-of-core and parallel execution
Other
597 stars 64 forks source link

Spawn macro does not compose with logging macros #514

Open Octogonapus opened 1 month ago

Octogonapus commented 1 month ago

Dagger v0.18.9, Julia v1.10.3

julia> Dagger.@spawn begin
           @debug "x"
       end
ERROR: LoadError: syntax: invalid syntax (escape (outerref @debug))
Stacktrace:
 [1] top-level scope
   @ REPL[4]:1
in expression starting at REPL[4]:2
jpsamaroo commented 1 month ago

Similar to https://github.com/JuliaParallel/Dagger.jl/issues/479 and https://github.com/JuliaParallel/Dagger.jl/issues/480, @spawn currently requires a function call as the top-level expression. This is for many reasons, most prominently because it makes it easily possible to track synchronization dependencies. We can and should implement a more capable parser, but it's not entirely trivial to implement, and can lead to some surprising behavior if users aren't careful.