from the many jvm languages appearing nowdays, there's one that seems to be particularly appealing
have a look at
http://fantom.org/doc/docIntro/Tour.html
I just wonder if, when ignoring the dynamic typing feature, the generated bytecode is performant equivalent to java...
ps: added aclaration about performance
I did some quicksort performance testing.
So I'd say that at the moment Fantom's code runs about 10x slower than Java's code. However do note that I used Java's int and Fantom's Int which aren't the same. Java's int are 32-bit and Fantom's are 64-bit.After profiling things a bit there are indications that Fantom code is almost performant as Java. However if performance is absolutely critical, stay away from Lists, use platform specific versions of lists or drop down to native and write in Java.
EDIT: I had a talk with brian and he confirmed my suspicions. The reason Fantom is slower is because all it's
Int
are 64-bit integer and allInt[]
arrays are similar toArrayList<Long>
. The new test show the difference. The reason Fantom is still slower is probably that its Duration, Int and List classes have a lot more methods/fields than plainArrayList
orInteger
orSystem.currentMillis
. It's a tradeoff that may or may not suit you. If you really need high performance just make a native method and program it in Java/C#/Javascript. That way you'll get Java equivalent performance.Here are sources if you want to test it yourself:
Fantom source:
And java with all the Ints replaced by longs and ArrayList. Original Java implementation can be found at http://stronglytypedblog.blogspot.com/2009/07/java-vs-scala-vs-groovy-performance.html.