The Kotlin compiler tries to comply with the following goals:
- Provide output that is optimal in size
- Provide interoperability with existing module systems
How can it be used
Interacting with DOM elements. Kotlin provides a series of statically typed interfaces to interact with the Document Object Model, allowing creation and update of DOM elements.
Interacting with graphics such as WebGL. You can use Kotlin to create graphical elements on a web page using WebGL.
Kotlin can be used together with existing third-party libraries and frameworks, such as JQuery or ReactJS. To access third-party frameworks with a strongly-typed API, you can convert TypeScript definitions from the Definitely Typed type definitions repository to Kotlin using the ts2kt tool. Alternatively, you can use the dynamic type to access any framework without strong typing.
Kotlin is also compatible with CommonJS, AMD and UMD, making interaction with different module systems straightforward.