Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

metamodel #226

Closed
gavinking opened this Issue Mar 30, 2013 · 110 comments

Comments

Projects
None yet
7 participants
Owner

gavinking commented Mar 30, 2013

Implement the metamodel. Here's what needs to be done:

  • Define Ceylon interfaces
  • Provide Java implementations
  • Test (currently in compiler metamodel/runtime)
  • Support annotations
  • Support invoking method/constructors
  • Support invoking toplevel methods
  • Support reading/writing attributes
  • Support default arguments for methods/initialisers
  • Support variadic arguments for methods/initialisers
  • Support member classes/interfaces (and formal)
  • Support methods with multiple parameter lists (currently lost by the model loader)
  • Support local declarations -> moved to 1.0 #260
  • Rename to ceylon.language.model
  • Support object declarations
  • Support alias declarations
  • Unreify/erase private attributes/methods (even for Java types) -> Moved to #297
  • Add Class.parameters and Function.parameters -> Moved to 1.0 #296
  • Support union/intersection type members -> Moved to 1.0 #295
  • Java interop (to be expanded)
    • Java primitive types
    • Java properties
    • Java fields
    • Java static fields/methods -> Moved to 1.0 #294
    • Java overloaded methods/constructors -> Moved to 1.0 #293
    • Java inner class constructors (doesn't use factory methods unlike Ceylon)
  • Reify method/initialiser parameters
  • Reify class/interface/method type parameters
  • Reify module imports
  • Support dynamic loading of modules -> moved to 1.0 #280
  • Support looking up modules by name/version
  • Support looking up classes by name -> moved to 1.0 #282
  • Add distinction between declared/inherited members
  • Properly deal with locking
  • Implement verification of type constraints when applying types
  • Implement verification of reified type arguments
  • Implement verification of container types for memberApply
  • Implement hash/equals/string on the metamodel
  • Fix all remaining FIXME/TODO
  • Add attribute for getting fully qualified name (probably into Declaration)
  • Add attribute for getting container (probably into TopLevelOrMemberDeclaration)
  • Do not wrap exceptions in invocations
  • Add abstract, shared, actual, formal and default attributes to declarations
  • Deal with UnknownType -> moved to 1.0 #289
  • Add a way to get from a Member to its Declaration?
  • Implement the $call$variadic methods
  • Add is to Type?
  • Add a container type parameter to member apply
  • Change names to US-English
  • Check what happens WRT abstract classes and invoking their constructors
  • Figure out how to properly implement AliasDeclaration.apply/memberApply -> #298
Member

thradec commented Apr 1, 2013

Will be possible to obtain some information about module?

Owner

gavinking commented Apr 1, 2013

Yes, of course, but lets leave that out for now.

Sent from my iPhone

On 01/04/2013, at 9:31 AM, Tomas Hradec notifications@github.com wrote:

Will be possible to obtain some information about module?


Reply to this email directly or view it on GitHub.

Owner

gavinking commented Apr 1, 2013

Actually I think we should eliminate PackageMember and just give all Declarations a package attribute and a Boolean toplevel attribute.

Owner

gavinking commented Apr 1, 2013

A bug in the above design is that we can't get the annotations or name of a member declaration without providing an instance of the type. Need to fix that.

Owner

quintesse commented Apr 2, 2013

Maybe add some utility attributes to Declaration for the annotations defined by the language? Like shared, default, variable, etc?

And what is the annotatedMembers for?

Owner

FroMage commented Apr 2, 2013

I'd like to see:

  • modules, and a way to list modules
  • looking up modules, packages, types by name
  • shortcuts for predefined annotations like Boolean formal (and same for shared, etc…)
  • a way to get the topmost refined method/attribute
  • a way to list declared members as well as flattened members (not sure what the current members refers to)
  • a way to get the parameters for a method, its return type, its type parameters
  • same for a class, for its initialiser
  • a way to get the type parameters for a ClassOrInterface
  • a way to get the attribute type
  • I think we need to think about members/containers a bit more because classes/interfaces/methods may be contained by a method, not just a type
  • shortcuts to get a Declaration's package/module, rather than walk the sequence of containers all the way up
  • info to know
    -- if a type is an anonymous class
    -- type parameter constraints
    • case classes
    • self bounds
Owner

FroMage commented Apr 2, 2013

And:

  • for parameters:
    • defaulted or not
    • I guess a Callable or something that gives me the default value
    • variadic or not
    • name
Owner

gavinking commented Apr 2, 2013

what is the annotatedMembers for?

To query for all members with a certain annotation.

Owner

FroMage commented Apr 2, 2013

One thing to keep in mind: we're hiding Java's Object.getClass() and T.class literals ATM so we will need a way to either unhide them, or convert from a Ceylon Type to a Java Class, because there are many Java APIs that require Class instances.

Owner

gavinking commented Apr 2, 2013

a way to get the type parameters for a ClassOrInterface

Well so the above design doesn't address the issue of type constructors. That's an issue I need to put some extra thought into. A ClassOrInterface would be a type with arguments.

Owner

gavinking commented Apr 2, 2013

I think we need to think about members/containers a bit more because classes/interfaces/methods may be contained by a method, not just a type

I'm assuming that local declarations don't reify their container.

Owner

FroMage commented Apr 2, 2013

I'm assuming that local declarations don't reify their container.

Well in the case of methods, they do exist as type objects, so why not?

Owner

FroMage commented Apr 2, 2013

BTW:

interface Member<Type,Kind> 
        satisfies Kind(Type) // WTF???
Owner

gavinking commented Apr 2, 2013

WDYM WTF?

If you have a Member, you can invoke it, passing an instance of the type it is a member of, and get back a Function or Value.

Owner

FroMage commented Apr 2, 2013

We support these kinds of constraints since when?

Owner

FroMage commented Apr 2, 2013

Oh wait. This is the shortcut for Callable<Kind,[Type]>? I thought it was a type constructor constraint :)

Owner

gavinking commented Apr 2, 2013

No, that would be given Kind(Type t), not satisfies Kind(Type). And I think we've decided against adding those :)

Owner

FroMage commented Apr 2, 2013

OK then why do we prefer to invoke the member to get the good stuff rather than make it an attribute or better a sub-type?

Owner

gavinking commented Apr 2, 2013

As I noted above:

A bug in the above design is that we can't get the annotations or name of a member declaration without providing an instance of the type. Need to fix that.

Member

RossTate commented Apr 8, 2013

Technical comment: Declaration should be of ... Function<Anything,Nothing> ... and similarly elsewhere.

Owner

gavinking commented Apr 8, 2013

@RossTate eh? why?

Owner

gavinking commented Apr 8, 2013

@RossTate Oh, you're right. I want the lower bound not the upper bound. Oops.

Owner

FroMage commented Apr 12, 2013

Hum. I don't quite see how I can get started on implementing that part without the reified generics part. IMO we need the same sort of abstraction as ProducedType, and we're missing union and intersection types too. I'm not quite sure how we can fit all that together, so I'll let you propose what you had in mind.

@FroMage FroMage referenced this issue in ceylon/ceylon-compiler Apr 12, 2013

Closed

Implement the metamodel #1126

@FroMage FroMage added a commit that referenced this issue Apr 15, 2013

@FroMage FroMage First draft of metamodel impl #226 ea4f185

@FroMage FroMage added a commit that referenced this issue Apr 15, 2013

@FroMage FroMage First metamodel test #226 8ca479c

@FroMage FroMage added a commit to ceylon/ceylon-compiler that referenced this issue Apr 17, 2013

@FroMage FroMage Moved metamodel utilities ceylon/ceylon.language#226 fc57dc3

@FroMage FroMage added a commit that referenced this issue Apr 18, 2013

@FroMage FroMage metamodel: added resolved superclass/interfaces to ClassOrInterfaceType
#226

as opposed to the unresolved (including free TypeParameter) in ClassOrInterface
1fd65e0

@FroMage FroMage added a commit that referenced this issue Apr 18, 2013

@FroMage FroMage metamodel: support the Nothing type #226
not sure at all if it should be
shared object nothingType satisfies ProducedType{}
or
shared interface NothingType of nothingType satisfied ProducedType{}
shared object nothingType of NothingType{}
c698df0

@FroMage FroMage added a commit that referenced this issue Apr 30, 2013

@FroMage FroMage metamodel: refactored boxing of return value into MethodHandleUtil an…
…d use for AppliedFunction invocation #226
62b3353

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: more FIXMEs bd44b3e

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: renamed ClassOrInterfaceDeclaration.superClassDeclara…
…tion and interfacesDeclaration

to extendedType and satisfiedTypes
7c2bfbc

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: renamed TopLevelOrMemberDeclaration.packageContainer …
…to containingPackage

added containingModule for half-price today special deal
d674200

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: changed type of TopLevelOrMemberDeclaration.container
to the more-specific (but erased) Package|TopLevelOrMemberDeclaration
42c851a

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: renamed type parameter bounds
to be in zen harmony with the other similar bound names diseminated by the wind
7309248

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: added OpenClassType and OpenInterfaceType that refine…
… their declaration type
9542fab

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: removed infinite loops please
funny the IDE or compiler don't catch such trivial errors
271db87

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: removed FIXME fef3884
Owner

FroMage commented Sep 13, 2013

I think being able to get members from a Type rather than from a ClassOrInterface will wait for 1.0. Same for interop and overloading.

ATM we don't have Java's equivalent of getting all the inherited (shared) members out of a declaration, we only have the list of declarred declarations. I'm inclined to delay this to 1.0 too.

@FroMage FroMage added a commit to ceylon/ceylon-compiler that referenced this issue Sep 13, 2013

@FroMage FroMage ExpressionTransformer ceylon/ceylon.language#226: renamed TopLevelOrM…
…emberDeclaration to NestableDeclaration
d2c1f80

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: renamed ClassOrInterface superclass/interfaces into e…
…xtendedType/satisfiedTypes

for zen harmony
a56658f

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: turned ClassOrInterface extendedType/satisfiedType to…
… ClassModel/InterfaceModel

since they could be member types
d4d9f7d

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: fixed bug 43b54ed
Owner

gavinking commented Sep 13, 2013

@FroMage those limitations sound OK to me. To get members of a Type, can you ask for its supertype ClassOrInterfaces?

Owner

FroMage commented Sep 13, 2013

Yes.

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: big change in apply and model containers
apply is now parameterised
memberApply too
bindAndApply is gone: you can do memberapply and invoke for the same effect
model container are not ClassOrInterface anymore but Type since we can have members with a container of union type <Foo&Bar>.f()

As a result Class adds a new memberClassApply rather than refine apply since it cannot add the required Arguments type parameter
and I did the same in Interface for regularity, though this would could refine apply, not sure yet about it
2b93133

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: removed callable from AppliedClass since Class is alr…
…eady Callable, and it was missing its full type from @SatisfiedTypes
47bd812

@FroMage FroMage added a commit that referenced this issue Sep 13, 2013

@FroMage FroMage metamodel #226: imports cleanup a80da59

@FroMage FroMage added a commit that referenced this issue Sep 16, 2013

@FroMage FroMage metamodel #226: added InvocationException when trying to invoke an ab…
…stract constructor
7406478

@FroMage FroMage added a commit to ceylon/ceylon-compiler that referenced this issue Sep 16, 2013

@FroMage FroMage ExpressionTransformer: added new type params to function/value apply … 73aad3f

@FroMage FroMage added a commit that referenced this issue Sep 16, 2013

@FroMage FroMage metamodel #226: fixed a few bugs 2590de8
Owner

FroMage commented Sep 16, 2013

This issue is now officially done for the JVM :)

Owner

quintesse commented Sep 16, 2013

Gratz!

Both for the feature and for the longest issue :)

Owner

FroMage commented Sep 20, 2013

This is done, though not sure about the JS backend.

@FroMage FroMage closed this Sep 20, 2013

@CeylonMigrationBot CeylonMigrationBot referenced this issue in ceylon/ceylon Nov 14, 2015

Closed

metamodel #5104

50 of 50 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment