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
split js_of_ocaml in sub libraries #265
Comments
I think it's a good idea. We should be careful with backward compat though. |
I am really glad to see this change, also, I think it will be very helpful to cut the dependency of js_of_ocaml.core . |
@bobzhang do you already use js_of_ocaml to run ocaml programs in a browser-less JavaScript context ? If so, may I ask what's your use case ? |
FWIW, my company would also be very interested if js_of_ocaml could be split into parts, with a kernel containing only the compiler and the js runtime support (no OCaml library at all). It would also be of great help if external dependencies for this kernel were reduced to a minimum:
If I'm correct, this would leave only the dependency on cmdliner, which would already be quite good. FWIW, any dependency bring difficulties for at least two reasons: (i) many packages tend to break under Windows, and anyway, OPAM doesn't work with native Windows ports yet, so installing these dependencies is still manual on Windows; (ii) the licenses of all dependencies need to be inspected closely for use in an industrial setting, and even if these licenses are certainly fine for our internal use and our end-user customers, some of our technology customers have stricter rules for the license on the code we deliver to them, including required dependencies. |
I would like to point out that cppo and menhir, being build deps, are irrelevant to point (ii) (and to point (i) if you consider cross compil, but that's a mine field on it's own, I would be very surprised if they didn't build on windows anyway). Splitting everything can be advantageous, but let's not overdo it, as it complicates maintenance and optional dependencies often cause packaging complications. I'm very in favor of @hhugo's original plan, though. |
making |
I agree, and I don't see any either, except duplicating the codebase (urrrgh). |
I don't see why build deps are irrelevant to point (ii) (except for binary packages of js_of_ocaml) : companies that need to build js_of_ocaml codebase need to install these dependencies as well, and so are bound by their license. For instance, if the license of one of these build deps prohibited use for commercial purposes, companies would not be allowed to use them, and so to build js_of_ocaml.
My suggestions were not actually about splitting the package, but rather reducing dependencies for some parts of it. For instance, creating a custom implementation of the base64 encoding function, shipping pre-compiled Menhir parsers, and avoiding cppo in the compiler directory would already address most concerns with dependencies. Users could then quite easily decide to compile only the compiler subdirectory, and this would work e.g. even if lwt is not installed. |
They do need to install them, but the final product doesn't depends on their license. Code generated by a tool is not considered bound by the license of said tool (otherwise binaries produced by caml would be bound by the Q public license !!). You can make money selling binaries produced by OCaml, you can't make money selling modified version of OCaml (except when member of the consortium as I'm sure you are very well aware :p). The same distinction applies to cppo and menhir and any build-time code generator. |
Yes, but when a company installs some software, they need to check that its license allows them to use that software. The fact that their license doesn't pollute their result means that js_of_ocaml are allowed to have e.g. the Menhir-generated code licensed as they see fit. |
This is not a generally true statement. A license can say anything. So no matter how you're using some code, there is the burden of checking its license. |
Indeed, I was talking about most licenses around. |
a sad truth is that opam is not always allowed for some companies. make js_of_ocaml self contained definitely could help more people evaluate such library |
we can have a dev mode and release mode, when you release code, you can release generated code instead |
Can you explain the restriction? I can understand that the default public opam repository isn't allowed, but I don't see why opam wouldn't be allowed. You can rather easily create a private opam repository, which seems very supportive of a company's needs. You can tightly control exactly what packages are available. |
@agarwal the thing is we have our own in-house package system, people don't like to learn yet another package system(I can only play |
Are you sure? The Menhir license could restrict you directly using Menhir yourself, or restrict you in using code generated by Menhir. Do you know which, or do you still have to check with your lawyers about this? If you do still have to check with your lawyers, then your point (ii) doesn't benefit. My point is, I also agree with @Drup about not overdoing it. Avoiding dependencies also causes headaches. |
The burden is transferred to maintainers of js_of_ocaml. If they are allowed to redistribute the code generated by Menhir (and of course they do!) under their own license, users of js_of_ocaml simply don't need to deal with it. Apart from the legal issue, it'd also greatly simplify the technical aspect of installing js_of_ocaml (esp. for companies that cannot use OPAM either because of internal policy or because Windows is one of their supported build environments). |
I don't think so. Some other organization may interpret a license incorrectly. That doesn't free your company from having to abide by the correct interpretation. If you're really concerned about obeying all the rules, your lawyers will still need to get involved. Sorry, I don't mean to drag this conversation on. I just feel people often exaggerate the complications of dependencies, and to me this leads to many problems too. There is no clear answer, and obviously your company may have concerns that I don't understand. We should be less abstract. Do you have a problem using Menhir specifically? The licenses involved are the Q License and LGPL. I'm guessing it won't be hard for your lawyers to approve it. If it is hard, then I'm curious how you manage to use so many other software. (I don't know about using Menhir on Windows, so that may well be a valid point.) |
I think we need a good name for that. So that it be reused by package authors. On my side I have the following names:
Dumping ideas.
Or maybe a better strategy would be In any case I think it's a good idea if the |
We have two kind concerns with any dependency:
We are ok to pay the price for these technical and legal burdens; we are only kindly requesting that external dependencies are introduced sparingly and that small changes allowing to get rid of some of them be considered. Including Menhir-generated parsers in distributed packages (which is an easy way to formalize that they are covered by js_of_ocaml's license) is such a change. Similarly for using Makefile-based conditionals instead of relying on cppo for the compiler subpart (enabling/disabling findlib support). |
Thanks for the explanation. I see you do have substantially greater complications than usual. |
we have exactly the same concerns as @alainfrisch , thanks |
I was wondering it would be possible to split the library a little bit more. I am personally using XmlHttpRequest and loop events, but I would like to get rid of all other dependency (for example window.location). |
Bringing this up for the optional-Camlp4 part. Are we finally ready to translate the lib to PPX and make the Camlp4 bits optional? The OPAM package currently depends on 4.02.x, and so does (I volunteer to do the translation and build system updates, it shouldn't be a lot of work.) |
Is continued support for camlp4 important? Why not get rid of it and reduce the maintenance burden. |
js_of_ocaml.base
(compatible with nodejs & co)js_of_ocaml.dom
? (browser's api)depend on
js_of_ocaml.core
js_of_ocaml.lwt
(lwt specific)depend on
js_of_ocaml.core
andjs_of_ocaml.dom
js_of_ocaml.async
(see Initial support for async (WIP) #261)The text was updated successfully, but these errors were encountered: