Is Reprocessing alive?


#1

I’m hoping to use Reprocessing, but the instructions at https://github.com/Schmavery/reprocessing say to clone https://github.com/bsansouci/reprocessing-example and follow the instructions there … but there are none.

Attempting to get the reprocessing-example code to run leads to an error in compiling index.re, which is hardly surprising, because part of the code looks like this:

let deleteSelection = (lines, `Select(firstLoc, lastLoc)) => {
let firstLoc = constrainLocation(lines, firstLoc);
let lastLoc = constrainLocation(lines, lastLoc);
let lengthLines
let newLines = Array.make(linesLength - 1, “”);
Array.blit(lines, 0, newLines, 0, row);

where that third-to-last line looks bad to me…

I also get troubles in node_modules/Reasongl/src/reasongl.ml, where I’m warned:
File “/Users/jfh/Desktop/tour/node_modules/Reasongl/src/reasongl.ml”, line 1,
characters 18-22:
Error: Conditional expression type mismatch (bool,string)
[9/16] Building src/native/reasongl_native.reast
FAILED: subcommand failed.

I feel as if there’s probably a way to get going that doesn’t involve reprocessing-example’s nonexistent documentation about setting up a new project, and I’d love to know what that way is…can someone please help?

…also…as long as I’m asking questions, is it essential to use “bsb-native” to make Reprocessing run? Or can I just use bsb?


#2

@jfh Sorry, I think one of my machines has some misconfigured remotes and I pushed some bad changes to master. It’s reverted now.
Normally the repo should just install without any issues. Please let me know or open an issue if you run into any other problems.
For now it’s required to use bsb-native.


#3

Thanks. I’ll give it a try. I did figure out the bsb-native thing (although I’ve yet to actually work out what exactly is the difference betweeen bsb and bsb-native – both seem to result in a Foo.bs.js file appearing in the src directory…presumably something else is going on with compiling the Reprocessing code that I don’t understand.

And I also edited some key-definition file to include “DELETE” because I saw it in a list of recent changes. When I was all done, and tried

% node src/Foo.bs.js

however, I got a warning that “window” was undefined, and gave up. Perhaps the new (by which I guess I mean “old”) version will work better. I’ll report back if not.


#4

The javascript build of a reprocessing app is designed to run in the browser, not in a node process.
The reprocessing-example README should now have instructions about running npm start to start the bytecode executable, which should give the best development experience (with hotreloading). You can see the other scripts in the package.json for different targets (web, native).

The short answer is that when compiling to JS, bsb-native is almost exactly the same as bsb.
Bsb-native is a few additions to bsb that help it be able to build native reason code as well as compiling to javascript like bsb does. The idea being that you can just npm install and be able to build native reason code as if you were using npm normally without needing to install anything new globally.

We’ve been working on trying to get it gradually upstreamed here if you’re interested: https://github.com/BuckleScript/bucklescript/pull/3762


#5

I’ve managed to get a nice image of a pink square and a blue square showing up on my mac. But I think that something might still be wrong with your repo, because here’s the sequence of things I had to do to make it work (I think I got all of them):

% cd ~/Desltop
% mkdir foo
% cd foo
% git clone https://github.com/bsansouci/reprocessing-example.git
% cd reprocessing-example
% npm install bsb-native
% npm install reprocessing
% bsb -make-world   <<leads to an error>>
% vi node_modules/reprocessing/src/Reprocessing_Events.re
  [and in the editor make stuff near the top of the file look like this:
type keycodeT =  
  Reasongl.Gl.Events.keycodeT =    
    | Backspace    
    | Delete
    | Tab
by adding the "| Delete"  line]    
% npm run build
% npm start

#6

And here is what I get when trying to use the example on Linux:

reasonlab> git clone https://github.com/bsansouci/reprocessing-example.git
Cloning into 'reprocessing-example'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 212 (delta 0), reused 2 (delta 0), pack-reused 209
Receiving objects: 100% (212/212), 485.68 KiB | 2.24 MiB/s, done.
Resolving deltas: 100% (104/104), done.
reasonlab> cd reprocessing-example/
reprocessing-example> npm install bsb-native

> bsb-native@4.0.1100 postinstall /home/david/reasonlab/reprocessing-example/node_modules/bsb-native
> node postinstall.js

Unzip successful.                            
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN reprocessing-example@ No repository field.
npm WARN reprocessing-example@ No license field.

+ bsb-native@4.0.1100
added 5 packages from 5 contributors and audited 5 packages in 15.938s
found 0 vulnerabilities

reprocessing-example> npm install reprocessing

> sdl2@2.0.5 postinstall /home/david/reasonlab/reprocessing-example/node_modules/sdl2
> node postinstall.js

No pre-built binaries for linux, downloading source
Unzip successful.                          
Building from source, will take a minute or two.
Looks like SDL2 built successfully.
npm WARN reprocessing-example@ No repository field.
npm WARN reprocessing-example@ No license field.

+ reprocessing@0.3.1
added 6 packages from 3 contributors and audited 15 packages in 44.033s
found 0 vulnerabilities

reprocessing-example> bsb -make-world
File "bsconfig.json", line 1
Error: package bs-platform is not found 
It's the basic, required package. If you have it installed globally,
Please run `npm link bs-platform` to make it available

reprocessing-example> npm link bs-platform
/home/david/reasonlab/reprocessing-example/node_modules/bs-platform -> /home/david/.nvm/versions/node/v11.7.0/lib/node_modules/bs-platform
reprocessing-example> bsb -make-world
[3/3] Building fake_src/sdl_index.cmj
[3/3] Building src/tsdl_new.cmj
[3/3] Building src/tgls_new.cmj
[1/30] Building src/events.mlast
FAILED: src/events.mlast 
/home/david/.nvm/versions/node/v11.7.0/lib/node_modules/bs-platform/lib/bsc.exe  -w -30-40+6+7+27+32..39+44+45+101-44 -color always -bs-quiet -o src/events.mlast -bs-syntax-only -bs-binary-ast /home/david/reasonlab/reprocessing-example/node_modules/Reasongl/src/events.ml
File "/home/david/reasonlab/reprocessing-example/node_modules/Reasongl/src/events.ml", line 1, characters 18-22:
Error: Conditional expression type mismatch (bool,string)
[2/30] Building src/reasongl.mlast
FAILED: src/reasongl.mlast 
/home/david/.nvm/versions/node/v11.7.0/lib/node_modules/bs-platform/lib/bsc.exe  -w -30-40+6+7+27+32..39+44+45+101-44 -color always -bs-quiet -o src/reasongl.mlast -bs-syntax-only -bs-binary-ast /home/david/reasonlab/reprocessing-example/node_modules/Reasongl/src/reasongl.ml
File "/home/david/reasonlab/reprocessing-example/node_modules/Reasongl/src/reasongl.ml", line 1, characters 18-22:
Error: Conditional expression type mismatch (bool,string)
[6/30] Building src/RGLInterface.reast
FAILED: subcommand failed.
Failure: /home/david/.nvm/versions/node/v11.7.0/lib/node_modules/bs-platform/lib/ninja.exe 
 Location: /home/david/reasonlab/reprocessing-example/node_modules/Reasongl/lib/bs

#7

Hey folks, did you try running npm install? If you’re cloning reprocessing-example, the package.json contains any necessary packages and you shouldn’t need to install any of them manually.
Afterwards npm run build will build, no need to have a global bsb install.

The Delete issue was a recent bug that I just fixed, should work if you update your clone and reinstall. Cost of having gradually-improving code! haha thanks


#8

Alas, a version mismatch error; npx run build doesn’t work either.

reprocessing-example> npm install

> sdl2@2.0.5 postinstall /home/david/reasonlab/reprocessing-example/node_modules/sdl2
> node postinstall.js

No pre-built binaries for linux, downloading source
Unzip successful.                          
Building from source, will take a minute or two.
Looks like SDL2 built successfully.

> bsb-native@4.0.1100 postinstall /home/david/reasonlab/reprocessing-example/node_modules/bsb-native
> node postinstall.js

Unzip successful.                            
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN reprocessing-example@ No repository field.
npm WARN reprocessing-example@ No license field.

added 11 packages from 8 contributors and audited 15 packages in 66.119s
found 0 vulnerabilities

reprocessing-example> npm run build

> reprocessing-example@ build /home/david/reasonlab/reprocessing-example
> bsb -make-world

bs-platform version mismatch Running bsb 4.0.11 (/home/david/reasonlab/reprocessing-example/node_modules/bsb-native) vs vendored 6.2.1 (/home/david/.nvm/versions/node/v11.7.0/lib/node_modules/bs-platform)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! reprocessing-example@ build: `bsb -make-world`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the reprocessing-example@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/david/.npm/_logs/2019-12-04T01_02_56_039Z-debug.log

#9

It looks like you ran npm link bs-platform in your previous block of commands. This copies your global install of bs-platform into your node_modules, which conflicts with the local install of bsb-native (I understand that the error message is wrong, sorry).
I would imagine that if you delete all your node modules and only run npm install, it should work (it did when I ran it locally).


#10

Here it is, starting from the original clone (see the rm -rf at the beginning to completely eliminate the old version) – is there a way we can continue this away from the forum since these weird details are probably of little interest to anyone else.

reasonlab> rm -rf reprocessing-example
reasonlab> !?clone
git clone https://github.com/bsansouci/reprocessing-example.git
Cloning into 'reprocessing-example'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 215 (delta 2), reused 0 (delta 0), pack-reused 209
Receiving objects: 100% (215/215), 486.29 KiB | 5.40 MiB/s, done.
Resolving deltas: 100% (106/106), done.
reasonlab> cd reprocessing-example
reprocessing-example> ls
bsconfig.json  index.html  package.json  README.md  require_polyfill.js  src
reprocessing-example> npm install

> sdl2@2.0.5 postinstall /home/david/reasonlab/reprocessing-example/node_modules/sdl2
> node postinstall.js

No pre-built binaries for linux, downloading source
Unzip successful.                          
Building from source, will take a minute or two.
Looks like SDL2 built successfully.

> bsb-native@4.0.1100 postinstall /home/david/reasonlab/reprocessing-example/node_modules/bsb-native
> node postinstall.js

Unzip successful.                            
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN reprocessing-example@ No repository field.
npm WARN reprocessing-example@ No license field.

added 11 packages from 8 contributors and audited 15 packages in 50.28s
found 0 vulnerabilities

reprocessing-example> npm run build

> reprocessing-example@ build /home/david/reasonlab/reprocessing-example
> bsb -make-world

bs-platform version mismatch Running bsb 4.0.11 (/home/david/reasonlab/reprocessing-example/node_modules/bsb-native) vs vendored 6.2.1 (/home/david/.nvm/versions/node/v11.7.0/lib/node_modules/bs-platform)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! reprocessing-example@ build: `bsb -make-world`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the reprocessing-example@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/david/.npm/_logs/2019-12-04T01_41_48_361Z-debug.log

#11

@jdeisenberg I opened https://github.com/bsansouci/reprocessing-example/issues/24 to track this.

@everyone-else feel free to open issues on reprocessing or related repos if you have problems, I tend to see those sooner anyway