Update link to last known work on the lowerer#97
Update link to last known work on the lowerer#97c42f merged 2 commits intoJuliaLang:mainfrom o314:patch-1
Conversation
Updates README with a link to last lowerer proto (circa 2019), since the branch has been deleted on julia . It resolves directly to the last known change / cumulated known work on the lowerer
Fix shortlink that does not work as in https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls
This is (quite strictly) recasted by the lowerer at --
|
|
Thanks for this. To be honest the old work on lowering may not be super relevant anymore. Some parts (tests?) might be salvaged but new lowering should probably work on the JuliaSyntax trees rather than (in addition to?) just |
|
Thanks for the quick feedback and merge .
Does this already exists somewhere, maybe nearby those promising land ? Or is it more of a prospective work ? FWIW I have ported ~ 1K LOC of the lowerer already , more precisely 750 LOC of the lowerer and 250 LOC of the ast |
I haven't done any work on this yet. Hopefully we can arrange lowering to preserve precise source location information through it somehow (as in allow it to use |
|
IMO,
Keep up the good work ! |
|
Thanks!
Yes. Well lowering does transform constructs in a weird "discontinuous" way, where some construct in the surface level syntax can map to discontinuous sections of lowered code (in ssa form). And that kind of thing only gets worse once you hit the optimizer. There's not really a way around this, we just need to accommodate it I think :-)
Do you have a link for this? My "plan" for compatibility regarding AST data structures is to declare that the official API for manipulating them is to do pattern matching (and to provide pattern matching macros for this purpose). This may give some hope to write code which works for both |
|
Hi !
In the last case you will need to regen syntaxnode from expr # @ https://github.com/JuliaLang/JuliaSyntax.jl/blob/main/src/syntax_tree.jl
mutable struct SyntaxNode
source::SourceFile # will be arbitrary if gend @ macro ?
raw::GreenNode{SyntaxHead} # will be arbitrary if gend @ macro ?
position::Int # will be arbitrary if gend @ macro ?
parent::Union{Nothing,SyntaxNode} # will be arbitrary if gend @ macro ?
is_leaf::Bool # will be arbitrary if gend @ macro ?
val::Any
end80% of SyntaxNode may be outputted arbitrary at syntax_node_from_expr --
-- --
-- OK for pattern matching.
We will see |
Yet to be decided. Will need to prototype and see what works best.
Nothing is ever guaranteed, but that's what testing is for. We will be carefully testing across the General registry for compatibility. Also keep in mind that the reference parser has some odd behaviors and corner cases (described in the README) that we want to gently deprecate, if testing across the ecosystem indicates that people do not rely on them. Hyrum's Law applies here but we will do our best. The
Yes
I'm expecting to do a custom pattern matcher, JuliaSyntax.jl needs to be standalone anyway, as it'll be vendored into Base. And I want it to be as efficient as a bunch of hand-written if statements. @BenChung has worked a bit on this though current status is unknown. However I chatted to Jeff Bezanson about this recently and he thinks we need a lower level API. (IIUC to express things that a pattern language can't easily). Nothing is fully decided here. |
I'm currently working on implementing part of lowering, but it's a limited subset. Right now, Julia's lowering does both a bunch of validity checking (are you trying to name a function 2+2?) as well as code generation in a completely intertwined fashion. I'm trying to pick out that first part, validity checking, to generate a sort of semantic AST that retains most of the sugar but hasn't yet been fully compiled down into the SSAesque form that the rest of lowering would produce. The other major goal of mine is to reduce the amount that I'm using MLStyle at the moment for pattern matching with a few custom patterns to match SyntaxNodes in terms of architecture. I have some prior work on a much more sophisticated pattern matching mechanism, but this has kind of been put on hold for reasons of expediency. |
|
Hard work outside takes me apart from there a certain amount of time o: |
|
If anyone's interested I've posted what I've been working on here as SemanticAST. The idea is to take an |
…jl#97) Updates README with a link to last lowerer proto (circa 2019), since the branch has been deleted on julia . It resolves directly to the last known change / cumulative known work on the lowerer
…jl#97) Updates README with a link to last lowerer proto (circa 2019), since the branch has been deleted on julia . It resolves directly to the last known change / cumulative known work on the lowerer
Update link to last known work on the lowerer that was proposed but not merged AFAIK in Julia circa 2019
The branch was deleted and no direct link is available anymore .
This one should be the last and most complete ref about it