bootstrap: Move default constructor generation from C/flisp to Julia (#61036)
Currently there is a special backdoor into lowering that is used by the
_defaultctors builtin to generate the code for default inner and outer
constructors. This codegen is specifically delayed because the code we
want to generate is dependent on type information, which is not
available until runtime. The code that performs the type-dependent
analysis is currently in C.
This backdoor is annoying, because it complicates the interface to
lowering, which would otherwise be rather straightforward. It is also
unnecessary. With a little bit of effort, we can define the type
analysis logic relatively early in bootstrap and construct the relevant
Exprs there as well, replacing code that was originally in C/flisp. The
primary
annoyance is that we need to explicitly write out all constructors in
early bootstrap before the implementation is
available. However, it is possible to define this fairly early, so the
impact is not that bad.
This is prepratory work for a future flisp-less bootstrap using
JuliaLowering (which currently has no mechanism for this and depends on
flisp).
There are future questions around how to handle provenance for these
Exprs, but since the current implementation doesn't answer those
questions either, we need not do so at this stage.
Written by Claude.
Co-authored-by: Keno Fischer <Keno@users.noreply.github.com>