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

Partial compilation #408

Open
chochos opened this issue Aug 27, 2014 · 3 comments
Open

Partial compilation #408

chochos opened this issue Aug 27, 2014 · 3 comments
Assignees
Labels
Milestone

Comments

@chochos
Copy link
Member

chochos commented Aug 27, 2014

In relation to eclipse-archived/ceylon-ide-eclipse#856 the JS compiler should support partial compilation. This changes the way the generated JS is handled; right now it's directly written to the final CommonJS file, but this change would mean something like this:

  1. Every source file will be compiled to a corresponding intermediate JS file
  2. All these JS files are assembled into the final CommonJS module.

This will allow the user to recompile just 1 file and reassemble the entire module.

Some considerations:

  • Are these intermediate JS files considered only temporary, or are they official artifacts of the module?
  • In any case, where to store them?
  • Will they always be assembled together in the same order?
  • The compiler needs to determine what JS files to assemble together. If a source file has been removed, its resulting JS file must not be included in the JS module. This is probably easy to accomplish in the IDE, but it needs to work in CLI as well.
@quintesse
Copy link
Member

Are these intermediate JS files considered only temporary, or are they official artifacts of the module?

Personally I'd say to make them only temporary because I'm not sure it's worth to have all the added complexity just so your first compilation is faster.

In any case, where to store them?

Probably easiest alongside the .JS file in the repository, but that would mean that it probably won't work if you compile directly to a remote repository. We could also just have a local "build" folder or something. Not sure.

Will they always be assembled together in the same order?

I'd say "yes, definitely"
(order of declarations in the original .ceylon file perhaps?)

If a source file has been removed, its resulting JS file must not be included in the JS module.

I'm not sure this is necessary, or even possible, we don't do this in the JVM compiler either, the idea being that if you want a clean build you clean the repository first. You could be doing several compilations that get their sources from different folders, so there would be no way to detect if a file was deleted.

@davidfestal
Copy link
Member

We do some cleaning of this sort in the IDE because we can detect that a project file was removed between 2 incremental builds.
So if we have access to the JS intermediary files, we could be able to remove the temp file corresponding to a removed ceylon and regenerate the global commonJS file the same way as we currently clean CAR archives.
Why not.

But even in the IDE, the best way to ensure your generated archives are fully clean is still to do a clean build.

@quintesse
Copy link
Member

Why not.

Sure, the CLI compiler can do things the IDE will never allow, which is perfectly okay. It's even desirable that the IDE does a bit more work in this case.

is still to do a clean build.

exactly

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

No branches or pull requests

3 participants