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

Consider deprecating labelled versions of the stdlib #7400

Closed
vicuna opened this issue Nov 4, 2016 · 9 comments
Closed

Consider deprecating labelled versions of the stdlib #7400

vicuna opened this issue Nov 4, 2016 · 9 comments

Comments

@vicuna
Copy link

vicuna commented Nov 4, 2016

Original bug ID: 7400
Reporter: @dbuenzli
Status: acknowledged (set by @xavierleroy on 2016-11-11T19:06:13Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.03.0
Fixed in version: undecided
Category: standard library
Monitored by: @jmeber @dbuenzli

Bug description

I think it would be good to deprecate the labelled version of the stdlib.

Here are a few arguments.

  1. The support is inconsistent (e.g. why no StackLabels or EphemeronLabels ?).

  2. They are a maintenance burden. When evolving the stdlib one has to remember to update the labelled interfaces (see e.g. GPR875).

  3. Non labelled modules nowadays make use of labelled arguments (e.g. Hashtbl.create, Filename, Unix.symlink)

  4. They split the community into users of the labelled modules and non-users of the labelled modules. I think there's already enough stdlib noise in the eco-system without OCaml's one adding its own.

  5. As a programmer they incur one more choice on me I would prefer not to have to perform. This is especially true for newcomers.

@vicuna
Copy link
Author

vicuna commented Nov 4, 2016

Comment author: @gasche

Meh.

  1. Non-labeled modules use optional arguments, which are sometime used as a way to preserve (partial) backward-compatibility while adding more parameters to a function. That's not the same as naming mandatory arguments.

  2. I don't see exactly how that is a split, given that it is rather trivial to switch from one style to the other, and that pieces of code using either can link with other pieces making a different choice seamlessly. I could see how different and incompatible cooperative concurrency interfaces could split a community, I don't see anything like that here.

  3. In practice most beginners follow what they are taught, and as far as I am aware most people use other libraries from boot (eg. Real World OCaml uses Core), or just rely on the non-labeled function. But then if a teacher decided to encourage labeled arguments, I don't see an issue with that.

I think there is a case for deprecating library modules or compiler-distribution tools that have arguably better alternatives out there (Stream, ocamlyacc). I'm rather skeptical of the current proposal.

@vicuna
Copy link
Author

vicuna commented Nov 4, 2016

Comment author: @alainfrisch

I support this, but we need to come up with a migration story. Would this simply be an external package with the current snapshot of those *Labels modules? (And then give the project to the community if anyone is interested to maintain it.) That would still require to tweak the build system of projects depending on those modules.

@vicuna
Copy link
Author

vicuna commented Nov 4, 2016

Comment author: @alainfrisch

as far as I am aware most people use other libraries from boot

Any volunteer to parse the opam repo to get some statistics? Knowing how much open-source projects depend on core or batteries would be a useful piece of information for all cross-cutting discussions about the future of the stdlib.

I don't see exactly how that is a split

Even if it is not difficult to switch, not being able to copy/paste some code e.g. from StackOverflow or a tutorial adds useless friction.

@vicuna
Copy link
Author

vicuna commented Nov 4, 2016

Comment author: @dbuenzli

@gasche As a user every choice to make has a cost. For the experience of the system I think it's good if we try to eliminate choices whose costs are larger than the benefits.

@Frisch the first step would be to mark the modules as deprecated for a few versions. We could then migrate them to a separate cma for a few other versions (requiring to link against it to use them) and eventually split them off.

@vicuna
Copy link
Author

vicuna commented Nov 4, 2016

Comment author: @dbuenzli

@Frisch opam list has the info.

opam list --depends-on core -s | wc -l
58
opam list --depends-on batteries -s | wc -l
33
opam list --depends-on containers -s | wc -l
5
opam list -a | wc -l
1322

@vicuna
Copy link
Author

vicuna commented Nov 4, 2016

Comment author: @alainfrisch

@dbuenzli Very useful, thanks! Any automated way to group the result by maintainer? (It's not crazy to believe that a good fraction of packages depending on Core come from Jane Street.)

@vicuna
Copy link
Author

vicuna commented Nov 4, 2016

Comment author: @gasche

I find these statistics interesting, but note that Daniel was mentioning choice fatigue "especially among newcomers", and I don't think that newcomers and OPAM package authors make the same technological choices -- or even evaluate them in the same way. (I don't know of newcomers using Batteries (or *Labels for that matter), but maybe some teachers do rely on it?)

That said, I'm just "meh" on that suggestion and I appreciate the effort that you (Alain, Daniel) are ready to pour in stdlib work. If you both agree that something is a good idea, please roll over my opinion with glee.

@dbuenzli
Copy link
Contributor

Unlikely to happen. Let's close this.

@xavierleroy
Copy link
Contributor

Closing as suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants