|
|
|
|
|
by buff-a
5347 days ago
|
|
local syntax transformations This is the key concept, and I disagree with you that this is all Xtend is. Its why I think you are wrong. Specifically, the Xtend transformation is adding information to the java code it generates that it must infer from the Xtend source code. It is precisely not a local syntax transformation. I think you are assuming that because they make it look easy, that all it is is another macro language with, as you say, local syntax transformations. |
|
The key point is whether the transform is local or global. An example of a global transform is turning a program into continuation-passing style because it must change every function definition and function call in the program.
The transforms that Xtend is doing appear to be local. Converting closures to anonymous inner classes is a local transformation. Their "type inference" isn't real whole-program type inference, it just saves keystrokes within certain expressions. The fact that they can show you the underlying Java code that each new feature turns into indicates that the transforms are local.
Also, these types of transformations really are trivial in languages with full-featured macro systems (like most LISP dialects).