Stratego compiler removes subtype constraints when generating core
When I generate stratego-core from a stratego file, the output does not contain all subtype constraints of the original file. Here is the compilation command I used:
java -Xms512m -Xmx1024m -Xss16m -jar strategoxt.jar --lib -F -i go2js.str > go2js.aterm
go2js.strcontains the subtype constraints such as
: Function -> FunOrSig : FunctionSignature -> FunOrSig
All subtype constraints are removed inSubmitted by Sven Keidel on 18 May 2017 at 09:09
If I compile with
--ast, it includes the full type signature, but does not desugar the rules and strategies to core.
I was confused for a moment about subtype constraints. We call these signatures, and these signature specifically are called injections. The compiler may perform some optimizations that remove unused signatures. What if you call the compiler with flag
-O 0to disable optimisations?
Sorry for the confusion. I tried to to compile with
-O 0, same effect. In any case, I found a solution. I extract the signature from the result of compiling with
--astand extract the core code of the strategies from the result of compiling with
-F. That works.
Log in to post comments