可移植至 JVM 與 .NET CLR 的腳本語言 - Fantom
Fantom 前身是 (Fan) 是一個基于 Java 和 .NET 平臺的編程腳本引擎,用來在運行時產生 JVM 和 .NET 平臺的字節碼,該語言是面向對象的,跟 Groovy 和 JRuby 有點類似,可通過特定的接口來集成 Java 的類庫。
示例代碼:
// Hello from Fantom!
class HelloWorld
{
static Void main()
{
echo("Hello, World!")
}
}
該語言原名叫:Fan。它具有以特性:
可移植性: 所編寫的代碼可以移植到Java VM, .NET CLR,和瀏覽器中的JavaScript
熟悉的語法:Java 和 C# 程序員會感覺Fantom的語法非常熟悉
并發:利用內置的不變性和actor模型解決并發性。
面向對象:所有類都繼承自Obj。Value types when you need the performance.
Functional Functions and closures are baked in.
Static and Dynamic Typing Don't like the extremes - take the middle of the road.
Serialization Built-in "JSON like" serialization syntax makes Fantom ideal for declarative programming too.
Elegant APIs We're quite obsessive about providing all the key features required for a standard library, but with much less surface area than the APIs found in Java or .NET.
REST URI literals and a unified namespace of resources identified with URIs.