xtend vs java8

266 views
Skip to first unread message

Salvatore Romeo

unread,
Mar 19, 2014, 5:31:33 AM3/19/14
to xtend...@googlegroups.com
some noticeable new features of java 8 over xtend are:
- interfaces with default methods
- parallel streams
- type annotations for stronger type checking (ex: @NotNull)

Default methods can be implemented in Xtend this way:

given a class A that extends the interface X having a method x, create an active annotation, say @Mix, that works by 
1) adding a method x to A 
2) implementing x using a concrete class Y that implements X
3) Y could be specified using @Mix(Y)

I think that approach would be much cleaner than Java 8, since the interface will still represent just a contract and the implementation is specified elsewhere.

What do you think? What about parallel streams and type annotations? Do you have any experience integrating xtend with the Checker Framework? ( http://types.cs.washington.edu/checker-framework/ )


Sven Efftinge

unread,
Mar 19, 2014, 10:26:47 AM3/19/14
to xtend...@googlegroups.com
some noticeable new features of java 8 over xtend are:
- interfaces with default methods


- parallel streams

they are library and can being used from Xtend

- type annotations for stronger type checking (ex: @NotNull)

Yes, that will be challenging thing to support, but it’s super useful.
That said, type or null safe checking is not part of Java 8.

Default methods can be implemented in Xtend this way:

given a class A that extends the interface X having a method x, create an active annotation, say @Mix, that works by 
1) adding a method x to A 
2) implementing x using a concrete class Y that implements X
3) Y could be specified using @Mix(Y)

I think that approach would be much cleaner than Java 8, since the interface will still represent just a contract and the implementation is specified elsewhere.

What do you think? What about parallel streams and type annotations? Do you have any experience integrating xtend with the Checker Framework? ( http://types.cs.washington.edu/checker-framework/ )

No we haven’t done that.
But we want to work on null safety for sure.

Sven
signature.asc

Salvatore Romeo

unread,
Mar 19, 2014, 10:46:41 AM3/19/14
to xtend...@googlegroups.com
thanks, just commented on bugzilla :-)

parallel streams: is there any 3rd party lib or the libraries are just part of java8?

Christian Vogel

unread,
Mar 26, 2014, 7:54:20 AM3/26/14
to xtend...@googlegroups.com
Salvatore, parallel streams are part of Java8.

Salvatore Romeo

unread,
Mar 27, 2014, 10:59:10 AM3/27/14
to xtend...@googlegroups.com
I see, thanks

Regarding the implementation of the default methods 
Reply all
Reply to author
Forward
0 new messages