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

Backend-specific dependencies #499

Closed
FroMage opened this issue Dec 10, 2012 · 19 comments
Closed

Backend-specific dependencies #499

FroMage opened this issue Dec 10, 2012 · 19 comments
Assignees
Milestone

Comments

@FroMage
Copy link
Member

FroMage commented Dec 10, 2012

We need a way to say that backend JVM depends on those modules, but backend JS on those.

@tombentley
Copy link
Member

Once we have a way to specify that a compilation unit is only for a particular back end (#500), this could be done by allowing the dependencies of a module to be declared 'outside' the module descriptor some how. For example using the source-java suggestion I made in #500, if the source directory contained the module.ceylon (which would contain the common dependencies) then the source-java directory could contain some compilation unit which added to those dependencies. This other compilation unit would only be allowed to add dependencies, not specify the module name or version.

Would you be allowed to export such backend specific dependencies?

@FroMage
Copy link
Member Author

FroMage commented May 13, 2013

I think with the implementation of #500 we could define annotations for backend-specific imports and keep them all in the single module.ceylon file:

module foo '1' {
 import bla '1';
 jvm import bli '2';
 js import foo '1';
}

@FroMage
Copy link
Member Author

FroMage commented May 13, 2013

BTW, this would be trivial to implement.

@gavinking
Copy link
Member

I think this makes sense. Of course, it's only 1/2 of the problem. We still need to be able to define a module which has different underlying implementations for different backends. This feature, on its own, is almost useless. The hard bit is how to define a platform-independent module that makes use of platform-specific code.

@FroMage
Copy link
Member Author

FroMage commented May 13, 2013

Well, go and tell us to go ahead on #500 then ;)

@gavinking
Copy link
Member

We will solve this and #500 for Ceylon 1.1. Not for Ceylon 1.0. Sorry.

@gavinking
Copy link
Member

I'm closing this issue. AFAICT, it doesn't propose anything that is not already provided by optional. If the functionality of optional should be enhanced in some way, please submit a new issue for that, with a proper definition of what needs doing.

@gavinking gavinking self-assigned this Feb 11, 2014
@FroMage
Copy link
Member Author

FroMage commented Feb 11, 2014

What? This is not about optional, unless you define what its semantics are to retrofit this issue. We discussed situations where for example the JVM backend would require module X (jvm-only) and Y (cross-backend) while the JS backend would require module Z (JS-only).

Also optional would never produce an error if the module is missing, and in the case of multi-backends we surely want to make sure the dependencies exist.

@gavinking
Copy link
Member

What? This is not about optional, unless you define what its semantics are to retrofit this issue. We discussed situations where for example the JVM backend would require module X (jvm-only) and Y (cross-backend) while the JS backend would require module Z (JS-only).

All of which cases are already handled by judicious application of optional.

Also optional would never produce an error if the module is missing, and in the case of multi-backends we surely want to make sure the dependencies exist.

Ok, fine, so let's enhance optional to specify that a dependency is required for a certain platform. Sounds easy enough to do.

@quintesse
Copy link
Member

Can't we reuse the platform annotation you just suggested in #500 ?

@FroMage
Copy link
Member Author

FroMage commented Feb 11, 2014

All of which cases are already handled by judicious application of optional.

No, because optional ATM makes the module visible to every unit if it happens to be resolvable, and not just to certain backends.

Ok, fine, so let's enhance optional to specify that a dependency is required for a certain platform. Sounds easy enough to do.

Well, perhaps, even though I have a feeling this will end up meaning not required for backend X which is a negative I don't quite like.

But if you agree optional as it is is not enough, let's reopen this issue.

@FroMage FroMage reopened this Feb 11, 2014
@FroMage
Copy link
Member Author

FroMage commented Feb 11, 2014

platform would work, but that's essentially the original proposal, no?

@gavinking
Copy link
Member

Moving to 1.2.

@gavinking gavinking modified the milestones: 1.2, 1.1 Feb 11, 2014
quintesse added a commit to quintesse/spec500proposal that referenced this issue Apr 12, 2015
quintesse added a commit that referenced this issue Apr 12, 2015
…rked `@backend` and removes them from the source trees (#499 and #500)
quintesse added a commit that referenced this issue Apr 12, 2015
…l be passed on to the `TypeChecker` on construction so it can perform backend-specific filtering of source elements (#499 and #500)
quintesse added a commit that referenced this issue Apr 12, 2015
quintesse added a commit to ceylon/ceylon-common that referenced this issue Apr 29, 2015
quintesse added a commit that referenced this issue Apr 29, 2015
… so we can ask it what backends it can do lookups for (#499 and #500)
quintesse added a commit to ceylon/ceylon-compiler that referenced this issue Apr 29, 2015
quintesse added a commit to ceylon/ceylon-js that referenced this issue Apr 29, 2015
quintesse added a commit to ceylon/ceylon-compiler that referenced this issue May 6, 2015
quintesse added a commit to ceylon/ceylon-compiler that referenced this issue May 6, 2015
quintesse added a commit to ceylon/ceylon.language that referenced this issue May 6, 2015
quintesse added a commit that referenced this issue May 6, 2015
…aration` and we initialize it from any `native` annotations it might have (#499)
quintesse added a commit that referenced this issue May 6, 2015
quintesse added a commit to ceylon/ceylon-js that referenced this issue May 6, 2015
quintesse added a commit to eclipse-archived/ceylon-ide-eclipse that referenced this issue May 6, 2015
quintesse added a commit to ceylon/ceylon-compiler that referenced this issue May 8, 2015
quintesse added a commit that referenced this issue May 8, 2015
…and the native attribute of the imported module itself (#499)
quintesse added a commit to ceylon/ceylon-js that referenced this issue May 8, 2015
@quintesse
Copy link
Member

I think this can be closed now. Any remaining problems can be put in their own issues.

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

No branches or pull requests

5 participants