-
Notifications
You must be signed in to change notification settings - Fork 85
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
Easier prototyping of code #748
Comments
Suggestion from @myreen for improving robustness of astPP:
|
I think this is a great idea! I just want to add that I suspect one needs replace Step 4 with:
because the sexpr generator from HOL might format its output slightly differently. |
How slow do you reckon an AST-to-sexp function in HOL would take to EVAL such things? If it was OK, you could then also think about attempting to verify that the parser and printer inverted each other. |
@mn200 I'm confused by this:
I was under the impression that the sexp parser has been proved to invert the sexp printer. I suspect the relevant lines are: cakeml/compiler/parsing/fromSexpScript.sml Lines 1966 to 1968 in bd2ad29
However, I think all of this is a bit beside the point. The point is that we want to quickly extract a first version of a program from HOL. The target of this extraction should be concrete syntax (normal SML syntax) that can easily be tweaked outside of HOL. Currently, the means to get this concrete syntax is through astPP, and we know that astPP a bit untested and, as a result, the focus of this issues it drifting towards improving astPP. One way to find bugs in it is make testing of its output part of the regression test. |
Well, then if those sexps can be consumed by the compiler, why not iterate over @tanyongkiam's process above going via sexps to get the ability to test the code. It sounded to me as if all the code-writing was being done with HOL functions and |
That makes sense! I guess the proposal is more if we'd want to prototype outside of HOL/ |
A pretty-printed concrete syntax step for easy hack modifications? I like that. I did some similar surgery on the sexpr compiler to get the numbers in #774 but getting the sexpr into a state where I could edit it was not trivial. |
This issue is about speeding up prototyping of code that is (to be) verified using the translator and/or CF.
Currently, the process I used is roughly:
Now, to optimize the resulting code, one does:
Overall, this process is rather tedious because one has to wait for compilation in the logic for each prototype.
One way to speed this process is to use the binary compiler. However, this requires concrete syntax.
It would be nice to provide a facility/library so that Step 1-3 above can easily be made to dump the full program in concrete syntax using e.g.: astPP (https://github.com/CakeML/cakeml/blob/master/semantics/astPP.sml)
The text was updated successfully, but these errors were encountered: