-
Notifications
You must be signed in to change notification settings - Fork 5
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
Comparison between libui-node & libui-napi #11
Comments
What about compatibility? |
You mean at API level? It's pretty good You can compare https://github.com/parro-it/libui-node/blob/0_3_0/examples/example-from-napi.js and https://github.com/parro-it/libui-napi/blob/master/example/using-classes/index.js |
Great, but what I really meant is node support for NAPI. |
It works with node >=8 |
Are you concerned on getting support for older versions? |
(Most likely not worth it.) |
Lines 19 to 21 in ee33206
Well.. |
Fixed! |
Regarding how to organize the development, I'm in doubt if it would be better to move all the stuff |
What wrapper classes? |
These: https://github.com/parro-it/libui-napi/tree/master/js |
Not sure. |
What about linux and windows? Windows doesn't like the |
Yes, I agree. |
By now, I removed the _Atomic altogether... I should think of a better solution...
Are we using it? |
No, it's used in |
Now I get the reason for that change... |
The Atomic usage could probably be replaced by some other thread synchronization function implemented by libuv |
Took quite a while to find that on the internet. |
I guess, there is no much documentation or example around... I have a collection of bookmark on some reference related to node event loop and libuv docs / example / article. How could I share them? |
a gist? |
https://gist.github.com/parro-it/842ff46a86142c30b1f94f97bb738418 |
N-API is now available in Node 6.14.2. If we want to, these changes would be required:
|
Awesome! Is that a new release where they backported N-API or what?
We can change that stuff, not a great deal...
If I remember correctly, using your we can support node 4? |
Ah no, because it doesn't have N-API I guess... |
Exactly.
Exactly. 😄 |
Why is the library file called |
Uhm, no reason... |
After 21 days of work, the port is almost complete, so I thought to repeat the comparison with the full version of libui-node@0.2.0 nbind version N-API version prebuilt binaries are now available for linux, windows & macOS 32bit. Also the structure of the repo (folders, files, tools) should be almost stable, so I think we could merge back this repo into a new branch 0_4_0 on libui-node as soon are tester branch is merged |
Not needed for macOS. How many 32bit Windows and Linux users are there? |
So what's your plan? If this becomes libui-node 0.4.0, what changes would be in 0.3.0? |
I thought two option here:
I honestly prefer the first option, I fear the second will force us to implements some pieces two times... |
Do you want to include tables in the next libui-node (=napi) release? |
Yes, that's the idea. We are not too far away anyway... |
Well, the project is almost completed, I'm finishing binding of uiTables. So yes, I guess it is in an "experiment ready state". But what are you thinking to experiment exactly? Are you trying to write a small app? |
The version published on npm may be not up-to-date. |
@parro-it thanks for prompt reply. // app.ts
@customElement({
name: 'app',
template: `<template>
<ui-form>
<ui-entry text.bind="firstName" />
<ui-entry text.bind="middleName" />
<ui-entry text.bind="lastName" />
<ui-multiline text.bind="bio" height="50" />
</form>
</template>`
})
export class App {
firstName = 'Andrea';
middleName = '';
lastName = 'Parodi';
bio = '';
} Also able to define your own custom element. This is to verify our renderer of version next, which has worked well so far in my experiment with PIXIjs, NativeScript, and server side rendering. if you are interested, here is the repo About the experiment, thanks for the heads up, I'll give it a go (just finished installing 0.2 though) |
Oh, nice experiment... I remember I spoke with @EisenbergEffect months ago about an Aurelia renderer, but can't recall the issue ATM...
Anyway, libui-napi will have the same public API of previuos libui-node (plus table API that we won't implement in old versions) |
Just installed, beside 2 warnings, I guess everything is good. Will update with result. Thanks. |
@parro-it It was a while ago that we talked but we're finally at a place where we can start working with what you've built. We're deep into our vNext implementation for Aurelia and we're proving out our renderer design to make sure we can render to various interesting targets besides just HTML. @bigopon is spearheading that effort and libui is next on the list :) |
I completed the initial implementation of windows, boxes and multiline entry.
I then created a new branch from 0_3_0 branch of libui-node, removed all the stuff except windows, boxes and multiline entry.
Here is a comparison of the two implementation to help decide if the N-API rewrite is worth the effort:
nbind version
binary size: 627Kb
compilation time: 39s
runtime memory consuption of example.js: 21M
N-API version
binary size 56Kb
compilation time: 7s
runtime memory consuption of example.js: 18M
Considering also that N-API greatly simplify publish of prebuilt binaries, and that it offer much control on memory management and type conversion, my opinion is that the conversion it's totally
worth the effort.
The text was updated successfully, but these errors were encountered: