{"id":285655,"date":"2023-11-01T09:00:34","date_gmt":"2023-11-01T01:00:34","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=285655"},"modified":"2023-10-30T22:05:45","modified_gmt":"2023-10-30T14:05:45","slug":"skyrjrdmzhcw","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/skyrjrdmzhcw.html","title":{"rendered":"Shopify \u5f00\u6e90 Ruvy\uff0c\u5c06 Ruby \u4ee3\u7801\u8f6c\u6362\u6210 WebAssembly"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | Shopify \u6700\u8fd1\u5f00\u6e90\u4e86\u4e00\u4e2a\u540d\u4e3a Ruvy \u7684\u9879\u76ee\u3002Ruvy \u662f\u4e00\u4e2a\u5de5\u5177\u94fe\uff0c\u5b83\u63a5\u53d7 Ruby \u4ee3\u7801\u4f5c\u4e3a\u8f93\u5165\uff0c\u5e76\u521b\u5efa\u4e00\u4e2a\u5c06\u6267\u884c\u8be5 Ruby \u4ee3\u7801\u7684 WebAssembly \u6a21\u5757\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u76ee\u524d\u5df2\u6709\u4ece Ruby \u4ee3\u7801\u521b\u5efa Wasm \u6a21\u5757\u7684\u9879\u76ee\uff0c\u6700\u5e38\u89c1\u7684\u662f ruby.wasm\uff0cRuvy \u4e5f\u662f\u57fa\u4e8e ruby.wasm \u6784\u5efa\uff0c\u5e76\u63d0\u4f9b\u4e86\u4e00\u4e9b\u7279\u5b9a\u7684\u4f18\u52bf\u3002<\/p>\n \u5b98\u65b9\u79f0\u521b\u5efa Ruvy \u65e8\u5728\u5229\u7528\u9884\u521d\u59cb\u5316 Ruby \u865a\u62df\u673a\u548c Ruby \u811a\u672c\u5305\u542b\u7684 Ruby \u6587\u4ef6\u5e26\u6765\u7684\u6027\u80fd\u6539\u8fdb\u3002\u6b64\u5916\uff0cRuvy \u4e0d\u9700\u8981\u5728\u8fd0\u884c\u65f6\u63d0\u4f9b WASI \u53c2\u6570\uff0c\u4ece\u800c\u7b80\u5316\u4e86 Wasm \u6a21\u5757\u7684\u6267\u884c\u3002<\/p>\n <\/p>\n WASI \u662f\u4e00\u7ec4\u5bfc\u5165\u7684 Wasm \u51fd\u6570\u7684\u6807\u51c6\u5316\u96c6\u5408\uff0c\u65e8\u5728\u4e3a Wasm \u6a21\u5757\u63d0\u4f9b\u4e00\u4e2a\u6807\u51c6\u63a5\u53e3\uff0c\u4ee5\u5b9e\u73b0\u8bb8\u591a\u5178\u578b\u8bed\u8a00\u6807\u51c6\u5e93\u4e2d\u5b58\u5728\u7684\u7cfb\u7edf\u8c03\u7528\u3002<\/p>\n \u76ee\u524d\uff0cRuvy \u5e76\u672a\u968f\u9884\u7f16\u8bd1\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e00\u8d77\u53d1\u5e03\uff0c\u56e0\u6b64\u9700\u8981\u5b89\u88c5\u5b83\u7684\u6784\u5efa\u4f9d\u8d56\u9879\uff0c\u7136\u540e\u7f16\u8bd1 Ruvy \u624d\u80fd\u4f7f\u7528\u3002<\/p>\n \u5b89\u88c5\u8fd9\u4e9b\u4f9d\u8d56\u9879\u7684\u8be6\u7ec6\u4fe1\u606f\u8bf7\u67e5\u770b README\u3002<\/p>\n \u6784\u5efa Ruvy \u540e\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u6253\u5370\u51fa Hello World\u3002<\/p>\n $ cargo run -- package=cli ruby_examples \/ hello_world.rb - o index.wasm \r\n$ wasmtime index.wasm \r\nHello world<\/pre>\n |