-
-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement function erasure #5576
Conversation
725f3af
to
89dbf5a
Compare
This new flag determines whether we should introduce a new kind to represent lambda sets, or whether lambdas should be erased. The latter is not yet implemented.
But none of these paths are yet exercised.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof, that's a lot. left some things to look at in a follow-up
let box1_is_null = env | ||
.builder | ||
.build_is_null(box1.into_pointer_value(), "box1_is_null"); | ||
let check_box2_is_null = ctx.append_basic_block(parent, "check_if_box2_is_null"); | ||
let return_false = ctx.append_basic_block(parent, "return_false"); | ||
let compare_inner_values = ctx.append_basic_block(parent, "compare_inner_values"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this adds an extra block. you could just do the null checks, bitwise or, and then jump based on that right?
} | ||
|
||
impl<T> SubsSlice<T> { | ||
pub fn empty() -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be a const fn
now I think.
Implements type-erasure of closures, as an alternative to lambda sets for compiling functions.
See the description of erasure here: https://www.notion.so/rwx/Type-Erasure-a3ed13ef1305422eba00dbda026e52b3?pvs=4
The current implementation supports only global function erasure, and is internal-only. You can compile a roc program with erased functions using a debug compiler and setting
ROC_ERASE=1
.The implementation is incomplete but I would like to merge this in, as we need it regardless, and the diff is quite large. Currently unsupported: