Top 1,000 Features Creators Events Podcasts Extensions Blog Explorer CSV Download


< >

Xtend is an open source programming language created in 2011 by Sven Efftinge and Sebastian Zarnekow.

#443on PLDB 13Years Old 1kRepos

Xtend is a general-purpose high-level programming language for the Java Virtual Machine. Syntactically and semantically Xtend has its roots in the Java programming language but focuses on a more concise syntax and some additional functionality such as type inference, extension methods, and operator overloading. Being primarily an object-oriented language, it also integrates features known from functional programming, e.g. Read more on Wikipedia...

Example from Linguist:
/******************************************************************************* * Copyright (c) 2012 itemis AG ( and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * * * Author - Sven Efftinge *******************************************************************************/ package example6 import org.junit.Test import static org.junit.Assert.* import import java.util.Set import static extension* class Movies { /** * @return the total number of action movies */ @Test def void numberOfActionMovies() { assertEquals(828, movies.filter[categories.contains('Action')].size) } /** * @return the year the best rated movie of 80ies (1980-1989) was released. */ @Test def void yearOfBestMovieFrom80ies() { assertEquals(1989, movies.filter[(1980..1989).contains(year)].sortBy[rating].last.year) } /** * @return the sum of the number of votes of the two top rated movies. */ @Test def void sumOfVotesOfTop2() { val long movies = movies.sortBy[-rating].take(2).map[numberOfVotes].reduce[a, b| a + b] assertEquals(47_229, movies) } val movies = new FileReader('data.csv')[ line | val segments = line.split(' ').iterator return new Movie(, Integer::parseInt(, Double::parseDouble(, Long::parseLong(, segments.toSet ) ] } @Data class Movie { String title int year double rating long numberOfVotes Set<String> categories }
Example from Wikipedia:
def sayHello(String name) ''' Hello «name» ! '''

Language features

Feature Supported Token Example
/* A comment
MultiLine Comments /* */
/* A comment
Type Inference
Static Typing
Semantic Indentation X

View source

- Build the next great programming language · About · Resources · Acknowledgements · Part of the World Wide Scroll