-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support lazy
keyword
#23
Comments
Shouldn't be too hard to parse/syntax highlight this keyword. I'm interested, though, how it affects the static semantics. Is there a formalization written up that i may consult to know how it affects typechecking? |
There's also some compatibility considerations - if this 'laziness' feature is not enabled, then |
Yes, it should be an optional feature, the question is how to indicate that it's "on"? In SML/NJ it's a matter of an assignment to a variable. As to the statics the paper by MacQueen and Taha (and possibly another) does it: https://www.diva-portal.org/smash/get/diva2:413532/FULLTEXT01.pdf. |
re: indicating it’s on: i was thinking a config option in millet.toml. as for implementing this feature, it looks like you can translate down the “lazy” language into the regular language with some local transformations. the only probably i foresee in millet is that millet does not currently have the ability to transform the code as it is typechecking. i think we’d need the ability to do that, or at least, we’d need to have scoping/name resolution information, because we need to track which data types and vals are lazy in order to transform their usage sites. but name resolution requires the rest of typechecking in sml because of the module system. |
Problem
SML/NJ supports laziness via the Control.lazysml boolean reference, which if set to true enables "lazy" as a keyword on datatype declarations and on val [rec] declarations.
eg, datatype lazy stream = Cons of int * stream
eg, val rec lazy zeros = Cons (0, zeros)
Solution
It would be great to have a way to enable highlighting of the keyword "lazy" as with the other constructs of the language.
The text was updated successfully, but these errors were encountered: