d_run
2021-8-2 18:35:28

Is there a test suite for the JavaScript runtime?


vishesh
2021-8-2 18:37:57

d_run
2021-8-2 18:46:11

Okay - I have an issue with the integration tests in which when I run something like ./fixture.rkt -o -v racket-core/hash.rkt it will freeze on the Node portion of the tests.

I can build racket-core/hash.rkt fine with racks and output it with node.


d_run
2021-8-2 18:47:30

will look at the ffi tests - would like to make sure this symbol class i’m working on is tested in JS


vishesh
2021-8-2 20:36:38

I will try running that test on my machine and see hopefully I can be useful in debugging this.

Meanwhile, the unit tests are broken, but those look straightforward to fix.



d_run
2021-8-3 00:08:22

Some observations on using racks

  • when I compile a simple racket file (ex: racks --target webpack test.rkt), it creates js-build but not dist file. The output JS is in modules.

  • when I cd into js-build and run npx webpack there are some module resolution errors:

ERROR in ./collects/racket/list.rkt.js 1:80531-80545 export 'bitwise_xor' (imported as 'M6') was not found in '../../runtime/kernel.rkt.js' ...


vishesh
2021-8-3 00:09:12

It looks like a missing primitive function.


d_run
2021-8-3 00:09:52

bitwise_xor and bitwise_and


vishesh
2021-8-3 00:10:14

We have not implemented all the kernel primitives. The way to fix that would be add bitwise-or and bitwise-and in kernel.rkt file.


d_run
2021-8-3 00:10:16

this is test.rkt

#lang racket (displayln (symbol? 'foo)) (displayln (list-update '(zero one two) 0 symbol->string)) (displayln (list-update '(zero one two) 1 symbol->string))


d_run
2021-8-3 00:10:40

ah ok


vishesh
2021-8-3 00:15:39

You’ll need to use FFI for kernel.rkt. Here is an example of using native JS operators: https://github.com/racketscript/racketscript/blob/master/racketscript-compiler/racketscript/compiler/runtime/kernel.rkt#L66


d_run
2021-8-3 00:16:53

:+1: will start a new branch