When comparing Xtend vs Rebol, the Slant community recommends Rebol for most people. In the question“What is the best programming language to learn first?” Rebol is ranked 51st while Xtend is ranked 68th. The most important reason people chose Rebol is:
Rebol's name came from "Relative Expression Based Object Language". Rebol is a functional language and everything is an expression that returns a value. Things that have to be baked into the grammar in other languages are simple function calls with block arguments in Rebol.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Ruby-like syntactic conveniences
Lambdas are written like Smalltalk's blocks. If it's the last argument, it can go after the parentheses like Ruby's blocks. Parentheses on method calls are optional.
Pro Type inference
It uses Java's static type system, but you don't have to declare the type of everything all the time, since the Xtend compiler can usually figure it out. This also dramatically cuts down on Java's infamous verbosity.
Pro Code runs just as fast as Java
Because Xtend relies heavily on JDK and Android classes, it runs just as fast as native Java code.
Pro Easy to switch back to Java
Xtend is a low-risk option. Because it compiles to human-readable Java, if you decide you don't like it for your project, you can just switch back to Java without losing your work.
Pro Extend even library classes with new methods
This is where it gets its name. You can open classes and add new methods, kind of like Ruby. (Of course this has to be compiled to Java, so really it lives in a kind of helper class.)
Pro Succint
Uses functional features ,which are very concise and idiomatic. Plus it has annotations, which cuts down on the Java boilerplate.
Pro Better defaults than Java
Methods are public if you don't specify, and fields are private. Locals declared with val
in Xtend are final
in Java. This dramatically cuts down on Java's infamous verbosity.
Pro Very simple syntax
Rebol's name came from "Relative Expression Based Object Language". Rebol is a functional language and everything is an expression that returns a value. Things that have to be baked into the grammar in other languages are simple function calls with block arguments in Rebol.
Pro Homoiconic
Code is data, and data can be code. Rebol is based on a simple block data structure, used both for data and for the code itself. Blocks can be manipulated programmatically, and then evaluated as code. This makes metaprogramming easy in Rebol.
Pro Human friendly
Almost natural language, for example: write %out.html read http://google.com
.
Pro Graphical user interface
Beginners are usually stuck making command-line applications in other languages, because GUIs are too hard. Rebol GUIs are easy enough to start with.
Pro Domain specific languages
Rebol's simple homoiconic syntax makes it easy to create "Rebol dialects"--domain-specific languages optimized for a particular purpose. The Rebol distribution includes many of these, and users are free to create more. These DSLs make tasks that would be complicated to express in other languages easy.
Cons
Con Difficult to configure in Android Studio
Con Slower compilation
Unlike most JVM languages, Xtend compiles to Java rather than directly to JVM bytecode. So you have to compile everything four times for Android: from Xtend to Java, from Java to JVM bytecode (.class files), from .class to .dex bytecode, and then AOT compilation from .dex to native ARM upon installation. This can really slow down development and testing vs a more interactive language like Clojure.
Con Not (yet?) Free Software
Rebol 2's core is free (gratis) for commercial use, but the license prohibits modification, a violation of the DFSG. Rebol 3 is Free Software (Apache 2.0), but isn't production ready.
Con Very niche language
Small community.
Con No separators
A function call expression has no parentheses, and there are no separators between sequenced expressions, not even newlines. This means that you have to know the arity of every function in an expression to know how to parse it. It also means you can run into subtle, hard-to-find bugs if you don't provide enough arguments, since the result of the next expression will be passed instead.