Extending the HSL: the role/future of hsl-experimental, vendor extensions, etc #177
Replies: 7 comments 11 replies
-
My proposal for scenario 1 - Vendor-specific extensions/sub-libraries/sub-namespacesThese should not be in hsl-experimental.
In practical terms, we are unlikely to enforce this, but we will not consider adding new sub-namespaces in Existing vendor lib maintainers should consider this, but are not required to move. |
Beta Was this translation helpful? Give feedback.
-
My proposal for scenario 2 - existing libraries we are considering merging
|
Beta Was this translation helpful? Give feedback.
-
My proposal for scenario 3 - additional functionsThis should be evaluated on a case-by-case basis; for example, Otherwise, they should be in this library, but in appropriate subnamespaces like (2) - for example, a new |
Beta Was this translation helpful? Give feedback.
-
My proposal for scenario 4 - new methods for existing classesSimilarly case-by-case. If we're not confident, they will still need adding directly to the original class. It would probably be best to establish a naming convention. |
Beta Was this translation helpful? Give feedback.
-
My proposal for scenario 5 - new, from-scratch librariesIn general, I do not believe these should be in hsl-experimental: my preferred flow for adding to the HSL is to develop as a standalone library as much as possible, to
If there is a clear 'best winner', that would be a candidate for merging; if there are multiple libraries, perhaps making one solution the 'standard' one is not the best approach ExceptionsIf a new feature is heavily coupled to runtime or typechecker implementation changes or features, this is an appropriate repository - however, steps should be taken to minimize the disadvantages, such as:
These should be added to |
Beta Was this translation helpful? Give feedback.
-
My proposal: everything should be removed from hsl-experimental (eventually)
The simple question is how much notice to give when we decide a sub-library should be removed; a bit of a strawman, but I'd like to go for 6 weeks: it matches the main HHVM release cycle, and this is an experimental library - the LTS cycle doesn't feel appropriate. The more involved question is what to put in the HSL, and what to drop. What belongs in the HSL?Historically, this has been based on need, usage, and "is this the way we want things to be done in Hack?". By this metric, HSL IO should be added, and I think we should weaken the last constraint: we should allow intermediate steps to be merged into the HSL, if:
By this definition, we should merge the entirety of HSL-experimental into the HSL, including
|
Beta Was this translation helpful? Give feedback.
-
For purely practical reasons, I'd like to keep as many of these as possible in a single repository (e.g. there's a lot of overhead in managing multiple repositories; it's likely that things will move between these categories in the future which should be much simpler in a shared repository...). It doesn't have to be called hsl-experimental (one suggestion was "flib" which roughly stands for "Facebook libraries" and matches some internal usage), your suggestions for the different categories and namespaces seem reasonable. |
Beta Was this translation helpful? Give feedback.
-
The HSL will shortly be built-in to HHVM and the typechecker; this requires defining what actual is (and isn't) part of "the HSL". I am intending for this to be:
HH\Lib\
namespace is reserved for the HSLWe're also having increasingly frequent discussions about how to extend the HSL; there are a few common kinds of proposed extensions:
hsl-experimental has historically been used for (2)
My proposal
Overall:
Situations 1-5
Posted as standalone comments below to ease replies.
Everything should be removed from hsl-experimental (eventually)
Another standalone comment :)
Why distinct namespaces again?
Previously, everything in
hsl-experimental
was in theHH\Lib\Experimental
namespace; this meant that whenever something was moved fromhsl-experimental
to the HSL, all callers would be broken.With the HSL becoming built in, this reverses: using the same namespace for the HSL and experimental becomes more problematic: it will pin any version of hsl-experimental much more tightly to a specific HHVM version.
Using a different namespace avoids this problem by effectively allowing duplicate definitions, just in different namespaces.
Beta Was this translation helpful? Give feedback.
All reactions