Extending the API
From Gophers Slack:
The API ... will be quite a lot and I guess just looking at goja's is good enough start. ...
I have only skimmed the goja API, not enough free time to really study it.
My JS experiences are negligible. I hope we can extend the API gradually and incrementally, starting with the building blocks that enable higher level APIs to be later built upon. And those higher level APIs IMO do not need to be in the modernc.org/quickjs package per se.
A naive question: I guess using JSON for information exchange with a JS engine is not good enough because of the cost of the marshalling/unmarshalling - is that correct? FTR: quickjs.c additionally support the 'std' and 'os' modules. That enables it to r/w access arbitrary files. Some pieces are not working yet (libc does not support popen, fork, for example.), but the rest is passing tests right now. This is just to note another way of data exchange is available, in the unix-y style of "everything is a file".
I thought a bit about calling into Go from JS. I guess the Go function signature will need to be something like func(args ...any) (any, error)
and the Go calle will have to process its arguments, converting them to the right Go types by itself. It is possible to do some magic using "reflect", but I'm not sure it adds much real value and if it belongs to this package.