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
The difficulty comes from the fact that the snippet as below is instrumented during the runtime to achieve a special semantics
if (y !== undefined) {
tmp.y = Caml_option.valFromOption(y);
}
The metadata of external is collected during the parsing, while it needs type information.
Even if we collect the type information, it is difficult to get it connected to the runtime code generation.
Proposal 1:
Add some attributes like immediate and verify it during type checking, rely on such information to do the code optimisation.
This approach requires more user input and more work from compiler.
Proposal 2:
Ad-hoc solution, assuming the built-in string type can not be re-defined -- seems to be fair and easy to guarantee in the parsing stage. So we know such type can not be option and do such code optimizations. This makes sense if jsx has lot of string optional arguments
Uh oh!
There was an error while loading. Please reload this page.
The second one does not get specialized.
Raised here https://forum.rescript-lang.org/t/how-can-i-get-rid-of-the-runtime-libraries/1001/2
Code snippet:
Expanded code:
The text was updated successfully, but these errors were encountered: