When comparing DASH vs Xtend, the Slant community recommends DASH for most people. In the question“What is the best programming language to learn first?” DASH is ranked 52nd while Xtend is ranked 68th. The most important reason people chose DASH is:
Dash has a very fast startup, this happens because the shell is started a lot of times during boot and dash minimizes the work it does during this process.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Fast startup
Dash has a very fast startup, this happens because the shell is started a lot of times during boot and dash minimizes the work it does during this process.
Pro Low memory usage, which matters a lot in embedded
It is designed to be very lightweight and has no support for shell specific extensions that are not POSIX.
Pro Default shell on Debian systems
DASH is the default shell for Debian based systems due to it speed, full POSIX compliance and low overhead.
Pro Full POSIX support
It's fully POSIX compatible, so if your script runs on dash it will probably run on all other shells.
Pro A perfect clone
It's a clone of the original System V4 Bourne shell.
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 Doesn't support all bash features
Dash does not support all bash features, sometimes called 'bashisms' unless explicitly pointed at /bin/sh
.
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.