I think Julia should have a --dev[eloper]
mode with all the good options below, e.g. disable const
and implying --debug-mode
(Julia does have some debug mode but only for logging seemingly, I want more), and I suppose also --project=.
(I wish I knew of this sooner).
I think you have it in effectively with Revise.jl plus ProtoStructs.jl and with running with --inline=no
which is I think implied by:
I’m not sure what else changes with -O1
or -O3
really like to know, but I believe inlining is the major problem, i.e. recompilations, which inlining induces. Without inlining, compilation speed even with (otherwise) -O3 should be too much of a problem I think. There’s even --compile=min
for a full interpreter, but likely overkill.
ProtoStructs.jl referes to likely outdated alternative Redef, actually RedefStructs.jl. I don’t know the differences but I guess both must add extra redirection (whick slows down a bit at runtime, but makes development time faster/easier).
How would you like a mode (or just a package, to begin with)that ignores it (or only for globals)? Synce this is syntax, seemingly can’t be changed in a package, but I think that would even be false… The new parser is in JuliaSyntax.jl, and it was once stated from the REPL dynamically (while it was in development), so since that’s possible basically anything can be redefined at runtime, i.e. to me it seems possible a package could use a fork of it that adds @proto
to struct definitions and drops const
.
No, just discovered it now:
Seemingly, I see no dependency on Pluto or related. I see a dep on JuliaInterpreter.jl though. If/since not Pluto-specific, maybe the package should be renamed to DevMacros or something, just Dev? It seems to overlap with other packages allowing redefining structs (without something like @proto
?). A Dev.jl package could depend on it and all the good ideas that help here, and end up as a stdlib. A package alone can’t change (global) optimization setting though, so it alone can’t do what I propose with --dev
. [You can though change optimization locally for modules only I’ve seen so far, though I would want more finegrained, and allow applying to calling site, like you can now for some macros like @inline
.]
Interesting, yes, they help users with speed (after install), but not developers, maybe for them precompile can and should be redefined to no-op? Could be done in a package and the -dev mode I proposed.
I don’t think so, not seen it, might have missed it, but also I think I wouldn’t want this. Seems easy to misremember is applied (just like --startup-file=yes is easily forgotten, shouldn’t be on be default, only for the REPL), and alias juliad (and juliac) seem better, more explicit.