Getting Started
Collektive is composed of several independent components:
- The core DSL (Domain Specific Language) defining the language syntax and semantics.
- The compiler plugin used to automatically devise the communication protocol based on the program's structure.
- The stdlib (Standard Library) providing common functionalities and data structures.
Collektive is designed to be used in a multiplatform environment, allowing you to run the same code on different platforms (JVM, JS, Native) with minimal changes, and uses Gradle as build system. Even though Collektive is designed to be used in a multiplatform environment, it can also be used in a single platform environment (e.g., JVM only).
Compiler plugin setup
To use Collektive in your project, first add the compiler plugin to your build.gradle.kts
file:
plugins {
kotlin("multiplatform") version "<kotlin_version>"
id("it.unibo.collektive.collektive-plugin") version "<latest version>"
}
The compiler plugin it's a mandatory component of the Collektive ecosystem. It is used to automatically devise the communication protocol based on the program's structure.
Without this plugin, the program will NOT run as expected at runtime.
Dependencies setup
To start you app development, add the dsl
and (optionally) the stdlib
dependencies to your build.gradle.kts
file:
- Multiplatform
- JVM only
kotlin {
jvm()
js()
...
sourceSets {
val commonMain by getting {
dependencies {
implementation("it.unibo.collektive:collektive-dsl:<latest version>")
implementation("it.unibo.collektive:collektive-stdlib:<latest version>")
}
}
}
}
dependencies {
implementation("it.unibo.collektive:collektive-dsl:<latest version>")
implementation("it.unibo.collektive:collektive-stdlib:<latest version>")
}
Collektive supports KMP (Kotlin Multiplatform) projects, allowing you to use the DSL in Native, JS, and JVM environments.
Currently, the following platforms are supported:
- JVM
- JS (node.js and browser)
- Native (iOS, macOS, Linux, Windows)
Collektive is a language and as such it must be executed in an environment that supports it. We suggest getting familiar with the tool by starting with one of our template repositories.