👋 there!
ES4X is a JavaScript runtime that runs on top of GraalVM and used Eclipse Vert.x for high performance IO and event loop.
reactiverse / es4x
🚀 fast JavaScript 4 Eclipse Vert.x
ES4X
This is the EcmaScript (5.1+) language support for Eclipse Vert.x
Why?
JavaScript is fast, and this is the way to make it even faster
Usage
# add es4x-pm globally
npm install -g es4x-pm
Create a project:
# create a generic project
mkdir my-app
cd my-app
# init the project
es4x init
# add other dependencies
npm install @vertx/unit --save-dev
npm install @vertx/core --save-prod
# will trigger the download
# of the java dependencies
npm install
Create your index.js
:
/// <reference types="es4x" />
// @ts
-check
vertx
.createHttpServer()
.requestHandler(function (req) {
req.response().end("Hello!");
})
.listen(8080);
console.log('Server listening at: http://localhost:8080/');
and your index.test.js
:
import { TestSuite } from '@vertx/unit';
const suite = TestSuite.create(
…The project started a while ago as an attempt to modernize the polyglot aspect of vert.x.
The goals of the project are simple:
- Provide a node-like developer experience
- Expose all APIs as .d.ts files
- K.I.S.S.
As the project has been through experimentation for a long time, there are many undocumented features that need ♥.
It can also be an intesting starting point if you would like to learn more about GraalVM, by reading the code, fixing bugs, or add more tests!
Contributors Wanted
If you're interested in practise your Java
and JavaScript
skills, follow the project link and see the issues tagged as Hacktoberfest
. If you would like to work on other features, please open an issue and we will gladly review it and tag if necessary!
Top comments (2)
Pretty nice :-)
So, as I'm pretty new to the frontend stuff, we can also use TypeScript (which is going to be transpiled into JavaScript) and write the Vert.x related things in TypeScript instead of JavaScript, right?
But... nothing beats Kotlin, probably!? ;-) BTW: Don't take this last line too serious, but I'm really in love with Kotlin so far.
Hi, I'm a vert.x core developer and polyglot developer! So all languages get my love. ES4X is a new JavaScript polyglot alternative to the old vert.x one and it generates TypeScript definitions from all vert.x APIs. This means you can code with both.
The original goal was better tooling/IDE support, but it turns out it gives proper type information to the TypeScript compiler to generate correct vert.x code too!