Skip to content

Conversation

@giltho
Copy link
Contributor

@giltho giltho commented Jun 3, 2025

Using Vector is not required anymore since Dynarray was added to Stdlib in OCaml 5.2.0

That being said, I understand that this means Progress is only compatible with 5.2 and beyond, so I'm not convinced it's a good idea to merge this.
I made it because lem exposes a Vector module and that clashes with the Vector library... And modifying lem is a much harder task than modifying Progress. I did ask the maintainers of lem to hide the export to avoid that issue, but in the meantime I have my fork of Progress.

Still, I thought I'd open the PR and let you make that decision :)

Signed-off-by: Sacha-Élie Ayoun <[email protected]>
@giltho
Copy link
Contributor Author

giltho commented Jun 3, 2025

(That being said, going to OCaml 5 would give a good occasion to address #46 and to give an effect-handler interface to Progress, it's a perfect use case, instead of having to carry around the progress function)

@dinosaure
Copy link
Collaborator

In my opinion, forcing progress to require only OCaml 5.2 is too restrictive for people who use progress and want this library to remain available for 4.14 (at least).

I made it because lem exposes a Vector module and that clashes with the Vector library... And modifying lem is a much harder task than modifying Progress. I did ask the maintainers of lem to hide the export to avoid that issue, but in the meantime I have my fork of Progress.

Another solution could be to rename the Vector module to progress - this module is not intended to be exported.

@giltho
Copy link
Contributor Author

giltho commented Jun 3, 2025

I think the issue stems from the existence of Vector in my opam switch as a dependency of something I import, I don't think it's exported by Progress at all.

But yeah, I agree that it's a bit restrictive.

@giltho
Copy link
Contributor Author

giltho commented Aug 13, 2025

Unfortunately it seems that the library causing my issue is unresponsive. And I can't do without it for now... I guess, in general, it is good to reduce the number of dependencies of progress anyway where possible.

How about this: if Vector is installed, it is used, and if not, we use Dynarray.
Vector is only declared as a dependency if the ocaml version is < 5.2.0

The only downside is that dune-project syntax does not support dependencies conditional on another package -- funnily enough, @craigfe figured that out, and it seems that it hasn't been updated since.

So I've disabled opam file generation from dune for now.

Signed-off-by: Sacha Ayoun <[email protected]>
@dinosaure
Copy link
Collaborator

There may indeed be a solution where, depending on the libraries installed, we could find a way to avoid a name clash.

The problem is that this issue is quite well known in the OCaml community, which normally makes an effort to avoid it. I remember the problem between base64 and extlib's base64, where we also had a name clash.

lem seems a bit stuck in the past and does not take into account the various solutions (with or without dune) that allow this problem to be avoided: in this case, adding a prefix to the modules to avoid this situation.

I would need to look in detail at a possible solution that would satisfy you (and perhaps take Dynarray into account as well), but I won't be able to do so until after 16 September.

@giltho
Copy link
Contributor Author

giltho commented Aug 13, 2025

Sorry I was unclear: I have implemented such a solution in this PR, it passes CI and indeed does not require Vector for OCaml >= 5.2.0

That being said, there is no emergency for me to merge if you can't work on this before next month. I have pinned my fork for now. It's just that keeping pin-depends all over is technical debt I'd like to avoid, which is why I'm trying to upstream the work :)

Signed-off-by: Sacha Ayoun <[email protected]>
Signed-off-by: Sacha Ayoun <[email protected]>
Copy link
Contributor

@kit-ty-kate kit-ty-kate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apart from these two additions, lgtm

@giltho
Copy link
Contributor Author

giltho commented Sep 9, 2025

Looks like it passes CI :) Thank you for your help @kit-ty-kate

@dinosaure
Copy link
Collaborator

Seems indeed good, we must document that at some point for maintainers but I'm good with the idea.

@giltho
Copy link
Contributor Author

giltho commented Sep 10, 2025

There is already comments in the dune file with the rules explaining the reasons and pointing to this PR

Happy to add comments in other places as well, where do you think it would help?

@dinosaure
Copy link
Collaborator

There is already comments in the dune file with the rules explaining the reasons and pointing to this PR

Ah yes, I missed it. So I will not be able to make a proper review and release this week. But I will try to cut one next week 👍. Thanks for your work and thanks @kit-ty-kate for your help.

@giltho
Copy link
Contributor Author

giltho commented Sep 10, 2025

But I will try to cut one next week 👍.

No emergency still :) Thank you!

@dinosaure
Copy link
Collaborator

Ok I look into details in this PR and everything seems good for my point of view. I will merge it and cut a release to help you. I think it introduce however a breaking change that we should explain into the changelog.

@dinosaure
Copy link
Collaborator

Close by #52

@dinosaure dinosaure closed this Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants