-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support OCaml 4.14 #14
Conversation
I haven't tested the GitHub Actions changes ... I expected it to run in this PR but I guess that isn't enabled yet. |
Hello @jonahbeckford It was very nice to see your username appear in my PR notifications. In fact, this is the first PR from an external contributor in this project. I will take a moment to celebrate. Thank you! Some context out of my head:
hashtbl.ml external seeded_hash_param :
int -> int -> int -> 'a -> int = "caml_hash" [@@noalloc]
let hash x = seeded_hash_param 10 100 0 x int.ml external seeded_hash_param :
int -> int -> int -> 'a -> int = "caml_hash" [@@noalloc]
let hash x = seeded_hash_param 10 100 0 x Besides, even at the cost of a small performance hit, personally I'd be perfectly happy with using Re: enabling workflow from external contributors I don't have much experience with this yet, and will think about it a bit more. For now I am going to look into enabling the run for this PR. I may relax this in the future (TBD). |
Thanks!
I expect a future optimization will be available for (** file: int.ml *)
external seeded_hash_param_int :
(int [@untagged]) -> (int [@untagged]) -> (int [@untagged]) -> (int [@untagged]) -> int = "caml_hash_int" [@@noalloc]
let hash (x: int) = seeded_hash_param_int 10 100 0 x I'm a bit surprised that isn't there already since |
I wanted to ask you, while you do your testing, would you consider adding a custom repository to a local switch? It's easy enough for me to add preview packages to https://github.com/mbarbin/opam-repository Alternatively, I think it should be possible to Meanwhile, if you wanted to shadow The testing aspect of GitHub workflow might require a bit more work, so this can be done as a subsequent PR, so you're not blocked on it. |
No problem. I have my own repository I can add this to. It is fine if it takes a few weeks (or even months). |
I want to address #23 as part of the effort to support If you do some testing with |
Context: I'm considering using Provider in DkCoder. The main simplifier is that I have structural information from codept about all the modules, module types and functors in a project. Another simplifier is that I can and do inject modules aliases on the top of each One of the last features to implement is conditional modules. For example, having I have an initial design based on matching functor parameter types (ex. When I get to finalizing the design next year, I might switch to use your Provider implementation. But one big difference is I can only take advantage of module/module type information (ex. the Anyway, that is my thoughts for now. I probably will ask more questions next year. But I'm open to suggestions before that. nit: I'm not a huge fan of the naming |
I'll need some time to look into the context. Thank you for letting me know.
Thanks very much for giving feedback, much appreciated. Here is my reasoning on that one: I tried to re-use a common pattern for that name - That being said, I agree with the verbosity. What I envision, is that a library using On added benefit is that you may then rename it according to the actual project ( |
Ah, I see. I thought it would be visible in end-user code but that was incorrect. Perfect! No issue with that. Thanks |
@jonahbeckford provider.0.0.11 is now available in the main public opam-repository, with support for OCaml 4.14. Thanks again for your help!! Re: the other topics discussed in this PR. I would be in favor of saving what needs further toughts/discussion as new discussion tickets in the |
Thanks! Opened discussion and am closing this issue. |
Currently the
provider
library supports OCaml 4, except for a minor use ofInt.hash
introduced in 5.1. Theprovider-tests
library, since it is tied to Jane Street libraries, depends on OCaml 5.2.This PR drops the requirement for
provider
down to OCaml 4.14. It can probably go much lower, but 4.14 is the LTS version. (And I haven't decided whether I'm going to use it yet ... but couldn't test it until it worked on OCaml 4).This PR provides differing OCaml 4 and OCaml 5 implementations of
Uid
... the OCaml 5 version usesInt.hash
while OCaml 4 uses the (slightly slower) polymorphicHashtbl.hash
. There should be no difference in functionality+performance for OCaml 5.