-
Notifications
You must be signed in to change notification settings - Fork 39
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
Use QuickJS instead of Rust: Rust requires at least 1GB disk space to install #99
Comments
Hello @guest271314 ! Thank you for submitting the issue 😄
Rust is only requirement to develop and build
Currently, Regarding
I may miss some context here. Wasm Workers Server is not a full WinterCG compatible server. We are following the Request / Response model, although we several APIs defined in the Minimum Commom Web Platform API. However, Wasm Workers Server is not limited to JavaScript. We also support other languages like Rust (via wasm compilation), Ruby, Python, and more to come in the future. We discussed in the past the possibility of supporting multiple engines for the same language, but for now we're selecting one per language.
Talking about workers, the only language that requires a compilation step before running the worker is Rust (Zig, Go and others will come in the future). Interpreted languages like JavaScript, Ruby and Python run directly inside the WebAssembly engine. |
I installed the binary with this
index.js in the directory. When I run
So I think there is an issue in your Rust code or I am missing something. After readng your documentation the server should run out of the box. |
Ohh I see @guest271314! That's a trace from the program, so you spotted a bug there :). The This error indicates It would be great if you can provide more context about your environment:
|
Linux xubuntu 5.15.0-43-generic #46-Ubuntu SMP Tue Jul 12 10:30:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux I just downloaded the index.js file to a directory where |
When I create a dedicated directory and place the executable and index.js no errors are thrown. Now I can stress-test. I am streaming raw PCM from the local server to the browser. |
After setting
|
Alright I got it working. We can't return a response to the |
I didn't locate any information in your documentation about how to use
I think you can use QuickJS to achieve the requirement without Rust at all. |
Regarding this error, did you have other folders in the directory you used the first time? I would like to check why this is happening as
Thank you for reporting this! Definitively,
The QuickJS engine is embedded into the To build it, we're using the QuickJS bindings that the Shopify team created for the Javy project. Then, we use a custom entrypoint to load the script and encode / decode output. We may revisit this in the future and compile QuickJS directly as we're doing with other languages in WebAssembly Language Runtimes.
Once |
Yes.
Right, however the functionality of The last time I tested a few days ago the server couldn't keep up with raw PCM stream. It is challenging to even install Rust on system running with a temp file system and RAM. The Rust tool chain is well over 1GB. It is far simpler to fetch QuickJS source code from GitHub and run There are several QuickJS developers interested in a server for QuickJS. Thus this feature request to just develop QuickJS from the ground up making it work - because of that less than 1MB after |
These are good points. Since
Yes, I understand this concern about resource-restricted environments. However, for Said that, we always leave
This is an interesting use case. Do you have any reference, article or conversation I can look at? I would like to learn more about this and how Thank you! |
Thank you! I will take a look at this. Most likely, I will split this issue into a bug fix for |
The QuickJS runtime needs to be exposed. I don't think we need Rust at all but you are are dependent on Rust. The server needs to support sending streams, and at least handle streaming. |
Basically we can use Chrome or Chromium browsers as a local server for testing or as a remote server, so the functionality of the code in this repository needs to be able to emulate or implement a With the ability to use |
This is a great solution for a lightweight JS server. However, it's out of the scope of the For this reason, I believe that having a full-fledged |
What I am saying is you claim to be using QuickJS, but you really don't. You just happen to be using JavaScript that uses the QuickJS JavaScript engine for minimal JavaScript in your code. The observer can't tell what the JavaScript engine is, because the JavaScript used is so restricted. Exposing the complete engine used should be user-defined, an option for the user, not restricted by default. |
Currently,
This is a fair point, although it's the end goal of this project.
In |
I get it. It's your playground. What I find remarkable is all the folks who are using QuickJS as a JavaScript engine for a server, or otherwise implementing a worker type server are reluctant to act on user feedback and provide the user with the option to do stuff outside of what the maintainer arbitrarily restricts. Just ran into similar philosophy over here cloudflare/workerd#423, cloudflare/workerd#419, cloudflare/workerd#420, then the maintainers banned me. It's the same story. Anyway, at least you can handle constructive feedback withut going nuclear because I question your narrative or functionality of the code. I think I'll do better persuading Chromium browser, whic correctly implements Streams and ServiceWorker, rather than maintainers of one of these repositories exposing user options which go against their restrictive philosophies - even when the application is out of their control. |
Is your feature request related to a problem? Please describe.
The last time I checked Rust requires at least 1GB of disk space to install. When running a live OS using RAM starting out with 1GB of disk space installing Rust is prohibitive, essentially not possible.
Describe the solution you'd like
Develop the server application relying on QuickJS or txiki.js. QuickJS after
strip
is less than 1MB.tjs
(txiki.js) executable after building is 7.6MB withoutstrip
and supports WASM.Describe alternatives you've considered
I proposed WinterCG take up specifying a server that can be used by Node.js, Deno, Bun, QuickJS, txiki.js. The reply was that is not in the scope of their goals.
Options are limited when Rust is a requirement.
Additional context
We only have to build the network binding once. Then we don't have to rely on 1GB+ Rust installation anymore just to compile a local server.
The text was updated successfully, but these errors were encountered: