Skip to content
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

Server-side Wasm/Wasi Support #1034

Open
lastmjs opened this issue Mar 27, 2024 · 4 comments
Open

Server-side Wasm/Wasi Support #1034

lastmjs opened this issue Mar 27, 2024 · 4 comments
Labels
feature_request Something I need does not exist

Comments

@lastmjs
Copy link

lastmjs commented Mar 27, 2024

What is the problem you want to solve and can not with the current version?

I would like to use the TFHE-rs server functionality in a 32 or 64 bit Wasm/Wasi backend environment. This is not possible currently.

Describe the solution you'd like

Please allow the Rust compilation target of wasm32-wasi and wasm64-wasi.

Describe alternatives you've considered

There are no alternatives when the requirement is for the library to compile and run its server-side components in a Wasm/Wasi 32 or 64 bit environment.

Additional context

I come from the ICP ecosystem and I would like to be able to build ICP applications (canisters) using TFHE-rs. For this to be possible we ideally need to be able to compile this library's server-side functionality to wasm32-wasi and soon wasm64-wasi.

@lastmjs lastmjs added the feature_request Something I need does not exist label Mar 27, 2024
@IceTDrinker
Copy link
Member

hello @lastmjs

wasm32 is likely the wrong target given the size of the objects we manipulate.

wasm64 looks very experimental at best.

It is not in our current roadmap to support wasm for server side execution, however as we are open source you are welcome to contribute and discuss how to get this done.

Cheers

@Skyfacon
Copy link

I encountered the same problem here. I want to know how you solve this problem.

@vladilen11
Copy link

I have the same problem. We need build it on wasm32. 🚀

@IceTDrinker
Copy link
Member

Basically at the moment wasm32 is generally a no go as some structs can go further than the 32 bits (31 in some cases) memory space, also TFHE-rs was designed on 64 bits targets for 64 bits targets initially, once wasm64 is usable then the story changes dramatically as it is "just" another platform that should be mostly supported by default bar some details regarding entropy generation.

We are open source so if there are contributions that are tested those could be integrated down the line.

We would likely not advertise a full wasm support, a bit like Rust does tiering for its platform supports. So it would likely be a "builds, not all the code is guaranteed to work properly" kind of situation initially as wasm execution is super slow compared to native code in our experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request Something I need does not exist
Projects
None yet
Development

No branches or pull requests

4 participants