As I primarily work in the field of AI, I was faced with the fact that Xtend syntax is a bit verbose when dealing with primitive or array operations.
Array Operators
As I understood it from earlier threads on this subject, array/list indexing syntax is not supported because of limitations in the inferencing / type engine.
It was mentioned that after refactoring the type engine, this would be possible.
Array index by 2.3Array Access Enhancement
The use cases where I ran into issues:
(Please correct me if I'm wrong in any of the cases :) )
- Array/List access and update. E.g.: array[i] += x becomes array.set(array.get(i)+x)
- Multi-dimensional array construction required me to write my own extension methods.
Bitwise operators
Personally, one of the first things I did when working on Xtend was to create bitwise operator extension methods for Long and Integer using &&, ||.
a.bitwiseAnd(b).bitwiseXor(c).bitwiseAnd(d) in my view isn't a viable alternative to a & b ^ c & d.
(Sidenote: For this and other dealings with Inline, I created an TypeReplacer ActiveAnnotation. This just generated methods given a set of target classes (int, long, etc) and replaces the target generic type)
Apart from the ambiguity of && and ||, and the lack of a ^ operator; I haven't run into any problems.
Ideally, the normal bitwise operators would be accessible in Xtend; but I can see where this would conflict with lambda definitions.
At the moment I find myself implementing extensive or mathematical algorithms in Java to avoid the syntactical overhead of Xtend.
Given the above I think it's prudent that a decision gets made on type inferencing support for distinguishing between lambda and other usage, or a choice is made on alternative concise syntax for the above cases.
The issue has lain relatively unaddressed for the past 4 years, with every few months someone mentioning it again.
I'd love to gain some insight into the problems faced during previous efforts to solve these problems.