-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limitations of es4x? #582
Comments
Hi @santo74, the answer to your question is not a yes or no. Let me start breaking down your questions:
Short answer, no. es4x uses graalvm JS engine underneath. Just like graalvm-node does. The difference is that graaljs engine is purely an ECMAScript engine, think of it, like v8. There are no node specific features included. No native modules, no For example, modules that are meant to run on the browser have a high chance of working in es4x.
Yes. es4x relies on vert.x codegen feature to generate the
There aren't any differences, except You don't have to. You can still go fill vert.x with the |
@pmlopes thanks for the detailed answer. Regarding the node.js compatibility however, I'm a bit confused tbh.
and a bit further on the same page:
And since es4x runs / can run on top of GraalVM I would actually expect the compatibility is the same or at least similar. Can you elaborate a little bit more on this? |
Sure, let me try to keep it simple, when embedding graaljs into a java project, you get only the ECMA runtime. This means that there is no Of course, we could have decided to invert the ownership. Let's say that we would bootstrap vertx from graalvm
For all these reason we only use the engine. Maybe as a cool project, we could try to do some research on inverting this. Some things would be needed. For example, vert.x event loop should be locked to a single core, this would avoid the threading concerns. Second we would need to work the way types are converted, but the current graal API only allows conversion hooks from polyglot to native, and we would need the reverse. If all these features would be available, then yes, integration with NPM would be flawless. To conclude, I'd say, you should look at es4x more like, deno, than node. |
Ok, thanks for the clarification, that makes totally sense now. Anyway, despite those "limitations", es4x definitely seems like a great initiative and since it implements the full Vert.x feature set we will certainly evaluate it further in order to - hopefully - replace some of our current node.js / old Vert.x services. I have one additional question though, since it's still a 0.x version: |
I'm still using a 0.x version because I was hoping to get the "missing" graal features in. However, it has been a couple of years and not that much progress has done in that area. So, I'm pretty sure that our code is very stable, so I could do a 1.x release. Regarding production usage. Sadly, I don't have any numbers or names. Like you, I get many reports of people considering it as an alternative to using java with vert.x, but I haven't heard about anyone publicly stating that their are using it in production. |
Ok, sounds fair enough. |
What are the limitations of es4x, if any, in regards to compatibility with both node.js/npm and Vert.x?
In other words, can I do everything with es4x that can be done with node.js and can I install any node.js library in es4x or are there any known limitations to be aware of?
Regarding Vert.x, does es4x provide 100% of the official Vert.x functionality or are there any limitations to be aware of?
What about the different modules such as Vert.x Web, clustering, authentication/authorization, monitoring, service proxies, etc?
The reason I'm asking this is because we started with Vert.x (java) in the past but after some time we had to (re)write more and more services in node.js because of limitations or incompatibilities we encountered with our Vert.x java services at that time.
As a result we currently have some kind of a hybrid environment where about 50% is written in javascript (node.js) and the other 50% in java (Vert.x), all communicating over a customized NATS implementation because the eventbus bridge wasn't usable in this particular setup.
The java part is stuck at Vert.x v3.5 because of some changes in later versions that are incompatible with the customizations we had to implement in the NATS integration.
Therefore it would be a real lifesaver if we could migrate everything to es4x but before we can do that we have to know how compatible it is with both node.js and Vert.x
The text was updated successfully, but these errors were encountered: