ruby / ruby/ruby.wasm

Using gems with Node WASI

オープン
#604 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Ruby
スター
875
フォーク
68
平均マージ
9日 5時間
マージ済み PR(30日)
1

説明

Hey, since I needed it myself, and based on https://gist.github.com/kateinoigakukun/5caf3b83b2732b1653e91b0e75ce3390, I wrote JS code that allows you to use gems with Node WASI.

Unfortunately, as you need preopens for that (to map the gems into the WASI vfs), it's currently not possible to use DefaultRubyVM for that, as its options are limited to env.

I wrote my own small wrapper to allow me access to the full breadth of WASI options: https://github.com/primate-run/primate/blob/master/packages/ruby/src/private/wasi.ts, but it took me a bit to understand how to get the RubyVM from the package to mimic the behaviour of DefaultRubyVM. The examples in the cheatsheet are all using DefaultRubyVM.

It is possible to perhaps make DefaultRubyVM a bit more flexible, so that it's possible to use preopens with it?

Alternatively, if you want to keep the defaults simple, perhaps add this example to the readme or cheatsheet? I don't mind sending a PR.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まずcheatsheetとREADMEにあるDefaultRubyVMの使用方法を読み、次にリンク先のwasi.tsラッパーとそのpreopensの扱い方と比較します。意図された結果が、より柔軟なDefaultRubyVM APIなのか、それとも文書化されたNode WASIの例なのかを確認し、gemsをWASI仮想ファイルシステムにマッピングできることを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
node.js, ruby, wasm
領域
backend
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。