Compile JavaScript to WASM with no networking involved - just reading STDIN and writing to STDOUT
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript, wasm
Hướng nghiên cứu
Bắt đầu bằng cách đọc tài liệu StarlingMonkey và các entry point của starling.wasm và starling-raw.wasm, sau đó theo dõi cách WIT và đầu vào/đầu ra tiêu chuẩn được exposed. Hoàn tất nghĩa là đã tài liệu hóa các interface I/O được triển khai, WIT tối thiểu và một đường dẫn biên dịch không cần mạng cho JavaScript tổng quát; issue không nêu test hay tệp nguồn nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I've built Native Messaging hosts using several JavaScript to WASM toolchains, or just executed the WASM inside of the JavaScript engine compiled to WASM in the case of QuickJS.
Here's the protocol and documentation published by Chrome, MDN, Edge, Opera, Safari https://github.com/guest271314/NativeMessagingHosts#native-messaging-documentation. In pertinent part
Chrome starts each native messaging host in a separate process and communicates with it using standard input (stdin) and standard output (stdout). The same format is used to send messages in both directions; each message is serialized using JSON, UTF-8 encoded and is preceded with 32-bit message length in native byte order. The maximum size of a single message from the native messaging host is 1 MB, mainly to protect Chrome from misbehaving native applications. The maximum size of the message sent to the native messaging host is 64 MiB.
Note, that the IPC communication is not a TTY.
Several examples of JavaScript compiled to WASM and/or embedded and executed within a JavaScript engine compiled to WASM can be found here
- Javy https://github.com/guest271314/native-messaging-webassembly/blob/main/nm_javy.js
- qjs-wasi.wasm https://github.com/guest271314/native-messaging-webassembly/blob/main/nm_qjs_wasi.js
- js2wasm https://github.com/guest271314/native-messaging-webassembly/blob/main/nm_js2wasm.js
to the extent applicable and comparable to JavaScript or TypeScript,
- AssemblyScript https://github.com/guest271314/native-messaging-webassembly/blob/main/nm_assemblyscript.ts
I was referred to StarlingMonkey over here #general > Embedding JavaScript into QuickJS before compiling to WASM.
To be clear, I am not looking for "a" or "the" JavaScript to WASM toolchain; I'm actively testing, breaking, and vetting JavaScript to WASM toolchains and novel implementations, for research and comparative analysis purposes; without any biases or preferences for any. They all get tested until they break, witout rancor, and without exception or handicap.
Assume
- I have basically zero experience writing WIT
- There is zero networking involved in the JavaScript source code
- I just need to read STDIN and write to STDOUT
Questions:
-
In
nodeworld there isprocess.stdinandprocess.stdout, and evenreadFileSyncpoint to0or/dev/stdinor/proc/self/fd/0, and/dev/stdoutor/proc/self/fd/1, respectively. STDOUT !== WHATWG Console'sconsole. What are the specific I/O interfaces StarlingMonkey has implemented? -
The Component Model has the WIT thing - it's own syntax and bassically an entire language itself. What is the minimal WIT that Component Model compilers expect just to read STDIN and write to STDOUT?
-
How to compile generic JavaScript that expects to done only read STDIN and write to STDOUT (neither specified in ECMA-262) - with absolutely no networking involved, no
ServiceWorker-likefetch()handler at all, using StarlingMokey'sstarling.wasmorstarling-raw.wasm?
- Ngôn ngữ chính
- C
- Star
- 297
- Fork
- 64
- Merge trung bình
- 2 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 19
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bytecodealliance/StarlingMonkey
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
bytecodealliance/StarlingMonkey#359 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bytecodealliance/StarlingMonkey#355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 68/100
bytecodealliance/StarlingMonkey#358 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
bytecodealliance/StarlingMonkey#357 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
bytecodealliance/StarlingMonkey#356 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bytecodealliance/StarlingMonkey
Issue tương tự
-
flac's CMake config is brokenĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
msys2/MINGW-packages#33356 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
facebookincubator/muse-gadget-sdk#355 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
kmod-project/kmod#492 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
PecanProject/sipnet#435 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
SDL_GPU Vulkan: wrong screen orientation on OpenHarmony (preTransform set without pre-rotation)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
libsdl-org/SDL#16670 ·
Maintainer thường phản hồi trong vòng 1 ngày