Skip to content

Commit

Permalink
tweak rts, add test
Browse files Browse the repository at this point in the history
  • Loading branch information
olincb committed May 13, 2022
1 parent 5521a65 commit 12331b8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Make sure you have the following installed:
Run `make tests/{folder}/{number}.wasm` to compile to `main.wasm` in the `server/` folder, which can then be run
from the frontend.

## Errors



## Target Language: WebAssembly

We need to write to `.wat` which is the WebAssembly Text format. From there we can use wat2wasm to turn that into the actual assembly code which can run in the browser.
Expand Down
3 changes: 1 addition & 2 deletions program.wkt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#lang wacket
(define (doubler x) (+ x x))
((lambda (y) (doubler y)) 21)
(integer->char 97)
2 changes: 1 addition & 1 deletion server/public/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const importObject = { io: {read: readByte, write: writeByte, peek: peekByte},
err: {error: error}};

function error() {
output.innerHTML = output.innerHTML + "\n-----------------\n| RUNTIME ERROR |\n-----------------"
output.innerHTML = output.innerHTML + "RUNTIME ERROR"
throw "Runtime Error"
}

Expand Down
2 changes: 2 additions & 0 deletions tests/hustle/9.wkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#lang wacket
(car 8)

0 comments on commit 12331b8

Please sign in to comment.