Paul Krill
Editor at Large

Wasmer’s WCGI pairs WebAssembly and CGI

news
Apr 10, 20232 mins

WCGI allows existing CGI applications to be reused by compiling them to WebAssembly, taking advantage of ultra-small packages and sandboxed execution, Wasmer says.

peanut butter and jelly sandwich, better together
Credit: Jeffery Goldman

Wasmer aims to “revolutionize” server-side web development with WCGI, a technology that combines the WebAssembly binary instruction format with CGI (Common Gateway Interface). Positioned for serverless computing or running apps at the edge, WCGI promises to allow developers to reuse existing CGI applications by compiling them to WebAssembly/WASI (WebAssembly System Interface).

Wasmer says that WCGI “marries the power of WebAssembly with the versatility and simplicity of CGI.” Introduced April 6, WCGI is intended to present a refined approach to server-side development, leveraging the flexibility, security, and performance of WebAssembly. Developers can ship small packages that only contain business logic and static assets, with no HTTP stack or Docker containers needed. And, thanks to WebAssembly, WCGI enables sandboxed execution, with one isolated request per instance.

Wasmer, which provides a server-side runtime for WebAssembly, cited multiple reasons it believes that WCGI is beneficial for running serverless or edge apps:

  • Websites have been using CGI for decades; WCGI provides a path for deploying in a serverless context.
  • There is no need to pay for an always-on server.
  • WebAssembly apps are considerably easier to distribute than Docker images.
  • Having one process per request is infinitely scalable and allows isolation between requests.
  • Running code inside a WebAssembly VM allows isolation from the underlying OS.
  • Developers can start a new WebAssembly instance in a fraction of a millisecond.

Instructions for creating a WCGI app with Rust or PHP can be found at wasmer.io. Source code for a WCGI template for PHP can be found on GitHub.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author