2

I've had a lot of trouble trying to install Reprocessing, a kind of basic graphics library that can be used from ReasonML or ReScript, and which has been updated in various ways, but the documentation/README is a bit incomplete, and various sources indicate that there might be a conflict between it and a globally-installed bucklescript, etc.

So my question (which I'll self-answer) is "How, in 2021, can I install Reprocessing on a Mac and make a demo program show some graphics?"

John
  • 509
  • 1
  • 6
  • 18

1 Answers1

2

Here's a sequence of operations I performed on a Mac running Mojave, on which Node and Rescript were already installed, and I wanted to get rid of them and start from scratch. Not all steps are probably necessary, but these worked. I should mention that Python is also installed. To do all this, I opened a Terminal window running Bash. Everything from "//" onwards on a line is a comment. I also had, in my home directory, a folder called cs17 in which there was some leftover junk from prior attempts.

npm uninstall -g bs-platform          // get rid of bucklescript
nvm deactivate                        // get ready to uninstall Javascript
nvm uninstall node                    // do it
nvm install node                      // start with a fresh Javascript
npm install reprocessing              // use the package manager to install reprocessing
cd ~/cs17                             // go to the target directory
/bin/rm -rf *                         // and clean it out
git clone https://github.com/bsansouci/reprocessing-example.git // grab example code
npm install                           // I don't know why one should do this, but some instruction said to
cd reprocessing-example/              // change to the directory in which the sample code lives

npm install bsb                       // reinstall bsb, so that I can compile ReasonML and ReScript code
npm run build                         // compile everything (for "native" use perhaps?)
npm run build:web                     // compile things so that they can run in a browser
python -m SimpleHTTPServer            // start a simple webserver than can serve up this project

Finally, in Chrome, visit http://localhost:8000/ and see a pink square with a smaller blue square drawn atop it. Success!

I hope this is of some use to someone else, even if it's not the definitive (or even rational!) answer.

John
  • 509
  • 1
  • 6
  • 18