Wasm comes to R
March 9, 2023
Wasm comes to R
Posit (formerly RStudio) today released an early version of an R package that brings WebAssembly (Wasm) to R.
Aimed at developers, the WebR package (available at https://docs.r-wasm.org/webr/latest/) “is a version of the open-source R interpreter compiled for WebAssembly, along with a supporting [JavaScript] TypeScript library,” Posit’s George Stagg wrote in a blog post this morning.
“Absolute game changer of an #RStats package,” Bruno Rodrigues, author of the chronicler R package, said in a post on Mastodon.
The project includes a webR kernel for the JupyterLite Wasm project for Jupyter notebooks. That means users of JupyterLite can now run R code as well as Python in their notebooks. You can see that implemented at: https://jupyter.r-wasm.org/lab/index.html
The package includes a demo Web-based interactive R console. A version of that console is currently online at: https://webr.r-wasm.org/latest/.
Creators of WebR envision package developers using the Web console in online documentation, so those interested in a package could try it out without having to install it locally or run installation in the cloud.
In addition, it could have a number of uses in education and training. And, Stagg wrote, it offers the potential for a version of Shiny Web framework for R that wouldn’t require an R server. The new Shiny for Python already doesn’t require a server.
Copyright © 2023 IDG Communications, Inc.
<!-- var slotName = 'bottomleaderboard'; var slotSize = []; if ($thm.deviceClass == 'mobile') { slotSize = [[300,50],[320,50],[300,250]]; } else if ($thm.deviceClass == 'tablet') { slotSize = [[728,90],[468,60]]; } else { slotSize = [[728,90],[970,90],[970,250]]; } IDG.GPT.addDisplayedAd(slotName, "true"); document.write('
'); IDG.GPT.defineGoogleTagSlot(slotName, slotSize, false, true); document.write('
'); $('#' + slotName).responsiveAd({screenSize:'971 1115', scriptTags: []}, true); //-->