Closed willemneal closed 1 year ago
Because I copied the source files from the compiler. Eventually the compiler will be broken up into more granular modules, but until then I just copied them here to compile to AS.
It seems that assemblyscript did not upload the as version of the compiler part of the code
@willemneal Hi. In fact, I have not officially started this grant project, because assemblyscript does not seem to export the assemblyscript version of the compiler API.
@yjhmelody That's why I copied them here. You don't need the full compiler API just the AST and transform API. We should schedule a time to talk in more depth about this.
@willemneal transform
seems to currently only support nodejs. And I think the transform API really does not need to be done in an AST visitor library
@yjhmelody:
Here are my thoughts on how to achieve this in the short term. For now, the compiler's frontend will continue to be in JS. So we need just one transform that this library will provide.
The outer transform will do the following:
@serailizabe \n class
@willemneal
Do you want to implement a pure AS version of transform? Why doesn't this wait for the official build-in? I want to implement an as version of AST visitor alone, and there is no problem. But if we want to implement transform, we need to communicate more details, which is a bit unacceptable, and I think this should be implemented by the AS official, after all, the official has provided platform-independent Transform interfaces (like writeFile/readFile), but it's seem that I do not see this piece of relevant progress.
And even if it really needs to be implemented, I personally think this can be completely split into 2 libs.
Like I use as-visitor now, but I don’t use its Transform related API.
@yjhmelody The more I think about it you are correct. We should move this work and make a PR to the main repo. I will be available early tomorrow for me. If you can find me on discord we can sync on the next steps. Otherwise I'll write up my ideas tomorrow morning.
@willemneal Well, I created a new repo https://github.com/yjhmelody/as-visitor
I plan to make BaseVisitor based on BaseTransformVisitor. I think the ability of BaseTransformVisitor is a superset of BaseVisitor. If I don’t do this, there may be subtle differences between the two interfaces. At present, there are such subtle differences in the visitor-as code
Why add such much code ?