:rocket: Elide, a Node-like JavaScript/Python run...
# feed
s
๐Ÿš€ Elide, a Node-like JavaScript/Python runtime written in Kotlin, is finally in beta K Many of you have probably seen the job postings and other activity related to Elide here in the Kotlin Slack. Elide is soon going to support Kotlin as an interoperable language that can be run directly, without a build step. As a Python example:
Copy code
# example.py

def say_hello(name = "Python"):
  return f"Hello, {name}!"
Copy code
# example.ts
import py from "./sample.py"

console.log(`${py.say_hello()} + TypeScript!`)
Copy code
> elide example.ts
Copy code
Hello, Python + TypeScript!
Elide enables interop between languages, so once Kotlin is added, interoperability will be available for code in JavaScript, TypeScript, WASM, and Python. We wrote Elide in Kotlin because it means we can all hack on it and enhance it together. Node is written in C++ which is very hard to contribute in. Kotlin is a far superior language, and even beats Node's performance in Elide -- Elide can run TypeScript faster than Node can run JavaScript! Please, give us a star โญ and give the project a try! We need feedback and contributors! https://elide.dev
K 18
๐Ÿš€ 2
m
The link is broken.
๐Ÿ‘ 1
e
s
@Michael Paus Thank you! Fixed
a
Looks very promising! Is there a code example available in a public GitHub repository?
๐Ÿ‘ 2
a
I shared this project on some Discords, and a lot of people replied to me: what would be the point of this project?
s
@Adrien Poupard We don't have many code samples yet, just test scripts and the samples on the website. Good idea, I'll begin adding these!
@Ayfri thank you for posting it! Yeah, we get lots of questions too. There are some clear use cases, like say using React inside your Kotlin. Or using some existing Python code inside your Kotlin, maybe to call an AI model. We can't possibly anticipate every use case and I think the pushback is natural
๐Ÿ‘ 1
m
I still donโ€™t see how this would differ from, e.g., GraalVM and its polyglot features.
s
@Michael Paus Elide is powered by GraalVM! ๐Ÿ˜„ I see you are a man of culture. The difference in that context is that Elide implements the Node APIs on top of the JDK, rather than using Node's existing C++/JS sources (as GraalNode does). The result is that applications built with Elide are not confined to Node's libuv-based eventloop system.
GraalJs is like V8; it is purely a language engine (and a very strong one at that).
But, users want to
import { readFileSync } from 'node:fs'
, and so on, and GraalJs does not come with any of those builtins.
With Elide, when you
readFileSync
, really you are just using
java.nio.*
and
<http://java.io|java.io>.*
through Kotlin.
Elide also adds: TypeScript support, built-in tooling (for example, installation of packages), and other creature comforts; but truthfully, all the performance and interop is just GraalVM. It's an incredible engine.
(With regard to APIs: Elide implements the Node API, and is also (close to) WinterTC compliance. That's the vehicle for standardizing all this on the server side, at least for JS)
Node is to V8, as Bun is to JSC, as Elide is to GraalVM
๐ŸŽ‰ 2
m
I think it would help people making an educated decision to point out these details very early in your documentation.
s
image.png
@Michael Paus it is the first entry on the new Architecture page as a result of your suggestion ๐Ÿ™‚ thank you. I apologize; we haven't had much time to work on the docs yet. We're really not trying to hide anything! GraalVM has been a fantastic framework to work with and for many use cases would be a stronger fit (directly) than what we are building.
I'm pushing a commit shortly to make it more prominent on the home page as well
image.png
There we go. I'm totally happy to advertise it up-front as GraalVM is the source of most of Elide's benefits.
๐ŸŽ‰ 3