Giter VIP home page Giter VIP logo

webr's Introduction

WebR - R in the Browser

This project aims to compile the statistical language R (https://www.r-project.org/) into WASM for use with a browser, via Emscripten (https://emscripten.org/).

Included in the repo is a Dockerfile which can be optionally used to setup an environment and toolchain for compiling R's source code and supporting libraries, written in both C and Fortran. If you are compiling webR without Docker, ensure that you first have the Emscripten SDK installed, along with some required prerequisites:

  • cmake
  • wget
  • quilt
  • liblzma
  • libpcre2

R's Fortran source files can be compiled with either a custom development version of flang (the default) or with gfortran and Dragonegg (using the --with-dragonegg configure option).

The repo includes patches for R's source code so that it can work in the browser environment provided by Emscripten. The patches also tweak R's interactive mode so as to provide a web-based REPL through the use of jQuery Terminal.

Instructions

Clone the repo into a new directory, cd into the directory, then run ./configure && make. You can configure make variables in a ~/.webr-config.mk file.

A dist directory is created which when finished contains the R WASM files and an index.html file ready to serve an R REPL.

Demo

A demo of the resulting R REPL can be found at https://webr.gwstagg.co.uk/

Loading the page will initally result in a black screen. Please be patient as the WASM runtime downloads and executes. R will display a banner message when it is ready to use.

webr's People

Contributors

georgestagg avatar lionel- avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.