You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the new lowering introduced in #1379 we were able to remove some parts of the codegen by simplifying the AST
we can push that further:
Convert generics at an early stage
After annotation, we can replace the generic call with the appropriate type, we can also create the new functions
Monomorphisation can happen early if we implement it.
Convert methods, programs and function blocks to functions
A function_block is a function with a this pointer as the first parameter
A program is a function_block with a global instance
A method is a function_block with additional parameters
An action is a function_block
Simplify conditions and loops by converting them to labels and jumps
LLVM does not have loops or if statements, we convert these concepts to labels and jumps, which we already have in our AST
There should be no problem converting them early
Resolve auto pointers for in/outs, arrays and aggregate returns at an early stage
Instead of keeping the logic of auto pointer variables all the way to the codegen, we can rewrite the access to such variables as pointer access and let the codegen only worry about pointers.
The basic idea is that the logic we currently do in codegen can be moved to an earlier stage. While it would mostly remain the same logic, codegen would be simplified greatly which would make it easier to update to newer inkwell versions.
The changes we make can then also be reflected in the AST and tested without the need to go into a codegen phase.
Ideally, the codegen only creates datatypes, variables and functions.
In the functions, the codegen ideally just creates expressions, calls and jumps
The text was updated successfully, but these errors were encountered:
With the new lowering introduced in #1379 we were able to remove some parts of the codegen by simplifying the AST
we can push that further:
function_block
is afunction
with athis
pointer as the first parameterprogram
is afunction_block
with a global instancemethod
is afunction_block
with additional parametersaction
is afunction_block
The basic idea is that the logic we currently do in codegen can be moved to an earlier stage. While it would mostly remain the same logic, codegen would be simplified greatly which would make it easier to update to newer inkwell versions.
The changes we make can then also be reflected in the AST and tested without the need to go into a codegen phase.
Ideally, the codegen only creates datatypes, variables and functions.
In the functions, the codegen ideally just creates expressions, calls and jumps
The text was updated successfully, but these errors were encountered: