Skip to content

Adaptive progress #1

Open
Open

Description

@jinzhongjia

I started working on bunjs adaptation

Activity

  1. self-assigned this
    on Jan 17, 2024
  2. jinzhongjia commented on Jan 17, 2024

    @jinzhongjia
    MemberAuthor

    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

  3. linked a pull request that will close this issueDev #2on Jan 17, 2024
  4. AlbertShown commented on Jan 17, 2024

    @AlbertShown
    Member

    @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.

  5. jinzhongjia commented on Jan 17, 2024

    @jinzhongjia
    MemberAuthor

    @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.

    ok, thx

  6. jinzhongjia commented on Jan 17, 2024

    @jinzhongjia
    MemberAuthor

    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

  7. jinzhongjia commented on Jan 17, 2024

    @jinzhongjia
    MemberAuthor

    bunjs natively supports embedded files, and I'm looking for ways to load embedded dynamic link libraries directly

  8. AlbertShown commented on Jan 17, 2024

    @AlbertShown
    Member

    In this case, Bun may use a different method than Deno, which is fine.

  9. jinzhongjia commented on Jan 17, 2024

    @jinzhongjia
    MemberAuthor

    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

  10. jinzhongjia commented on Jan 17, 2024

    @jinzhongjia
    MemberAuthor

    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_t as 8 bytes

  11. jinzhongjia commented on Jan 17, 2024

    @jinzhongjia
    MemberAuthor

    bunjs can't load dynamic link libraries directly from memory, so maybe we should offer two alternatives:

    1. Download the dynamic link library to the user directory when the program is running
    2. The program itself is embedded in the dynamic link library, which is directly released to the user directory during runtime
  12. sensiblearts commented on Sep 20, 2024

    @sensiblearts

    Could this announcement make it easier?: https://bun.sh/blog/compile-and-run-c-in-js

  13. jinzhongjia commented on Sep 20, 2024

    @jinzhongjia
    MemberAuthor

    I'll try it later, it seems to work

  14. sensiblearts commented on Sep 20, 2024

    @sensiblearts

    @jinzhongjia , if you would like help with this, feel free to ask me.

  15. Arztpla commented on Jan 12, 2025

    @Arztpla

    Any updates?

  16. jinzhongjia commented on Jan 12, 2025

    @jinzhongjia
    MemberAuthor

    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

  17. AlbertShown commented on Jan 13, 2025

    @AlbertShown
    Member

    For now, as a workaround, the user can simply manually copy the DLL into the same folder as Bun script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions