Coder Social home page Coder Social logo

Comments (7)

merceyz avatar merceyz commented on May 30, 2024 1

Compile on install can be done but then you risk the host system not having the required tools or correct version of tools to build the library.

Some npm packages only ship pre-compiled versions and fail if it doesn't have one for the host and Node.js version, while some fall back to compile on install.

It's easier for us to ignore all that and compile once to WASM.
It's also faster for our users since they don't have to compile anything when installing Yarn.

Also, just to confirm, the SUPPORT_BIG_ENDIAN setting means that result will run on both big and little endian with a single build?

Yes.

Hopefully it doesn't come with too much of a performance hit.

When support for big-endian was added to Yarn the benchmarks indicated almost no impact on performance yarnpkg/berry#3669 (comment).

from emscripten.

sbc100 avatar sbc100 commented on May 30, 2024

It looks like that function was renamed in #21439 but that call was overlooked. I guess we don't have any testing for that setting :-/

Can I ask what your target is that you are using that option?

from emscripten.

merceyz avatar merceyz commented on May 30, 2024

Can I ask what your target is that you are using that option?

Of course!

Yarn compiles libzip to WASM for Node.js and needs to support big-endian systems.
I don't know specifically what systems people run it on but I know at least big-endian s390x systems are in use.

We don't have access to a big-endian system so our CI emulates one while Node.js CITGM validates that it works on a real machine.

from emscripten.

sbc100 avatar sbc100 commented on May 30, 2024

Thanks! Thats good to know. I didn't know yarn was using wasm like this. BTW, can I ask why you/they didn't just go with a native node binary? What is the advantage they/you seen in using wasm under node? (I'm not saying there are not advantages, I'm just wondering why you made the choice).

from emscripten.

merceyz avatar merceyz commented on May 30, 2024

The main reason is reproducibility. We need the output of libzip to be identical on all systems since we checksum the zip files to see if they've been tampered with or corrupted.

It's also easier to compile to WASM once and use it everywhere Node.js works than to make a native Node.js addon for each and every architecture, platform, and libc implementation that Node.js runs on.

from emscripten.

sbc100 avatar sbc100 commented on May 30, 2024

I see, I'm not very familiar with node addon.

Does that mean that npm doesn't generally do compile on install for things like? Does it instead rely on your to compile native extension for evey possible arch up front? That does sounds hard/impossible.

Also, just to confirm, the SUPPORT_BIG_ENDIAN setting means that result will run on both big and little endian with a single build?

I guess we should add more testing of this setting if folks like you are depending on it so much. Hopefully it doesn't come with too much of a performance hit.

from emscripten.

sbc100 avatar sbc100 commented on May 30, 2024

Thanks for the useful data points!

from emscripten.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.