JXKit icon indicating copy to clipboard operation
JXKit copied to clipboard

License

Open aehlke opened this issue 2 years ago • 4 comments

LGPL is workable but I would suggest also making this available as MIT or the like, thanks.

aehlke avatar Jun 28 '23 19:06 aehlke

@aehlke (not the maintainer, but) do you have any specific use-cases for this that aren't allowed under the LGPL, but are under MIT? The licencing seems fine as is to me.

The only material difference, if I understand correctly, is that you are required to share modifications you make to JXKit itself, which is pretty much good open source practice anyway.

danpalmer avatar Jul 01 '23 11:07 danpalmer

I think LGPL is questionable in App Store - there are requirements around users being able to swap out the LGPL module with another one. I'm not using this project anymore though as I realized JSContext is like 10-20x slower than WKEWebView JS execution/ Thanks

aehlke avatar Jul 01 '23 15:07 aehlke

I think LGPL is questionable in App Store - there are requirements around users being able to swap out the LGPL module with another one.

JavaScriptCore itself is LGPL, so it only makes sense that JXKit use the same license. Millions of apps use JavaScriptCore directly, so clearly linking to an LGPL library does not present any issue for App Store apps. If you have any evidence to the contrary, please share.

I'm not using this project anymore though as I realized JSContext is like 10-20x slower than WKEWebView JS execution/ Thanks

That's a known shortcoming of any app that uses JavaScriptCore: as a matter of policy, apps are not permitted to perform Just-in-Time (JIT) compilation, which can be crippling to the performance of code that benefits from dynamic compilation.

While calling out to a WKWebView does indeed a workaround this contrived limitation – since it executed the JS in a separate (specially entitled) process – it has the downside that all communication needs to be async and you cannot share memory or bind function implementation between JS and Swift (which is JXKit's major value proposition). But if you have large chunks of JS that you can execute asynchronously and in isolation, WKWebView is a good (and potentially higher-performance) way to accomplish this.

marcprux avatar Jul 01 '23 15:07 marcprux

@marcprux great points, thanks!

It should be noted that while WKWebView might be better for many apps on Apple platforms, it's not suitable for cross-platform code that needs to work on, say, Linux. I'm using JXKit for a Swift server as it can use the Linux version of JavaScriptCore.

danpalmer avatar Jul 10 '23 21:07 danpalmer