Infrastructure
elide: verb. to omit (a sound or syllable) when speaking. to join together; to merge.
Latest: 1.0.0-alpha11
Elide is a cloud-first polyglot runtime for developing fast web applications. It aims to reduce the barriers between languages and improve performance of existing code, without forcing developers to abandon their favorite APIs and libraries.
[!IMPORTANT] Elide is still in alpha, some features are not fully supported and others may fail on certain environments.
You can install the runtime by running:
curl -sSL --tlsv1.2 elide.sh | bash -s -
After installation, you can run elide help
or elide info
to see more information.
You can also use Elide in a container, or in a GitHub Codespace.
docker run --rm -it ghcr.io/elide-dev/elide --help
elide --help
We provide a GitHub Codespace with Elide pre-installed. You can click below to try it out, right from your browser:
The Elide CLI supports JavaScript out of the box, and includes experimental support for Python, while more languages such as Ruby are planned for future releases.
With Elide, you can write your app in any combination of JavaScript, Python, Ruby, and JVM. You can even pass objects between languages, and use off-the-shelf code from multiple dependency ecosystems (e.g. NPM and Maven Central) all without leaving the warm embrace of your running app.
That means fast polyglot code with:
Elide supports enough of the Node API to run things like React and MUI. Just like platforms such as Cloudflare Workers and Bun, Elide aims for drop-in compatibility with most Node.js software, but does not aim to be a full replacement.
Elide provides .env
files support at the runtime level, without the need for manual configuration or third-party packages.
Environment variables from .env
files will be picked up and injected into the application using a language-specific API (e.g. process.env
in JavaScript).
Elide, by default, works on a closed-world I/O assumption, meaning that it will not allow access to the host machine's file system unless told to do so. This is a security feature but also an immutability feature which can be used to "seal" your application or perform advanced build caching.
Let's see an example, the following JavaScript application configures a built-in HTTP server and adds a route handler with path variables:
// access the built-in HTTP server engine
const app = Elide.http;
// register a route handler
app.router.handle("GET", "/hello/:name", (request, response, context) => {
// respond using the captured path variables
response.send(200, `Hello, ${context.params.name}`);
});
// configure the server binding options
app.config.port = 3000;
// receive a callback when the server starts
app.config.onBind(() => {
console.log(`Server listening at "http://localhost:${app.config.port}"! 🚀`);
});
// start the server
app.start();
The server can be started with:
> elide serve app.js
> elide 17:43:09.587 DEBUG Server listening at "http://localhost:3000"! 🚀
[!IMPORTANT] The Elide HTTP intrinsics are under active development and provide only limited features. We are actively working to improve performance and support more use cases.
The following features are currently planned or under construction:
Elide integrates with Micronaut to provide Server-Side and Hybrid rendering options with very high performance, by running JavaScript code inside your JVM server:
// gradle.properties
elideVersion = 1.0.0-alpha10
// settings.gradle.kts
val elideVersion: String by settings
dependencyResolutionManagement {
versionCatalogs {
create("framework") {
from("dev.elide:elide-bom:$elideVersion")
}
}
}
// then, in your build.gradle.kts files, add the modules you want...
implementation(framework.elide.core)
implementation(framework.elide.base)
implementation(framework.elide.server)
See our samples to explore the features available when integrating with server frameworks, the following code for a server application uses React with Server-Side Rendering:
// server/App.kt
/** State properties for the root page. */
@Props data class HelloProps (
@Polyglot val name: String = "Elide"
)
/** GET `/`: Controller for index page. */
@Page class Index : PageWithProps<HelloProps>(HelloProps::class) {
/** @return Props to use when rendering this page. */
override suspend fun props(state: RequestState) =
HelloProps(name = state.request.parameters["name"] ?: "Elide v3")
// Serve an HTML page with isomorphic React SSR.
@Get("/") suspend fun index(request: HttpRequest<*>) = html(request) {
head {
title { +"Hello, Elide!" }
stylesheet("/styles/base.css")
stylesheet("/styles/main.css")
script("/scripts/ui.js", defer = true)
}
body {
render() // 👈 this line executes javascript without leaving your JVM!
}
}
// Serve styles for the page.
@Get("/styles/main.css") fun styles() = css {
rule("body") {
backgroundColor = Color("#bada55")
}
rule("strong") {
fontFamily = "-apple-system, BlinkMacSystemFont, sans-serif"
}
}
// Serve the built & embedded JavaScript.
@Get("/scripts/ui.js") suspend fun js(request: HttpRequest<*>) = script(request) {
module("scripts.ui")
}
}
By evaluating the JavaScript code built using a Kotlin/JS browser app:
// client/main.kt
// React props for a component
external interface HelloProps: Props {
var name: String
}
// React component which says hello
val HelloApp = FC<HelloProps> { props ->
div {
strong {
+props.name
}
}
}
// Entrypoint for the browser
fun main() {
hydrateRoot(
document.getElementById("root"),
Fragment.create() {
HelloApp {
name = "Elide"
}
}
)
}
[!NOTE] More versatile integration with frameworks like Micronaut and Ktor is planned but not yet supported. The API and packages used for these integrations may change as we add more features.
The following version matrix indicates tested support across tool and platform versions, including Java, Kotlin, GraalVM, Micronaut, and React.
Following this guide is recommended but optional. Depending on the style of development you're doing with Elide, you may not need some of these components:
Status | Java | Kotlin | GraalVM | Micronaut | React | Protobuf/gRPC |
---|---|---|---|---|---|---|
Java 23 | 2.0.0 | 24.1.x | 4.4.x | 19.x | 3.25.2 /1.61.0 | |
Java 21 | 2.0.0-Beta4 | 23.1.x | 4.3.x | 18.x | 3.25.2 /1.61.0 | |
Java 20 | 1.9.20 | 23.0.x | 4.0.x | 18.x | 3.21.11 /1.56.1 | |
Java 20 | 1.9.10 | 23.0.x | 3.11.x | 18.x | 3.21.11 /1.56.1 | |
Java 17 | 1.8.20 | 22.3.x | 3.9.x | 18.x | 3.21.11 /1.42.0 | |
Java 11 | 1.7.22 | 22.3.x | 3.5.x | 18.x | 3.20.1 /1.46.0 | |
Java 8-10 | -- | -- | -- | -- | -- |
The following version matrix describes language support for Elide, including JavaScript, Python, Ruby, WASM, and experimental languages (LLVM, JVM) and future languages which could be supported based on the architecture:
Language | Status | Version | Elide release | Sandboxing | Server | Coverage | VFS | Debugger |
---|---|---|---|---|---|---|---|---|
JavaScript | ECMA 2023 | alpha4+ | ✅ Full support | ✅ | ✅ | ✅ | ✅ | |
WebAssembly | WASI P2 | alpha4+ | ✅ (With JS) | ✅ (With JS) | ✅ | ✅ | ✅ | |
Python | 3.11.x | alpha7+ | Not supported | Not supported | ✅ | ⚠️ | ✅ | |
Ruby | 3.2 | alpha8+ | Not supported | Not supported | ✅ | ⚠️ | ✅ | |
Java | Java 22 | edge | ✅ Partial support | Not supported | Experimental | Experimental | ✅ | |
Kotlin | Java 22 | edge | ✅ Partial support | Not supported | Experimental | Experimental | ✅ | |
LLVM | 12.0.1 | edge | ⚠️ Requires license | Not supported | Not supported | N/A | ✅ | |
TypeScript | 5.x.x | Future release | N/A | N/A | N/A | N/A | N/A | |
CUDA | N/A | Future release | N/A | N/A | N/A | N/A | N/A | |
PHP | 7.x | Future release | N/A | N/A | N/A | N/A | N/A | |
.NET | ECMA 335 | Future release | N/A | N/A | N/A | N/A | N/A | |
Groovy | 4.0.x | Future release | N/A | N/A | N/A | N/A | N/A | |
Scala | 3.4.x | Future release | N/A | N/A | N/A | N/A | N/A |
For officialy supported languages, rough benchmarks are shown below, for server performance, language performance, and startup time:
Language | Server | Language | Startup |
---|---|---|---|
JavaScript | ~660K RPS (75x vs. Node 20) | (Unavailable) | ~0.5s |
Python | (Unavailable) | Up to ~3.0x CPython | ~0.5s |
Ruby | (Unavailable) | Up to ~22.4x CRuby | ~1.5s |
[!NOTE] Newer languages don't have clear benchmarks yet; more are coming soon.
Elide itself is licensed under MIT as of November 2022. Dependencies are scanned for license compatibility; the report is available via FOSSA:
Building and using Elide with Oracle GraalVM requires license compliance through Oracle. For more information, see the GraalVM website.
Code coverage is continuously reported to Codecov and SonarCloud:
Issue reports and pull requests are welcome! See our contribution guidelines or join our discord community and let us know which features you would like to see implemented, or simply participate in the discussions to help shape the future of the project.