Skip to content

Files

Latest commit

c6048cb · Jun 27, 2020

History

History

backend

To test out the backend, install the necessary nodejs dependencies, ensure
$WYVERN_HOME is set properly (see the Wyvern installation instructions), and then
bootstrap. Bootstrapping takes ~8min on a reasonably fast machine.

$ cd native/javascript
$ npm install
$ cd ../../wyvern/backend
$ ./bootstrap.sh

This will automatically do a sanity check to ensure that the bootstrapped
compiler correctly compiles itself.

Then, all of the examples in the examples directory can be run with

$ ./test.sh

Any wyvern file should be runnable with

$ ./test.sh path/to/file.wyv

If you make changes to the compiler and want to rebuild, run

$ ./self-bootstrap.sh

The old boot.js will be moved to boot.js.old. Sanity checks ensuring the new
compiler at least compiles itself will be automatically run. Note that the backend
is designed to function with both the interpreter (java platform) and when compiled
by itself using the javascript platform. Only a complete bootstrap will test both
of these platforms; ./self-bootstrap.sh only uses the javascript platform.

================================================================================

If you make changes to the bytecode.proto file, you'll have to regenerate the
autogenerated java code which the backend FFIs into:

$ protoc bytecode.proto --java_out=../tools/src/

The autogenerated code makes the linter upset, so turn it off for that file:

$ vim ../tools/src/wyvern/stdlib/support/backend/BytecodeOuterClass.java
And add to the top of the file:

"// CHECKSTYLE:OFF"

Then rebuild:

$ cd ../tools
$ ant build

================================================================================

This directory also contains code that connects the backend to the verifier.
This relies on the protobuf definitions in the wyvern/grad-ver project,
in protobuf-mock/AST.proto.  Run this with:

$ protoc AST.proto --java_out=<<path to wyvern/tools/src>>

As above, add "// CHECKSTYLE:OFF" to the top of the generated file and rebuild.