-
Notifications
You must be signed in to change notification settings - Fork 34
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
Supported backends annotation #946
Comments
Sure. But I thought there was already an issue proposing this...? |
With this, #969 / ceylon/ceylon-compiler#1648 could be fixed in the typechecker. |
@quintesse isn't this part of what you're working on with the new |
It would have to be part of it when implementing it fully, yes, mostly for #499 while for now I was handling #500 first. What would the annotation be? A new one like suggested here ( |
I would reuse |
I'm wondering about something here. What is this annotation supposed to do actually? It seems okay as an indication, but you can't really trust it can, you? I mean, you could easily write a module that was backend dependent and not use this annotation. So the absence of this annotation would not guarantee that the module can be used by all backends. Without that guarantee it seems to lose much of its value, right? |
Well, @gavinking suggested at one point that it's native platform availability is an attribute of a module. So, typechecker could (in theory) validate that the imported module indeed supports the the platform it is marked for. |
Well I'm not so sure it could validate it, except perhaps to check that you're not lying (saying your code is for the JVM backend when it's obviously for the JS backend). But I don't think it can actually strictly check it (otherwise we could just generate the required information, right?). |
@quintesse there were two things we came up with for this:
|
@gavinking ok, understood, so we simply say that each compiler backend will refuse to compile a module annotated |
Well my problem with all this is that there's currently no validation at all that if some declaration is backend-specific, then it is only used from within other declarations specific to that same backend. So basically, as this functionality exists today, annotating a module |
… encounter a module descriptor for a different backend (ceylon/ceylon-spec#946)
…ule descriptors (see ceylon/ceylon-spec#946)
…ule descriptors (see ceylon/ceylon-spec#946)
…at import native modules (see ceylon/ceylon-spec#946)
…modules that import native modules (see ceylon/ceylon-spec#946)
…t import native modules (see ceylon/ceylon-spec#946)
I'll close this now because this is now implemented as described in the issue at least. |
We need a
backend
annotation that can be applied on a Module.If this annotation is not provided, then, all backends would be considered as supported.
This will be useful for tools like ceylon.build to discover modules for JVM / JS backends.
It could also be used in the compiler to throw an error in case your trying to compile for a backend which is not supported.
The text was updated successfully, but these errors were encountered: