The Kotlin compiler tries to comply with the following goals:
- Provide output that is optimal in size
- Provide interoperability with existing module systems
How it can 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 React. 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.
JetBrains develops and maintains several tools specifically for the React community: React bindings as well as Create React Kotlin App. The latter helps you start building React apps with Kotlin with no build configuration.
Kotlin is compatible with CommonJS, AMD and UMD, making interaction with different module systems straightforward.