@@ -13,7 +13,7 @@ This work is intended to
1313* Bring precise code provenance to Julia's lowered form (and eventually
1414 downstream in type inference, stack traces, etc). This has many benefits
1515 - Talk to users precisely about their code via character-precise error and
16- diagnostic messages from lowering
16+ diagnostic messages from lowering
1717 - Greatly simplify the implementation of critical tools like Revise.jl
1818 which rely on analyzing how the user's source maps to the compiler's data
1919 structures
@@ -109,10 +109,10 @@ For example when parsing a source file we have
109109``` julia
110110julia> ex = parsestmt (SyntaxTree, " a + b" , filename= " foo.jl" )
111111SyntaxTree with attributes kind,value,name_val,syntax_flags,source
112- [call- i] │
113- a │
114- + │
115- b │
112+ [call- i] │
113+ a │
114+ + │
115+ b │
116116
117117julia> ex[3 ]. source
118118a + b
@@ -157,9 +157,9 @@ The tree which arises from macro expanding this is pretty simple:
157157``` julia
158158julia> expanded = JuliaLowering. macroexpand (Main, parsestmt (SyntaxTree, " M.@outer()" ))
159159SyntaxTree with attributes scope_layer,kind,value,var_id,name_val,syntax_flags,source
160- [tuple- p] │
161- 1 │
162- 2 │
160+ [tuple- p] │
161+ 1 │
162+ 2 │
163163```
164164
165165but the provenance information recorded for the second element ` 2 ` of this
@@ -777,7 +777,7 @@ The final lowered IR is expressed as `CodeInfo` objects which are a sequence of
777777* Restricted forms of ` Expr ` (with semantics different from surface syntax,
778778 even for the same ` head ` ! for example the arguments to ` Expr(:call) ` in IR
779779 must be "simple" and aren't evaluated in order)
780- * ` Core.SlotNumber `
780+ * ` Core.SlotNumber `
781781* Other special forms from ` Core ` like ` Core.ReturnNode ` , ` Core.EnterNode ` , etc.
782782* ` Core.SSAValue ` , indexing any value generated from a statement in the ` code `
783783 array.
@@ -857,7 +857,7 @@ Pros:
857857- Replaces more Expr usage
858858- Replaces a whole pile of C code with significantly less Julia code
859859- Lowering output becomes more consistently imperative
860- Cons:
860+ Cons:
861861- Lots more code to write
862862- May need to invent intermediate data structures to replace ` Expr `
863863- Bootstrap?
@@ -895,4 +895,3 @@ Some differences which makes Racket's macro expander different from Julia:
895895 expand macros; the "pass system". Julia just executes all top level
896896 statements in order when precompiling a package.
897897* As a lisp, Racket's surface syntax is dramatically simpler and more uniform
898-
0 commit comments