effekt
effekt copied to clipboard
WIP: Make more types extern instead of builtin
This PR is a draft to move types from being builtins (in symbols.builtins
) to extern type
declarations in the prelude.
To do so, it annotates the operations using those types (If
, While
for Boolean
, Assign
for Unit
(and Ref
)) with Id
s referring to them, which are then resolved by Namer and used by Typer.
For phases after core, it will also add an ExternContext
(sim. to DeclarationContext
in #204).
Implications:
- Using e.g.
If
in a backend that does not supportBoolean
s yet will lead to an error in Namer - All of the builtin types are identified by name (only) and can potentially be overwritten, possibly leading to strange behaviour
- This might be solved by having a #30.
- On the plus side, this also allows individual backends to decide that, e.g.,
Boolean
is a data type (not builtin)