-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amalgamated release builds? #688
Comments
I assume the upside here is simplified integration in other (than CMake, that is) build systems, right? +1 to that! Now, and I assume you might have imagined this one coming: why not split quickjs.c into some manageable units so edtiors can actually show useful info without choking on the huge file? :-P |
Just my $.02 as an upstream user of QuickJS for the JS engine in Apache CouchDB. From QuickJS we only use In general, we like QuickJS (vs other engines) because of being able to exclude various features: promises, proxy, typed arrays, and a few others. I even wanted an option to force excluding atomics (linking in pthreads) bellard/quickjs#300, but that's still pending ...
Not a bad idea; I had noticed some other QuickJS forks did that. But would that make it more difficult to merge patches back and forth? Thanks for maintaining QuickJS-NG I am debating switching to it eventually as I see a lot of awesome features added here almost daily! |
I am also not using |
Good to see you here! I noticed CouchDB recently added support for QuickJS, nice!
Yeah I think that would work.
Why, is it because of pthreads? Note that unless atomics are used the core QuickJS no longer needs pthreads, as we fixed how class IDs are allocated.
Yes indeed. My comment was partially in jest :-) We did have that discussion in the past and that argument tilts it. FWIW, bellard/quickjs is stalled again, so at some point that argument will become moot I think.
Sweet! We just hit the 1 year mark and still going strong. The project does go beyond simple code changes: https://github.com/quickjs-ng/quickjs/pull/685/files#diff-470544b48379eb103b88603d9588c367fc53ff973a3aa25fe7af7dfda8a55aee |
Makes sense! |
Yep.
The One True Editor doesn't have the slightest problem with quickjs.c so for me this is a non-issue :-)
@TooTallNate do you remember what they were? For quickjs-libc, ifdef'ing out code that doesn't work in environment X is on the table, if it doesn't turn into super brittle spaghetti code. |
It's because of wanting to ensure no workers or any threads are available in that environment. Not linking to pthreads also has a benefit of a slightly smaller executables, and most of all, on Windows, since we still use msys2, it doesn't need distributing the The general idea is guess is in an embedded environment it's a nice feature to have the ability to reduce features easily (no workers, no async stuff, etc). |
Workers are part of libc, so if you just use the interpreter then there would be no worker or any other std or os APIs. Or do you want those? I think the pthreads part is a bit tangential to the issue of amalgamation, can you please open a new issue? |
The pr for the upstream seem to do what we want: bellard/quickjs#300 Ah yes, it's workers for the libc and Yeah it's tangential to the issue, I was just trying to show an example how we use various features in QuickJS and how we prioritize the ability to toggle off features. The amalgamated release could make it harder or easier to do that depending how it's done. SQLite has a bunch of defines to turn things on and off and like Ben mentioned that could work, provided it wouldn't look too spaghettified :-) |
No |
That should be easy to fix. We already have a stub module loader for WASI. Want to send a PR? |
Amalgamated = bundling all source files into a single source file, for easy distribution and building. Well-known example: sqlite
The split into quickjs.c, quickjs-libc.c, libunicode.c, etc., isn't really relevant or interesting to downstream users, just a minor nuisance when trying to integrate it into your build.
One way amalgamation could work is:
Bundle quickjs.c (and quickjs.h) etc. with qjs.c so you only have to
cc -o qjs qjc.c
Ditto for qjs.c
We don't ship run-test262.c, unicode_gen.c, etc.
Amalgamated quickjs.c is a bundle of quickjs.c, quickjs-libc.c, etc. with a define to enable/disable quickjs-libc (default on or off?)
We must ship quickjs.h of course but do we also roll a separate-but-identical copy into the amalgamated quickjs.c?
The text was updated successfully, but these errors were encountered: