Skip to content
Kota Mizushima edited this page Jan 22, 2014 · 6 revisions

Onion is a statically-typed programming language on JVM. Some features are similar with Java's them. In addition, Onion provides features to encourage light-weight programming.

Onion

Onion has the following characteristics:

  • Statically-typed

Though Onion is a scripting language, it has static type system. It seems that it is not good to have static type system for scripting. However, the following features improve it:

  • Type of Local Variable Declaration is inferred

In Onion, the first assignment to a local variable means declaration of it. Of course, if needed, explicit type annotation can be added.

  • Lexical Closure

Onion's lexical closure provide the way to convert a closure to an existing SAM type object. It means that you can use the closure in existing library.

  • Language Level Delegation

Although Onion doesn't have multiple inheritances, multiple inheritances are useful sometimes. Onion provides delegations as language level features and the language level delegations simulate multiple inheritance in many cases.

Clone this wiki locally