stan-dev / rstan

RStan, the R interface to Stan
https://mc-stan.org
1.04k stars 265 forks source link

Replace V8 dependency with bundled quickjs #1058

Closed andrjohns closed 1 year ago

andrjohns commented 1 year ago

Summary:

We've had a fair bit of feedback that the upcoming V8 dependency will be restrictive for some systems where it is difficult to install/build the libv8 library. Given that the JS functionality we need is fairly minimal, the full V8 engine isn't necessary for rstan.

This PR removes the V8 dependency in favour of the lightweight QuickJS engine which can be bundled with rstan, allowing for a much more portable package

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Andrew Johnson

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

andrjohns commented 1 year ago

The diff is a bit inflated due to the quickjs headers and sources, the changes can be viewed with those filtered out here

andrjohns commented 1 year ago

I've run the reverse-dependencies with this change as well, and all passes

andrjohns commented 1 year ago

Rather than add the ~65k lines of code of the engine, I've bundled the engine into a package and implemented a similar api to V8 - so very little change to rstan is needed