-
Notifications
You must be signed in to change notification settings - Fork 141
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
kompilex command for pyk #4342
kompilex command for pyk #4342
Conversation
Some attributes in the bootstrapped prelude modules that the java frontend emits are dictionaries, which get loaded in as FrozenDict's by KAtt.from_dict. When attempting to reserialize these an encoder is needed for json.dumps to support them.
We should probably make sure this plays nicely with: #4345 |
pyk/src/pyk/__main__.py
Outdated
_LOGGER.critical(e) | ||
exit(1) |
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.
I think you can just let the exception propagate to the output instead.
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.
Sounds fine for now. There are a variety of user errors here that can cause an exception and I would eventually like to see these exceptions be collected and logged somehow for the user instead of having python die and show them a stack trace.
Implements the command
pyk kompilex
which uses pyk's outer parser to parse in a K Definition and then hands it off to the java frontend to handle the rest of the compilation.Some bootstrapping is required because the conversions from the outer parsed structures to something compatible with the java frontend aren't fully implemented. For the integration tests, a
prelude-modules.json
file is included in the test data folder which has the K prelude already outer parsed.This will only handle modules that are empty or import other modules. The goal is to expand this capability until the full K language is supported, and then the bootstrapping will no longer be necessary.