-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
About the "drifting" answers #5
Comments
Wow great! So happy to hear!
Hmm... I think it is not that unintuitive, it is easy to understand if you think of it as a stack. you push things onto the stack, and use 取 to take things off it. I agree that the way in the second example is more clear in situations, but maybe it's more like a coding style thing? Not sure how the new AST generation works, but in your second example, it seems that you're still temporarily saving the result of 加一於「引」. How come it cannot be saved in the first example? If there're major technical issues I think it's OK to drop it, but otherwise I kinda like the current mechanism :P Maybe point me to the section of the new code so I can take a look? Thanks a lot! |
I am glad to tell you the overhaul now compiles most of the scripts correctly(the basic examples, draw_trees). :)
However, while I am doing compatibility testing, I found out this line in 算經
https://github.com/antfu/wenyan-overhaul/blob/87d52352b372d70d88f128144b269e3aed612e80/packages/stdlib/lib/%E7%AE%97%E7%B6%93.wy#L46
In the current compiler, it will compile to
I would say it make sense in some aspect, but it's hard to read and understand without having good knowledge about the compiler internal mechanisms. Which I think should not be advised.
I would suggest changing it to this
https://github.com/antfu/wenyan-overhaul/blob/d01080a3e7d92a78d930d8eadae36902227d5cc5/packages/stdlib/lib/%E7%AE%97%E7%B6%93.wy#L103
The new compiler does not maintain a "drifting" answers list (i forget what's its name in the code), instead, it makes the relationship of variables static during AST generation. (and there is no need for
噫
as well). So I am wondering if we should drop this "non-intuitive" mechanism in the new compiler? Or if there is any reason to have this mechanism please let me know. :)The text was updated successfully, but these errors were encountered: