Closed omelkonian closed 6 years ago
@omelkonian I don't see the code that verifies that there is exactly one procedure called main, maybe you should add that check as well.
@all If you think of any other helpful static checks, let me know.
I haven't looked at any of the code you wrote so I don't know if you've already accounted for this, but FYI: a haskell method called "run" is generated as well during compile time (it calls "main" and returns a tuple with the final values of all global variables, so that the user can see them).
EDIT: I actually don't think you have to check this after all, but I'm not sure yet. @casvdrest you wrote that code. We can just use newName to always generate a run function with a different name right?
@joristt And what would be the static check then? That the user does not define a procedure named run
?
Maybe it's better to ignore (for now) the evaluator-dependent checks that we can perform (e.g. checking that the user does not call our internally-generated Haskell declarations in rhs
expressions), focusing on static checks from the Janus-only side.
@jorisburgers Should we check that main
has no parameters?
@omelkonian The functions qLookupName and lookupValueName should be able to inspect the RHS for the variables used. In that case, we would support all possible haskell and the code would be much shorter.
@jorisburgers I cannot make lookupValueName
to work, since it acts inside a splice, but it is impossible to splice the Exp
that has been parsed. Am I missing something?
@omelkonian I tried getting it to work, but I couldn't get it to work the way we want either. Let's stay with your implementation.
Rebased.
Closes #43 Will be integrated in the whole process by #38.
CHECKS
lhs
not onrhs
NOTE Does not currently support some expression types on the
rhs
(e.g. let/where/cases/do).