Skip to content

Some words about contributing to the stdlib#619

Merged
damiendoligez merged 1 commit intoocaml:trunkfrom
alainfrisch:contributing_stdlib
Jun 20, 2016
Merged

Some words about contributing to the stdlib#619
damiendoligez merged 1 commit intoocaml:trunkfrom
alainfrisch:contributing_stdlib

Conversation

@alainfrisch
Copy link
Copy Markdown
Contributor

We should clear some widespread misconceptions with the policy on contributions to the stdlib. If accepted, this PR should be accompanied by an "official" announcement to caml-list.

CONTRIBUTING.md Outdated

## Contributing to the standard library

Contributions to the standard library are much welcome. There is some
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would use "very" or "quite" in place of "much".

@hcarty
Copy link
Copy Markdown
Member

hcarty commented Jun 16, 2016

This is a nice clarification to have regarding the standard library - thank you for writing it up!

@alainfrisch You mention several examples of things which would not be accepted. I think that list makes a lot of sense, particularly with opam in wide use. It would be useful to have a matching list of suggested areas for contribution. For example, would IO convenience functions be welcome? Adding functions to make the interfaces to modules such as List and Array consistent? Conversion to/from iterators like @c-cube's Gen module works with?

@alainfrisch alainfrisch force-pushed the contributing_stdlib branch from 78d7a76 to 18bc91a Compare June 16, 2016 14:21
@alainfrisch
Copy link
Copy Markdown
Contributor Author

Typos fixed. Thanks for spotting them!

@alainfrisch
Copy link
Copy Markdown
Contributor Author

Adding functions to make the interfaces to modules such as List and Array consistent?

This is what I meant by "filling obvious gaps".

Conversion to/from iterators like @c-cube's Gen module works with?

Could be covered by "facilitate communication between independent external libraries".

I don't want to go into specific suggestions, though. They would be less consensual. Proposals for concrete suggestions could come later and should perhaps be collected elsewhere.

@hcarty
Copy link
Copy Markdown
Member

hcarty commented Jun 16, 2016

I don't want to go into specific suggestions, though. They would be less consensual. Proposals for concrete suggestions could come later and should perhaps be collected elsewhere.

That makes sense. Could you indicate where/who to ask if a specific type of contribution would be welcome? A contributor could create a full PR but if the contribution wouldn't be accepted regardless of implementation details it would be nice to know that beforehand.

@c-cube
Copy link
Copy Markdown
Contributor

c-cube commented Jun 16, 2016

This is pretty cool. I will find some time to submit some carefully selected parts of containers for addition into the stdlib. Would "promoting safer programmation patterns" also be a good reason to integrate into the stdlib? Something linked to providing non-raising alternatives to functions, and better management of resources (channels, etc.).

@alainfrisch
Copy link
Copy Markdown
Contributor Author

Could you indicate where/who to ask if a specific type of contribution would be welcome?

That's not really specific to the stdlib (although more users could feel comfortable contributing to the stdlib rather than the language or compiler). Perhaps just ask on caml-list, or caml-devel, or create a Mantis ticket or Github "placeholder" PR? It could make sense to have something more formalized, but I've no concrete suggestion for now.

@hcarty
Copy link
Copy Markdown
Member

hcarty commented Jun 16, 2016

It could make sense to have something more formalized, but I've no concrete suggestion for now.

Again, this makes sense. Having this text to point interested contributors to is already a big step.

@Fourchaux
Copy link
Copy Markdown
Contributor

Fourchaux commented Jun 16, 2016

May I suggest to take inspiration from work done by F# , especially this one :
https://github.com/fsharp/FSharpLangDesign/blob/master/FSharp-4.0/ListSeqArrayAdditions.md
Concerning Seq, several OCaml iterators are available (my favorite being https://github.com/c-cube/sequence).

Note:
Without opening a 361st discussion (yes, I counted them...) can we really hope that things will move this time ?
It is often said that lack of people and resources at INRIA explain the relative stagnation of the std lib.
However, there is now on earth a person healthy (well, I hope ...),
graduate (Polytechnique, brand new PhD), available, responsive, competent (rewriting/improving Batteries, writing Containers) and, icing on the cake, working at INRIA.
So please, discuss, correct, improve AND accept Mr. Simon 'c_cube' Cruanes' proposals.
(sinon que de temps et de compétences gaspillés, damn it, c'est ... énervant )

@alainfrisch
Copy link
Copy Markdown
Contributor Author

While the existence of a competent engineer graduating from Polytechnique is certainly worth celebrating, this ticket is not about discussing specific extensions of the stdlib, but about making our policy w.r.t. external contributions clearer and fighting some widespread misconceptions. If you or @c-cube feel like the community could benefit from having parts of Containers included in the stdlib, please make a concrete proposal.

Btw, another misconception is apparent in your note: while INRIA remains the owner of the project and the employer of its two leaders or other core developers, most people with commit rights are not affiliated to INRIA, and many recent contributions even came from people external to that group.

@c-cube
Copy link
Copy Markdown
Contributor

c-cube commented Jun 17, 2016

@alainfrisch when this is merged, I will indeed make a few proposals in new tickets :-)

@Fourchaux
Copy link
Copy Markdown
Contributor

No misconception at all I think. I know that a great majority of the 73 contributors is external to INRIA.
And look, I'm n°56 on this list and it took 5 months and 2 PR before the correction of simple typos was accepted. Grrrr... it's not so easy to enter in the OCaml Hall of Fame :)
My note was only about 'the lack of people and resources at INRIA' (a very common answer given for example by gasche,Yaron Minsky,Fabrice Le Fessant ...).
But anyway, thousands of proposals of c-cube and others are coming, some will be accepted (yes ?) and OCaml will finally rule the world.
P.S. coming from a ENS guy, your remark about Polytechnique seems a big troll :D

@dbuenzli
Copy link
Copy Markdown
Contributor

What worries me with that announcement is that we are going to get one or two functions added here and there with every major version of OCaml which:

  1. As a developer (especially of packages) is a huge pain to deal with (see e.g. re.1.6.1 - via opam-publish opam-repository#6801 (comment))
  2. Will fail to have a coherent vision for the design of the stdlib. There's no actual design going it's ad-hoc functions shoved in the library without much thinking over the larger design of the library or how these functions can interact together to provide a meaningful toolset.

#626 is a good example of this.

@alainfrisch
Copy link
Copy Markdown
Contributor Author

@dbuenzli What are you suggesting? The complete status quo of the stdlib, and then a year-long process to design the "Next Stdlib" (with no guarantee that it produces something better than current alternatives)? Can you explain which of the recent additions to the stdlib are "bad" for you?

@dbuenzli
Copy link
Copy Markdown
Contributor

dbuenzli commented Jun 20, 2016

@dbuenzli What are you suggesting? The complete status quo of the stdlib, and then a year-long process to design the "Next Stdlib" (with no guarantee that it produces something better than current alternatives)?

No. I'm suggesting that someone who tries to add a function to the String module does a complete thought and redesign of it (in the limits of the backward compatibility requirements) rather than just add the function he's looking for and finds missing at the moment.

The current suggested process is not the way to design coherent systems and is very annoying to the end user of the system.

@c-cube
Copy link
Copy Markdown
Contributor

c-cube commented Jun 20, 2016

@dbuenzli It cannot be a "complete thought and redesign" if retrocompatibility matters, though. I dislike the small, incremental additions too, but any significant modification of the stdlib should still be a conservative extension (or it will break user programs).

What I'd like to see a committee that would build on the interfaces from alternatives to the stdlib (core, batteries, containers, etc.) and agree on a common set of functionalities to add (as consistently as possible) to the current stdlib.

For instance, we could agree that every module (if it makes sense) should provide:

type t (* maybe polymorphic *)
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val print : Format.formatter -> t -> unit

for data structures, stuff like

val to_iterator : 'a t -> 'a iterator
val of_iterator: 'a iterator -> 'a t

etc. Looking at batteries, there is plenty of very useful functions that could be added in a consistent way. Since batteries has been developed for a while, one can reasonably think that its interfaces for "common" modules (option,list,string,result,etc.) are sufficient for most use-cases.

Of course this takes work, but it's better than having 3 new functions per release.

edit: I would totally participate in such a committee, and am willing to contribute code from containers.

@dbuenzli
Copy link
Copy Markdown
Contributor

@dbuenzli It cannot be a "complete thought and redesign" if retrocompatibility matters, though.

Please pay attention to my words, I said "in the limits of backward compatibility requirements".

Since batteries has been developed for a while, one can reasonably think that its interfaces for "common" modules (option,list,string,result,etc.) are sufficient for most use-cases.

I'm not interested in sufficient, I'm interested in well designed. Sufficient allows to write crap programs, I want to write good programs. When I designed astring last year I had a look at batteries' String module and I didn't find it well designed at all. In general I don't think that organic and comittee driven design works.

@c-cube
Copy link
Copy Markdown
Contributor

c-cube commented Jun 20, 2016

Then we should wait for you to re-design perfectly every piece of the standard library, because you know better than any hypothetical committee? That's nice.

I would find it awesome if we had a perfectly designed standard library with what you need to write good programs. However, many existing programs rely on the stdlib and we must not break them, so that rules out re-designing anything existing (you seem to imply those programs are "crap", btw, which is not constructive at all; my code relies on the stdlib). If you think you can do a good design on top of what exists, I'm all ears. In the mean time, I hope there will be a discussion on a "sufficient" extension of the stdlib, and I agree that it needs some vision and not just a collection of random additions.

@dbuenzli
Copy link
Copy Markdown
Contributor

Then we should wait for you to re-design perfectly every piece of the standard library, because you know better than any hypothetical committee? That's nice.

Where did I say that this had to be me ? Please reread what I said here and stop wasting my time.

@damiendoligez damiendoligez merged commit 6901555 into ocaml:trunk Jun 20, 2016
camlspotter pushed a commit to camlspotter/ocaml that referenced this pull request Oct 17, 2017
Some words about contributing to the stdlib
stedolan pushed a commit to stedolan/ocaml that referenced this pull request May 24, 2022
stedolan pushed a commit to stedolan/ocaml that referenced this pull request May 24, 2022
fe8a98b flambda-backend: Save Mach as Cfg after Selection (ocaml#624)
2b205d8 flambda-backend: Clean up algorithms (ocaml#611)
524f0b4 flambda-backend: Initial refactoring of To_cmm (ocaml#619)
0bf75de flambda-backend: Refactor and correct the "is pure" and "can raise" (port upstream PR#10354 and PR#10387) (ocaml#555)
d234bfd flambda-backend: Cpp mangling is now a configuration option (ocaml#614)
20fc614 flambda-backend: Check that stack frames are not too large (ocaml#10085) (ocaml#561)
5fc2e95 flambda-backend: Allow CSE of immutable loads across stores (port upstream PR#9562) (ocaml#562)
2a650de flambda-backend: Backport commit fc95347 from trunk (ocaml#584)
31651b8 flambda-backend: Improved ARM64 code generation (port upstream PR#9937) (ocaml#556)
f0b6d68 flambda-backend: Simplify processing and remove dead code (error paths) in asmlink (port upstream PR#9943) (ocaml#557)
90c6746 flambda-backend: Improve code-generation for inlined comparisons (port upstream PR#10228) (ocaml#563)

git-subtree-dir: ocaml
git-subtree-split: fe8a98b
lpw25 pushed a commit to lpw25/ocaml that referenced this pull request Jun 21, 2022
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.

7 participants