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

Prototype style vs. closure style in ceylon.language #11

Closed
ikasiuk opened this issue Jan 16, 2012 · 2 comments
Closed

Prototype style vs. closure style in ceylon.language #11

ikasiuk opened this issue Jan 16, 2012 · 2 comments
Assignees

Comments

@ikasiuk
Copy link
Member

ikasiuk commented Jan 16, 2012

We can generate either prototype style or closure style JS code from Ceylon code, but we only have one version of the language module implementation. That's particularly problematic for classes or interfaces which are derived/implemented by Ceylon code outside the language module because inheriting and overriding methods works differently for the two styles.

We should figure out how to deal with this before implementing larger parts of the language module.

@ikasiuk
Copy link
Member Author

ikasiuk commented Jan 22, 2012

It would be really painful to write the language module implementation an a way that supports both styles at once. It also would be inefficient because we'd have to use closures to support closure style inheritance, and we know that that makes object creation much slower. And the size of ceylon.language.js would be increased significantly.

But there's probably an easier way: we could modify the code generation a bit so that members of types from ceylon.language are always inherited in a way that is compatible with prototype style, even if the derived class itself is generated in closure style. I think this solution is feasible because references to members of the base class look basically the same for the two styles.

I'll give it a try and see how it works out.

@ghost ghost assigned ikasiuk Jan 22, 2012
ikasiuk added a commit that referenced this issue Jan 22, 2012
ikasiuk added a commit that referenced this issue Jan 23, 2012
ikasiuk added a commit that referenced this issue Jan 24, 2012
@ikasiuk
Copy link
Member Author

ikasiuk commented Jan 24, 2012

Ok, seems to work now. That should allow us to continue implementing ceylon.language in prototype style only.

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

1 participant