Some words about contributing to the stdlib#619
Conversation
CONTRIBUTING.md
Outdated
|
|
||
| ## Contributing to the standard library | ||
|
|
||
| Contributions to the standard library are much welcome. There is some |
There was a problem hiding this comment.
I would use "very" or "quite" in place of "much".
|
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 |
78d7a76 to
18bc91a
Compare
|
Typos fixed. Thanks for spotting them! |
This is what I meant by "filling obvious gaps".
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. |
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. |
|
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.). |
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. |
Again, this makes sense. Having this text to point interested contributors to is already a big step. |
|
May I suggest to take inspiration from work done by F# , especially this one : Note: |
|
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. |
|
@alainfrisch when this is merged, I will indeed make a few proposals in new tickets :-) |
|
No misconception at all I think. I know that a great majority of the 73 contributors is external to INRIA. |
|
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:
#626 is a good example of this. |
|
@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? |
No. I'm suggesting that someone who tries to add a function to the The current suggested process is not the way to design coherent systems and is very annoying to the end user of the system. |
|
@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 -> unitfor data structures, stuff like val to_iterator : 'a t -> 'a iterator
val of_iterator: 'a iterator -> 'a tetc. 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. |
Please pay attention to my words, I said "in the limits of backward compatibility requirements".
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 |
|
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. |
Where did I say that this had to be me ? Please reread what I said here and stop wasting my time. |
Some words about contributing to the stdlib
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
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.