About Web REDUCE
This facility is experimental!
Purpose
Web REDUCE runs as an app in your web browser and does not need any installation. It is intended primarily as a demonstration of REDUCE appropriate for simple interactive experimentation. It is not intended for heavy-duty problem solving (although you can use it however you want).
Running Web REDUCE
Click a button below to open the Web REDUCE main page and run the appropriate version of Web REDUCE, which will start loading immediately and start running as soon as it has loaded. Beware that, the first time you run it (or after an update to the Web REDUCE engine), there will be a noticeable pause while the Web REDUCE engine downloads. But normally it should load and run almost instantaneously.
There are two main versions of Web REDUCE – desktop and mobile – and the button(s) below should start the right version. The mobile version uses less memory than the desktop version and omits some of the more specialised packages, which is currently necessary because of problems with memory management in mobile web browsers and not primarily because mobile devices lack physical memory. The mobile version runs on desktop computers, but probably not vice versa!
Beware that the mobile version defaults to full window mode, which hides the main navigation panel/widget. Full window mode can be controlled using the View menu.
Start desktop Web REDUCE
Start desktop Web REDUCE
with plotting
Start mobile Web REDUCE
Alternatively, you can click on one of the following links to start a specific version of Web REDUCE: desktop, desktop with plotting, mobile.
Limitations
- Web REDUCE will be a little slower than conventional REDUCE and there may occasionally be a noticeable pause while the REDUCE engine downloads.
-
Web REDUCE does not support the standard REDUCE file access
commands
IN,OUTandSHUT, but the File Menu provides emulations of these commands. (Currently these emulations work well on Chromium-based desktop browsers but much less well on other browsers.) -
Web REDUCE does not support compiling or loading user modules
or packages, although it does support compiling procedures using
on comp. It does, however, provide all (or many of) the standard REDUCE packages, which as usual either autoload or can be loaded explicitly with theload_packagecommand. But note that, because of the asynchronous nature of JavaScript, aload_packagestatement must always be alone in its own input and autoload may not always work correctly. This applies in particular if an autoloaded package defines new input syntax. Therefore, before using thematmatrix input operator, you need to executeload_package matrix;otherwise you may get anend-of-fileerror (see below). Note that the Matrix… item in the Templates Menu automatically loads the matrix package the first time it is used. -
User queries do not work, so Web REDUCE sets
off int; on errcont;by default, which provides a reasonable user experience. However, it means that the standard REDUCE operatorsws,inputanddisplayare not available, althoughwsused as a variable works as usual. - Web REDUCE does not provide any input prompts, unlike conventional REDUCE.
-
Any kind of comment at the end of input causes an
end-of-filewarning. Similarly, the first time thematoperator is used (without first loading thematrixpackage) may cause anend-of-filewarning. In both cases REDUCE recovers, and re-inputtingmatseems to work. - You need a recent web browser, preferably the latest version, to run Web REDUCE.
-
Plotting:
- only the last plot is visible since each plot overwrites any previous plot;
- plotting can cause spurious
end-of-filewarnings and fatalend-of-fileerrors; - mobile Web REDUCE does not support plotting.
It may be possible to remove some of these limitations in future.
What is it?
Web REDUCE consists of a graphical user interface (GUI)
implemented using HTML, CSS and JavaScript that runs a Wasm (WebAssembly)
version of the REDUCE engine developed by Arthur Norman and Avery
Laird, which is CSL REDUCE compiled to WebAssembly using
Emscripten. See
SourceForge
for details of how to build this version of REDUCE, which consists
of two files, reduce.web.js and reduce.web.wasm.
The web worker interface to the Wasm REDUCE engine uses code
developed by Arthur Norman and Avery Laird. The Web REDUCE GUI is
modelled on the Run-REDUCE
GUI for conventional REDUCE, which itself is loosely based on the
CSL REDUCE GUI by Arthur Norman.
Typeset mathematics is output using LaTeX code generated by the
REDUCE tmprint package and rendered by
the MathJax JavaScript
library, which is also used elsewhere on the REDUCE web site.
Plotting is provided by Gnuplot compiled to WebAssembly using Emscripten, based on work by CD Clark III. The code to call Web Gnuplot from Web REDUCE is based on work by Hermann Rolfes.
Francis Wright, April 2024