-
Notifications
You must be signed in to change notification settings - Fork 80
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
Suggestion: WebAssembly build of libavoid? #44
Comments
You can do that with emscripten. I did that for fun years ago.
to 11. helmik. 2021 klo 16.56 Philip Langer <[email protected]>
kirjoitti:
… I'd be very interested in using the libavoid library in a browser-based
technology stack. Thus, I was thinking whether it would make sense to have
a WebAssembly build of libavoid. Is that something that would be of
interest for the adaptagrams community?
Or are there JavaScript-based alternatives to libavoid's object-avoiding
routing library?
Thanks in advance!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#44>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKORMJ4ULDRQNJ6NH6W6WTS6PVXTANCNFSM4XO7EUKA>
.
|
Thanks, yeah I was thinking about emscripten too. Do you happen to still have the concrete steps, if you've already tried it? |
Unfortunately it's been so long that I did it so I don't remember details.
But libavoid code is really clean so I think I just compiled it with
emscripten without any extra effort.
to 18. helmik. 2021 klo 16.58 Philip Langer <[email protected]>
kirjoitti:
… Thanks, yeah I was thinking about emscripten too. Do you happen to still
have the concrete steps, if you've already tried it?
I think it'd be very nice to have a dockerfile that builds the wasm for
libavoid (or also the other libraries).
I'd be happy to look into providing e.g. the typescript bindings.
Thanks again!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#44 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKORMID3CZ27JTHLINWTD3S7UTGRANCNFSM4XO7EUKA>
.
|
Thanks anyway! Here is a docker command that seems to successfully create a wasm from libavoid:
I'll try to look into creating the bindings in the next few weeks. If anyone is interested in that, please feel free to comment here. |
@planger Thanks for the docker command, was very useful. I'm interesting in the bindings, were you able to create them? I'm new to WASM so still getting a hang of things. |
@Aksem is actually working on providing the bindings and already has a proof of concept for integrating them with https://github.com/eclipse/sprotty. So I hope they will be available soon. |
Very interested in this as well for libdialect. The emscripten idea sounds interesting. |
@clemmy, WebAssembly build of libavoid is already available : libavoid-js. Without many details, usage guide and similar, but it works(small demo). More is also planned, but I am currently working on improving the algorithm of orthogonal routing in libavoid(my fork). |
@Aksem, that's very exciting to hear! Where would you recommend starting when looking at the |
The main source where almost the whole build process is implemented is tools/generate.py script, I would recommend starting with it. Basically, the build process includes following steps(if the same approach is used as in libavoid-js):
Another simple tip based on my experience with libavoid-js: don't try to create bindings for the whole API of library. In libavoid-js it's enough to have ~3-4 classes and a few methods in each of them to be able to use its whole power. All other classes are used mostly internally and are useful for example for custom solutions/modifications, which is not the main use case. So creating one example in C++ or analyzing library API in more details is really right way, I realized that later. Good luck!:) |
@Aksem How do I use libavoid-js from node? Am I correct that I have to adjust generate.py and hard-code ENVIRONMENT="node"? Is there some way to have a universal package? Even when I do that, when I try to
If I hack package.json to use the examples/ variant, then a) the types are not the same as for release b) importing throws an exception:
|
@vlovich, yes, creating a universal build of the package should be possible. I already have a test version and will finish it over the weekend. I need to do more tests in different environments. |
@vlovich , sorry it took longer as expected and was not so straightforward. Anyway new v0.2.0 release is out and supports node.js(Aksem/libavoid-js#5). I would be happy to receive a feedback in libavoid-js repository if you try it. In case of new issues, please report them in https://github.com/Aksem/libavoid-js repo.
|
I'd be very interested in using the libavoid library in a browser-based technology stack. Thus, I was thinking whether it would make sense to have a WebAssembly build of libavoid. Is that something that would be of interest for the adaptagrams community?
Or are there JavaScript-based alternatives to libavoid's object-avoiding routing library?
Thanks in advance!
The text was updated successfully, but these errors were encountered: