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

Should TypeSystem#value have a default value? #48

Closed
chrisseaton opened this issue Feb 14, 2016 · 7 comments
Closed

Should TypeSystem#value have a default value? #48

chrisseaton opened this issue Feb 14, 2016 · 7 comments

Comments

@chrisseaton
Copy link
Contributor

Isn't it the case that the list of types used in the DSL type system is largely redundant now? So at least should it be given a default value of {} so that we can write:

@TypeSystem

instead of

@TypeSystem({})
@chumer
Copy link
Member

chumer commented Feb 14, 2016

Agreed. This is an artifact from a time where types in the type system where mandatory. Feel free to push the change (should not require a change in the processor). Otherwise I can push it with my next Truffle changeset.

@smarr
Copy link
Contributor

smarr commented Feb 14, 2016

Just wondering, what is the concrete use of @TypeSystem without a list of times?

From the javadoc, I would assume it helps the DSL to keep specializations of different node hierarchies separated.

@chrisseaton
Copy link
Contributor Author

@ImplicitCast?

@smarr
Copy link
Contributor

smarr commented Feb 14, 2016

You mean the @TypeSystem is useful to define @TypeCast, and @TypeCheck methods? Ok, forgot about that.

But, what was @ImplicitCast again? It happens to be neither referenced from the TypeSystem JavaDoc nor documented :)

@chrisseaton
Copy link
Contributor Author

JRuby uses @ImplicitCast to promote integer and floating-point types where we don't want specialisation for individual types. I think I've been told it's not ideal for some reason but haven't resolved it yet https://github.com/jruby/jruby/blob/34b32e9c786b916471c1077755340129b1d90d56/truffle/src/main/java/org/jruby/truffle/language/RubyTypes.java.

If something needs more documentation that's a separate issue to adding this default value.

@chumer
Copy link
Member

chumer commented Feb 14, 2016

The only use-case for having the types specified in @TypeSystem is to have the generated is* and as* methods in the generated type system code. For types in @ImplicitCast, @TypeCast and @TypeCheck to work they don't need to be specified in the type system anymore.

I was tempted in the past to deprecate the typesystem types all together because the benefit is rather small. Objections?

Yes documentation also needs to be updated. Will do as part of this issue.

@chrisseaton
Copy link
Contributor Author

I don't mind it being deprecated as I'm not using it.

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

3 participants