-
-
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
Rollup plugin #409
Rollup plugin #409
Conversation
| acorn.FunctionExpression | ||
| acorn.FunctionDeclaration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what's the difference between these expressions vs declarations. couldn't find acorn docs, could you please link it if you have it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FunctionDeclaration nodes are statements, so when we just declare a function, instead of e.g., passing that declaration immediately as an argument. FunctionExpressions are the opposite.
Example of FunctionDeclaration:
function foo() {}
Example of FunctionExpression:
bar(function foo() {})
// ^ here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job 👏🆙
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Changes
@typegpu/tgsl-tools
no longer act on raw JS code as a string, but rather process an estree-compliant JavaScript AST. This allows the rollup plugin to plugin the ast it generated to transpile it to SMoL. The JIT is now responsible for generating an AST from the raw JS code withacorn
.function() {}
) are now supported as parameters to.implement
and.procedure
Usage
Functionality
typegpu
or any submoduletypegpu/*
.tgpu
object is imported, and how it is aliased.$__ast
and$uses
.Further work
$__ast
and$uses
on the callee at runtime before calling them. #417