diff --git a/rts/index.html b/rts/index.html
index 25639fd..b4629cb 100644
--- a/rts/index.html
+++ b/rts/index.html
@@ -1,204 +1,216 @@
-
\ No newline at end of file
+ function printVal(addr) {
+ console.log('print value from idris', loadValue(addr))
+ }
+
+ fetch('fact.wasm').then(response =>
+ response.arrayBuffer()
+ ).then(bytes => {
+ return WebAssembly.instantiate(bytes, {
+ rts: { raiseError, gc, strWrite, intStr, printVal }
+ })
+ }).then(results => {
+ const {alloc: a, mem: m, main: entry, stackStart} = results.instance.exports
+ mem = new DataView(m.buffer)
+ alloc = a
+ printConstSection(stackStart)
+ main = () => entry(stackStart)
+ main()
+ })
+
+