Conversation

Are there any papers on systematically handling name resolution + macro expansion + type-checking without having it devolve into a ball of mud? I'm looking at some Scala papers and those seem to be mostly about features/usage, not implementation challenges.
3
3
Oh wait, I just had a brainfart moment. If your macros are typed, the type-checking and inference is kinda gonna work like normal functions. Macro expansion can be done later after type-checking is over.
1
2
(There's an implicit assumption here about all macros being typed. Untyped macros would throw a wrench into the gears, certainly.)
1
1
I have looked at both a little bit, not in too much detail. One mismatch is staging vs macros, but I see there's a paper by Stucki et al. on a unification of the two. Literally just started looking at that one before your reply. 😅
1
Sure, as a 10,000 ft view that's fine. The devil is in the details. With untyped macros, if interleaving the macro expansion and type checking in a different way leads to a different result, that's a problem. (Since you're essentially doing effects without any "funnel monad".)
1
1
Replying to
I've kinda' skimmed 'Binding as Sets of Scopes' and watched the corresponding Strange Loop presentation, I should probably read the paper thoroughly. Also, it's not just dependently typed langs, SML and OCaml also work top-to-bottom (and I think Lisps too).