You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want both bootstrap* and target** compilers (transpilers) to produce identical C code, since it will mean I don't need a multi-stage bootstrap to get consistent results. This is not the case yet!
For now I've been focusing on generated_declarations.h. After recent changes, including the as-of-yet unmerged #771 the differences have gone down to having six extra closure ids from bootstrap compiler:
Cursory examinations showed that the stuff in those missing closure ids clearly exists on the target side as well: Closure ids don't have identical content on either side! Oops.
To figure out how bad that is, I instrumented the build to pretty-print the AST of every generated closure into standard output along with its id.
Examining this output from both bootstrap and target showed that closures have matching ids and ASTs upto id 400-something, after which first difference appears. (Which appeared to be a difference in ordering: the ones appearing on both sides were found on either side, just in different positions and ids.)
...all of which on the face of it look like array / iterator / interval code.
Haven't yet had a chance to look for the sources of these, or the cause of this, or why I'm missing six ids but only three ASTs... that's going to be in part 2!
(*) bootstrap = compiling the compiler with itself while running under the bootstrap interpreter.
(**) target = compiling the compiler with the compiler produced by bootstrap stage.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want both bootstrap* and target** compilers (transpilers) to produce identical C code, since it will mean I don't need a multi-stage bootstrap to get consistent results. This is not the case yet!
For now I've been focusing on
generated_declarations.h
. After recent changes, including the as-of-yet unmerged #771 the differences have gone down to having six extra closure ids from bootstrap compiler:Cursory examinations showed that the stuff in those missing closure ids clearly exists on the target side as well: Closure ids don't have identical content on either side! Oops.
To figure out how bad that is, I instrumented the build to pretty-print the AST of every generated closure into standard output along with its id.
which prints out things like this:
Examining this output from both bootstrap and target showed that closures have matching ids and ASTs upto id 400-something, after which first difference appears. (Which appeared to be a difference in ordering: the ones appearing on both sides were found on either side, just in different positions and ids.)
To find out how much content differences I have (never mind the ordering just now) I did my first bit of using Foolang for scripting: https://gist.github.com/nikodemus/2ececebfd6c786a6d7bdcbd575fa9dcf
That split the build logs containing closure ids and ASTs into individual files.
Then I did a bit of terminal work to index closure ids under SHA1s of their ASTs:
(and the equivalent to generate
target-shas/
)Now I could check what is actually missing:
which, drumroll 🥁🥁🥁
shows I have the content of just three closures missing:
...all of which on the face of it look like array / iterator / interval code.
Haven't yet had a chance to look for the sources of these, or the cause of this, or why I'm missing six ids but only three ASTs... that's going to be in part 2!
(*) bootstrap = compiling the compiler with itself while running under the bootstrap interpreter.
(**) target = compiling the compiler with the compiler produced by bootstrap stage.
Beta Was this translation helpful? Give feedback.
All reactions