You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In fact, library adaptation is easy
I've looked at the deno-webui source code and I don't think the way to download and unzip the webui library is elegant enough
I was thinking how can I introduce dynamic libraries in a more elegant way
@7flash provided webui-dev/deno-webui#39
This solves the issue of missing dynamic libs in the compiled version deno --compile
If you think this approach is better, then let's use it in both Deno and Bun.
@7flash provided webui-dev/deno-webui#39 This solves the issue of missing dynamic libs in the compiled version deno --compile If you think this approach is better, then let's use it in both Deno and Bun.
the implementation, which embedded the library as json in the compilation result and then unzipped it at run time, which slows down startup time, especially on windows
However, there is another problem. The ffi function provided by bun can only read the data pointed to by the c pointer according to the number of bytes offset, but the webui uses the size_t type, which seems to be different in different platforms
I recently restarted the work, but currently webui does not support direct embedding of dll for use, so the compromise is to embed the dll file, then release it to the system's tmp location, and then perform dlopen
Activity
jinzhongjia commentedon Jan 17, 2024
In fact, library adaptation is easy
I've looked at the deno-webui source code and I don't think the way to download and unzip the webui library is elegant enough
I was thinking how can I introduce dynamic libraries in a more elegant way
AlbertShown commentedon Jan 17, 2024
@7flash provided webui-dev/deno-webui#39
This solves the issue of missing dynamic libs in the compiled version
deno --compileIf you think this approach is better, then let's use it in both Deno and Bun.
jinzhongjia commentedon Jan 17, 2024
ok, thx
jinzhongjia commentedon Jan 17, 2024
the implementation, which embedded the library as json in the compilation result and then unzipped it at run time, which slows down startup time, especially on windows
jinzhongjia commentedon Jan 17, 2024
bunjs natively supports embedded files, and I'm looking for ways to load embedded dynamic link libraries directly
AlbertShown commentedon Jan 17, 2024
In this case, Bun may use a different method than Deno, which is fine.
jinzhongjia commentedon Jan 17, 2024
However, there is another problem. The ffi function provided by bun can only read the data pointed to by the c pointer according to the number of bytes offset, but the webui uses the
size_ttype, which seems to be different in different platformsjinzhongjia commentedon Jan 17, 2024
I'm not sure it must be 8 bytes in size when it's in a 64-bit library (bunjs only supports 64bits system)
The copilot said it depends on the compiler
At least I used gcc to test, which treats
size_tas 8 bytesjinzhongjia commentedon Jan 17, 2024
bunjs can't load dynamic link libraries directly from memory, so maybe we should offer two alternatives:
sensiblearts commentedon Sep 20, 2024
Could this announcement make it easier?: https://bun.sh/blog/compile-and-run-c-in-js
jinzhongjia commentedon Sep 20, 2024
I'll try it later, it seems to work
sensiblearts commentedon Sep 20, 2024
@jinzhongjia , if you would like help with this, feel free to ask me.
Arztpla commentedon Jan 12, 2025
Any updates?
jinzhongjia commentedon Jan 12, 2025
I recently restarted the work, but currently webui does not support direct embedding of dll for use, so the compromise is to embed the dll file, then release it to the system's tmp location, and then perform dlopen
AlbertShown commentedon Jan 13, 2025
For now, as a workaround, the user can simply manually copy the DLL into the same folder as Bun script.