TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

WAGI: WebAssembly Gateway Interface

112 pointsby drocer88over 3 years ago

9 comments

gavinrayover 3 years ago
This is awesome to see!<p>I have been working on something like this for a while too. But it uses GraalVM and it&#x27;s &quot;Polyglot&quot; runtime to provide support for JS&#x2F;Ruby&#x2F;Python&#x2F;WASM&#x2F;LLVM languages.<p>It&#x27;s packaged as a single binary using graal-native + Quarkus, or if you don&#x27;t care about that (faster startup time&#x2F;lower memory use&#x2F;no JVM needed) but need maximum performance, you can run it as a regular JVM service as well.<p>It was born out of a need for a polyglot Functions-as-a-Service platform but without the weight of container orchestration -- I needed something I could deploy as a single binary.<p>Essentially OpenFaaS&#x2F;OpenWhisk, minus containers.<p>It doesn&#x27;t use CGI as a request&#x2F;response specification though, it uses Vert.x &quot;RoutingContext&quot; interface which has methods like <i>&quot;.getBodyAsJson()&quot;</i>, <i>&quot;.params(&#x27;something&#x27;)&quot;</i>, <i>&quot;.header(&#x27;foo&#x27;)&quot;</i>, etc.<p><pre><code> https:&#x2F;&#x2F;vertx.io&#x2F;docs&#x2F;apidocs&#x2F;io&#x2F;vertx&#x2F;ext&#x2F;web&#x2F;RoutingContext.html </code></pre> An open standard like CGI probably would have been better, but Graal has marshalling facilities for sharing object types between languages, so the most user-friendly&#x2F;ergonomic thing to do was to share the underlying web request object itself across language boundaries, including all the methods you can call on it.<p>---<p>This has given me motivation to finally finish it so I can publish + open-source it!
nerdponxover 3 years ago
Does WebAssembly even make sense as a standalone runtime, like the JVM? Is &quot;server-side WebAssembly&quot; going to be &quot;a thing&quot;, or is it just a compatibility kludge?<p>And what of all these languages that compile to JS, like Typescript, Reason, Kotlin, et al? Is JS a sound &quot;IR&quot; between the frontend and WebAssembly? Or would it be better to compile things directly to WebAssembly?
评论 #28577003 未加载
评论 #28576969 未加载
评论 #28578879 未加载
评论 #28576993 未加载
评论 #28577937 未加载
评论 #28577083 未加载
评论 #28577238 未加载
评论 #28579465 未加载
luckystarrover 3 years ago
This looks like CGI on WebAssembly. Do the wagi scripts have to be spawned upon every request, or can the somehow persist in memory?
评论 #28577360 未加载
mbStavolaover 3 years ago
I was working on something similar but I found that without interface types[1] you end up with a platform that&#x27;s kinda primitive and pretty unergonomic. I honestly expect to see an explosion of projects in this vein once interface types are a real thing.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;interface-types&#x2F;blob&#x2F;master&#x2F;proposals&#x2F;interface-types&#x2F;Explainer.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;interface-types&#x2F;blob&#x2F;master&#x2F;p...</a>
评论 #28579059 未加载
nynxover 3 years ago
Why would they put things in environment variables instead of having new imported functions to grab various values?
评论 #28576613 未加载
评论 #28576519 未加载
als0over 3 years ago
Can anyone recommend a good introduction to WASM and WASI? Something that covers standalone and browser based?
评论 #28579026 未加载
astlouis44over 3 years ago
WebAssembly gaming is going to be huge.
fleetfoxover 3 years ago
Interesting. What about web sockets?
评论 #28649657 未加载
fnord77over 3 years ago
so this is like WSGI? The almost 30 year old design pattern that blocks on requests waiting for a response from the downstream app and really isn&#x27;t scalabe?
评论 #28576440 未加载
评论 #28576505 未加载
评论 #28576428 未加载