Skip to content
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

feat: remove Belt dependency from Stdlib #796

Merged
merged 4 commits into from
Oct 24, 2023

Conversation

anmonteiro
Copy link
Member

  • removes melange.belt as a dependency for the melange stdlib
  • uses OCaml maps in the stdlib again
  • a future PR will stop adding melange.belt to the libraries that melange auto-includes by default

@@ -96,26 +96,14 @@ let public_method_label s : tag =
(**** Sparse array ****)

module Vars =
#ifdef BS
Belt.Map.String
Copy link
Member

Choose a reason for hiding this comment

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

Users of the standard library will lose this "optimization" to not use a functor, do we want to inline Belt.Map.String perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a very good question, that I hope I can answer sufficiently:

  • I think short term the answer is "we don't care" because the benefits (removing belt as a dep) justify it, and the code becomes the same as the upstream stdlib
    • even if it did, I don't think the impact would be important -- and Melange users barely use OCaml objects anyway.
  • longer term we want to add continuous benchmarks to melange, which we've added to the next quarter roadmap. Hopefully we can measure the impact of this change retroactively then.

Copy link
Member

Choose a reason for hiding this comment

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

and Melange users barely use OCaml objects anyway.

Not sure I get this part, could you elaborate? How are objects related to the discussion about larger bundles when using functors?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see, this is the camlinternalOO module 🤦

@anmonteiro anmonteiro force-pushed the anmonteiro/untangle-belt-from-stdlib branch from 8c96650 to bd8ff78 Compare October 24, 2023 02:49
@anmonteiro anmonteiro merged commit 8be6f79 into main Oct 24, 2023
4 checks passed
@anmonteiro anmonteiro deleted the anmonteiro/untangle-belt-from-stdlib branch October 24, 2023 03:42
Unreleased
---------------

- Remove `Belt` as a dependency of `Stdlib`
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change. Most projects use Dune default config for implicit transitive deps, so they will have to add melange.belt to the list of libraries after upgrading. See melange-re/melange-re.github.io#140.

Copy link
Member Author

Choose a reason for hiding this comment

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

will mark it as such. thanks!

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