Wasmer announces WCGI: WebAssembly + CGI

The Wasmer team announces WCGI – WebAssembly + CGI, which uses WebAssembly for server-side development.

WCGI combines the power of WebAssembly with the ease of use and versatility of CGI. With WCGI, developers can run any CGI application using WebAssembly and Wasmer.

CGI (Common Gateway Interface) is a standard interface between a web server and an application. It enables Web applications to interact with Web servers to produce dynamic Web content. WebAssembly is a new underlying bytecode format that can be executed efficiently in the browser. WCGI combines WebAssembly technology with CGI to enable web applications to write efficient code using WebAssembly and communicate with web servers.

Specifically, WCGI enables the Web server to run WebAssembly modules using the WebAssembly interpreter by loading them into the Web server as applications.

Here are some of the highlights of WCGI:

  • Reuse existing CGI applications (written in AssemblyScript, C, C++, Go, PHP, Python, etc.) into WASI (WebAssembly System Interface).
  • Send ultra-small packets containing only business logic and static resources, without relying on HTTP stacks or bulky Docker containers
  • Runs entirely in a sandbox, WebAssembly code runs in a sandbox, using a separate instance per request

The Wasmer team used WordPress, the most vulnerable WordPress, as an example, saying that thanks to the sandboxing mechanism, using WCGI to run WordPress no longer has to worry about being attacked.

Here is the command to install WordPress locally using Wasmer:

# Install wasmer beta 2
curl https://get.wasmer.io -sSfL | sh -s "v3.2.0-beta.2"

# Execute WordPress
mkdir db
wasmer run-unstable wasmer/wcgi-wordpress-demo --mapdir=/db:db


With WCGI, developers looking for greater efficiency, security, and flexibility in server-side development can truly benefit from this approach.

WCGI represents an improved approach to server-side development that integrates the flexibility, security, and performance of WebAssembly. This innovative technology has the potential to reshape the landscape of serverless applications and provide a powerful and versatile solution for developers’ projects.


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *