When comparing Julia vs Xtend, the Slant community recommends Julia for most people. In the question“What is the best programming language to learn first?” Julia is ranked 12th while Xtend is ranked 68th. The most important reason people chose Julia is:
Julia runs almost as fast as (and in fact in some cases faster than) C code.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Almost as fast as C
Julia runs almost as fast as (and in fact in some cases faster than) C code.
Pro Strong dynamic typing
Dynamic and high level, but does not isolate the user from properly thinking about types. Can do explicit type signatures which is great for teaching structured thinking.
Pro Great standard REPL
Out of the box Julia has a very good Read-Eval-Print-Loop, which both completes functions and types, as well as completion based on history of previous statements. It integrates well with the shell and has an excellent online help system.
Pro Nice regular syntax
Julia code is easy to read and avoid a lot of unnecessary special symbols and fluff. It uses newline to end statements and "end" to end blocks so there is no need for lots of semicolons and curly braces. It is regular in that unless it is a variable assignment, function name always comes first. No need to be confused about whether something is a method on an object or a free function.
Unlike Python and Ruby, since you can annotate the types a function operates on, you can overload function names, so that you can use the same function name for many data types. So you can keep simple descriptive function names and not have to invent artificial function names to separate them from the type they operate on.
Pro Written in itself
The Julia language is written in itself to a much larger extent than most other languages, so a budding programmer can read through the depths of the standard library and learn exactly how things work all the way down to the low-level bit-twiddling details, which can be englightening.
Pro Powerful n-dimensional arrays
Julia has built in n-dimensional arrays similar in functionality as Python's numpy.
Pro Function overloading
You can have multiple functions with the same name, but doing different things depending on function arguments and argument types.
Pro Amazing learning curve
Julia requires no boilerplate code – a beginner needs to write only the parts they care about. This combined with the REPL provides the best learning experience available.
Pro High-level code
Julia provides a high level of abstraction, making platform-independent programming trivial and easing the learning curve.
Pro Function and operator broadcasting
You can perform operations on scalars, for example 2^2 or [1, 2, 3].^2.
Pro Strong Metaprogramming
Julia allows you to edit Julia code in the language itself and write powerful macros. It is a great introduction to metaprogramming features
Pro REPL-based
The Julia REPL allows quickly testing how some code behaves and gives access to documentation and package management immediately in the REPL.
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.
Cons
Con Young language with limited support
Julia was released in 2012. Due to its short existence, there is a limited amount of support for the language. Very few libraries exist as of yet, and the community is still quite small (though growing quickly).
Con 1-based array and column major
This design probably comes from Matlab, but makes it unnatural to interface C and C++ and python.
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.