Skip to content
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

support for wgsl syntax extensions? #3

Open
mighdoll opened this issue Aug 22, 2024 · 5 comments
Open

support for wgsl syntax extensions? #3

mighdoll opened this issue Aug 22, 2024 · 5 comments

Comments

@mighdoll
Copy link

Would you be game to support an extended wgsl syntax in glasgow?

We've been working towards defining some community standard syntax extensions for wgsl for rust and typescript linkers like wgsl-linker. Documentation on the extensions coming soon, the first feature out of the gate will be keywords for import / export..

@nolanderc
Copy link
Owner

Sure, if there’s enough demand. However, just my 2 cents to make extensions easier for tooling to handle: if possible, extensions should not introduce additional syntax, and instead opt for using attributes. Unknown attributes are easier to parse, and can easily be ignored.

For example, export/import can use @export and @import directly, and if additional arguments to the attributes are needed (such as linking modes), those can be added as @export(static), without having to extend the syntax further.

@k2d222
Copy link

k2d222 commented Aug 22, 2024

That is an interesting suggestion. We have discussed using attributes in the past for other usecases than imports such as conditional compilation @if or a rusty @cfg that can be placed on function, structs, struct members, maybe statements, ...

But we didn't discuss it for imports. Attributes have to decorate something, so what would imports decorate? The function using the imports? Or do we allow attributes that decorate nothing at the top of the file?

To me It makes a lot of sense for @export.

--->> if you want to be part of the discussion we'd love to have you on board on our fresh discord! https://discord.gg/5UhkaSu4dt
we discuss defining a community standard for wgsl language extensions. We'll start with imports.

@nolanderc
Copy link
Owner

For @import you might be able to attach them to an empty override declaration at the top of the file:

@import
override name_of_file_or_module;

@mighdoll
Copy link
Author

There's now a growing body of docs here, and at least a couple of new linker protoypes in progress.

If you've time, bring your thoughts over to a github or discord to help make sure we're going in the right direction for language servers. For example, do you think it would be feasible to share a wgsl parser between a linker and a language server?

@xdk78
Copy link

xdk78 commented Sep 16, 2024

I found out that there's also missing support for many wgpu extensions/features.
for example: unresolved reference to binding_array`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants