|
| 1 | +--- |
| 2 | +layout: sips |
| 3 | +title: SIP Meeting Minutes - 8th March 2018 |
| 4 | + |
| 5 | +partof: minutes |
| 6 | +--- |
| 7 | + |
| 8 | +# Minutes |
| 9 | + |
| 10 | +The following agenda was distributed to attendees: |
| 11 | + |
| 12 | +|Topic|Reviewers| Accepted/Rejected | |
| 13 | +| --- | --- | --- | |
| 14 | +|[SIP-35: Opaque types: updates on the proposal](http://docs.scala-lang.org/sips/opaque-types.html) | Sébastien Doeraene | N/A |
| 15 | +|[SIP-NN: Byname implicit arguments](http://docs.scala-lang.org/sips/byname-implicits.html) | Martin Odersky | N/A |
| 16 | +|Discussions about the future of Scala 2.13 and 2.14 | | | |
| 17 | + |
| 18 | + |
| 19 | +Jorge Vicente Cantero was the Process Lead and Darja Jovanovic as secretary. |
| 20 | + |
| 21 | +## Date and Location |
| 22 | +The meeting took place on the 8th March 2018 at 5 PM CEST via Google Hangouts at EPFL in Lausanne, Switzerland. |
| 23 | + |
| 24 | +[Watch on Scala Center YouTube channel](https://youtu.be/dFEkS71rbW8) |
| 25 | + |
| 26 | +Minutes were taken by Jamie Thompson. |
| 27 | + |
| 28 | +## Attendees |
| 29 | +* Martin Odersky ([@odersky](https://github.com/odersky)), EPFL |
| 30 | +* Jorge Vicente Cantero ([@jvican](https://github.com/jvican)), Scala Center |
| 31 | +* Sébastien Doeraene ([@sjrd](https://github.com/sjrd)), EPFL |
| 32 | +* Adriaan Moors ([@adriaanm](https://github.com/adriaanm)), Lightbend |
| 33 | +* Darja Jovanovic ([@darjutak](https://github.com/darjutak)), Scala Center |
| 34 | + |
| 35 | +## Joined Online |
| 36 | +* Eugene Burmako ([@xeno-by](https://github.com/xeno-by)), Twitter |
| 37 | +* Iulian Dragos ([@dragos](https://github.com/dragos)), Triplequote |
| 38 | +* Miles Sabin ([@milessabin](https://github.com/milessabin)], Independent |
| 39 | +* Seth Tisue ([@SethTisue](https://github.com/SethTisue)), Lightbend |
| 40 | + |
| 41 | +## Guest |
| 42 | +* Erik Osheim, SIP-35 author. |
| 43 | + |
| 44 | +## Not present |
| 45 | +* Heather Miller ([@heathermiller](https://github.com/heathermiller)), CMU |
| 46 | + |
| 47 | +## Proceedings |
| 48 | + |
| 49 | +### Opening Remarks |
| 50 | + |
| 51 | +[YouTube time 0'00'' - 1'20''](https://youtu.be/dFEkS71rbW8): **Jorge** introduces the meeting by outlining the three |
| 52 | +items on the agenda, the first two being SIP proposals and the third being an overview of potential features for Scala |
| 53 | +2.13 which may lead to more concrete proposals. |
| 54 | +Beginning with point three, **Jorge** explains that three ideas are scheduled for discussion at the meeting, |
| 55 | +and invites **Adriaan** to open with the first of them. |
| 56 | + |
| 57 | +### Discussion about the future of Scala 2.13 and 2.14 |
| 58 | +[YouTube time 1'23'' - 23'31''](https://youtu.be/dFEkS71rbW8?t=83) |
| 59 | + |
| 60 | +#### [Proposal to Drop Package Objects with Inheritance](https://github.com/scala/scala-dev/issues/441) |
| 61 | + |
| 62 | +This was an open discussion. |
| 63 | + |
| 64 | +**Adriaan** introduces the idea that package objects should no longer support |
| 65 | +inheritance, and possibly be replaced altogether with top level definitions. |
| 66 | + |
| 67 | +#### Questions about Package Objects |
| 68 | + |
| 69 | +1) **Miles** asks for clarification on what is problematic with the current implementation of package objects and if it |
| 70 | + is worth the cost of creating a new feature to replace them. |
| 71 | + |
| 72 | + **Adriaan** responds: |
| 73 | + - Inheritance from a parent in the same package creates problems. |
| 74 | + - package objects already carry a lot of constraints compared to ordinary objects. |
| 75 | + - They are worth changing to simplify the implementation. |
| 76 | + - Simple migration for package object with extends clauses: change to a regular object and import its definitions. |
| 77 | + |
| 78 | +2) **Miles** asks if replacing package objects with top level definitions puts an end to the |
| 79 | + long standing goal of replacing packages by objects. |
| 80 | + |
| 81 | + **Adriaan** agrees that is what he is suggesting, motivated by the many issues that |
| 82 | + have been discovered with the current implementation in the context of incremental compilation, IDE's and more. |
| 83 | + |
| 84 | + **Iulian** adds to **Adriaan's** comment: he believes the implementation is too complicated and not correct, with |
| 85 | + many workarounds leading to brittle compilation, such as cyclic references between a package object and its parents |
| 86 | + if one is the same package. |
| 87 | + |
| 88 | + **Martin** in response to **Iulian** suggests that the issues experienced with package objects are only due to the |
| 89 | + implementation, suggesting that in Dotty, he does not recall many special cases. He suggests that package objects |
| 90 | + should behave like ordinary objects and reject parents in the same package. |
| 91 | + |
| 92 | +3) **Iulian** asks what is the extra benefit of a package object over wrappers for top level definitions. |
| 93 | + |
| 94 | + **Miles** highlights that they are first class values. |
| 95 | + |
| 96 | + **Erik** shares examples of uses at his workplace for package objects: access to members without |
| 97 | + imports, such as implicit definitions, similar to a Prelude. |
| 98 | + |
| 99 | + **Sébastien** suggests that a package object may contain another package, which is not possible in an ordinary object |
| 100 | + |
| 101 | +#### In Favour of Top Level Definitions |
| 102 | + |
| 103 | +1) **Adriaan**: in his experience package objects are usually |
| 104 | + aggregates for new definitions, without extends clauses, which **Miles** agrees is his typical usage of them. |
| 105 | + |
| 106 | +2) **Sébastien** believes that the extends clause in typical code is used only to inherit from a class in the same |
| 107 | + package, so concludes that given the known issues with inheritence, it should be dropped in favour of top level |
| 108 | + definitions. |
| 109 | + |
| 110 | + ([YouTube time from 2'35'' - 3'50''](https://youtu.be/dFEkS71rbW8?t=155)) He proposes two solutions for their |
| 111 | + implementation: |
| 112 | + |
| 113 | + 1) The Kotlin way, which is to create a single wrapper object for each file, with a name derived from the file. |
| 114 | + - **Drawback**: a name change to the file breaks binary compatibility. |
| 115 | + 2) Individual wrapper classes for each definition, with a name derived from the definition and any parameters. |
| 116 | + - **Benefit**: no binary compatibility issue as names are fully qualified. |
| 117 | + - **Drawback**: many more class files generated. |
| 118 | + |
| 119 | + **Sébastien** believes that these solutions do not introduce new issues for type checking. |
| 120 | + |
| 121 | +3) **Martin** believes that top level definitions are simpler to understand than package objects and is in favour. |
| 122 | + |
| 123 | +#### Implementation of Top Level Definitions |
| 124 | + |
| 125 | +- **Erik** is concerned with the impact of top level definitions in multiple files on incremental compilation. |
| 126 | +- **Martin** is concerned about how to reason about overloaded and conflicting top level definitions in different files. |
| 127 | + |
| 128 | +**Sébastien** believes that both concerns above are not issues, proceding to outline how it is similar to regular member |
| 129 | +scoping. After some discussion, **Martin** believes that an implementation is possible in Dotty. |
| 130 | + |
| 131 | +#### Skepticism Around Top Level Definitions |
| 132 | + |
| 133 | +1) **Seth** would like to keep package objects, but improve safety by adding some restrictions |
| 134 | + |
| 135 | + He suggests that investigating code and communicating with users will likely have the least disruptive change, |
| 136 | + favouring the most popular use-cases. |
| 137 | + |
| 138 | +2) **Eugene** asks if the behaviour of package objects could be documented, as |
| 139 | + currently there is no formal specification except for the implementation. |
| 140 | + He is concerned that changes could being made without considering the wider industry, as they will have large code |
| 141 | + bases that will need to migrate package objects if they break. |
| 142 | + |
| 143 | + **Sébastien** answers by suggesting that package objects with no parents can be automatically rewritten to top level |
| 144 | + definitions, however, further thought would be required to deal with package objects that have extends clauses. |
| 145 | + |
| 146 | +>#### YouTube Comment |
| 147 | +>[YouTube time from 17'06'' to 18'02''](https://youtu.be/dFEkS71rbW8?t=1026) |
| 148 | +> |
| 149 | +>**Sébastien** addresses a comment on the stream about which kinds of definitions are safe to be allowed at the top |
| 150 | +>level and there is some discussion. |
| 151 | +> |
| 152 | +>Overall, it is believed that defs can be at the top level, but vals are order |
| 153 | +>dependent so might not be allowed. |
| 154 | +
|
| 155 | +**Jorge** notes that there is no longer enough time to discuss the other two ideas for 2.13. |
| 156 | + |
| 157 | +**Adriaan** finishes by inviting participation in the discussion of the remaining issues in the |
| 158 | +[Scala 2.14 milestone on GitHub](https://github.com/scala/scala-dev/issues?q=is%3Aopen+is%3Aissue+milestone%3A2.14). |
| 159 | + |
| 160 | +#### Conclusion |
| 161 | +The committee members are overall in agreement that package objects are a pain point, and there are mixed opinions as to |
| 162 | +whether they become further restricted for safety, or replaced with top level definitions which raised concerns for |
| 163 | +migration. |
| 164 | + |
| 165 | +### [SIP-35: Opaque types: updates on the proposal](http://docs.scala-lang.org/sips/opaque-types.html) |
| 166 | +[YouTube time from 23'31'' - 43'02''](https://youtu.be/dFEkS71rbW8?t=1411) |
| 167 | + |
| 168 | +**Jorge** introduces the proposal, noting that it had been updated in the morning before the meeting and directs |
| 169 | +**Sébastien**, the reviewer, to begin the discussion on the high level parts of the proposal. |
| 170 | + |
| 171 | +#### Concerns About The Motivation |
| 172 | + |
| 173 | +1) **Sébastien** believes that the current wording of the proposal could lead to wrong expectations, |
| 174 | + mostly in the meaning of "boxing" (i.e. primitive boxing vs an instance of a user defined wrapper class). |
| 175 | + |
| 176 | + **Erik** agrees that further clarification is needed, giving specific examples on when a value is left unboxed, |
| 177 | + concluding that the value of an opaque type will have semantics of the underlying type. |
| 178 | + |
| 179 | +2) **Sébastien** points out that some examples claim to not box, but do in fact, for example in the tagging |
| 180 | + demonstration, the tag method is generic and will box the Double value passed in the code. |
| 181 | + |
| 182 | + **Erik** clarifies that a specialised annotation was intended to be on that method, which would avoid the boxing |
| 183 | + but was cut for readability. |
| 184 | + |
| 185 | + **Sébastien** concludes by stating that examples must agree with any claims made about them. |
| 186 | + |
| 187 | +3) **Sébastien** suggests that most of the examples in the motivation are not not have advantageous runtime performance |
| 188 | + over the existing value class feature. |
| 189 | + |
| 190 | +4) **Miles** suggests that the performance benefits of avoiding boxing is a secondary concern to the semantics that |
| 191 | + opaque type aliases bring to the language and asks which is the primary motivation. |
| 192 | + |
| 193 | + **Erik** answers that both are really key motivations. Originally, the idea was to create a replacement for the |
| 194 | + current value class implementation that was a less leaky abstraction, but as use cases were discovered, |
| 195 | + the motivation grew to include them as the more obvious method for information hiding. On the other hand, |
| 196 | + opaque type aliases are more future proof against changes to the JVM as the feature has no runtime footprint. |
| 197 | + |
| 198 | + **Jorge** agrees that the feature is good for information hiding and believes the feature will enable many more |
| 199 | + library designs that benefit from this style of programming. |
| 200 | + |
| 201 | +5) **Adriaan** suggests that the proposal could clarify the language used to explain boxing by simplification to |
| 202 | + emphasise that values of opaque type aliases share the runtime behaviour of the underlying type. |
| 203 | + |
| 204 | + **Jorge** believes that the point is already made in the document, but wants to make it clear that an extra layer of |
| 205 | + indirection at runtime is avoided for opaque type aliases to subtypes of AnyRef. |
| 206 | + |
| 207 | +**Sébastien** concludes that action should be taken to further emphasise in the proposal the semantics of the feature |
| 208 | +over its performance benefits. |
| 209 | + |
| 210 | +#### In Favour of the Proposal |
| 211 | + |
| 212 | +1) **Sébastien** highlights examples of opaque types in the proposal that are advantageous over value classes: |
| 213 | + - Primitive arrays will be chosen if the underlying type is primitive. |
| 214 | + - Specialised methods will be selected if the underlying type is primitive. |
| 215 | + - In generic contexts, allocations of wrappers are avoided for opaque types aliasing reference types. |
| 216 | + |
| 217 | +2) **Miles** is in favour for the feature because it would be a safer intrinsic replacement for the tagging used in |
| 218 | + Shapeless, as in his opinion it is an accident that the implementation of tagging can work in the current version of |
| 219 | + Scala. |
| 220 | + |
| 221 | + **Erik** agrees that the current solution for tagging is not idiomatic and points out that value classes are not a |
| 222 | + correct replacement either. |
| 223 | + |
| 224 | +#### Concerns With the Proposal |
| 225 | + |
| 226 | +1) **Martin** raises that an issue has been found with the proposals inclusion of recursive opaque type aliases, and is |
| 227 | + skeptical that they can be allowed as they introduce a fundamentally new kind of recursion to the language. |
| 228 | + |
| 229 | + **Jorge** asks for clarification if this is referring to the example for a Fix point type given in the proposal. |
| 230 | + |
| 231 | + **Martin** confirms and suggests an alternative version could be achieved with conversions, but believes that the |
| 232 | + idea implies too many changes to the language than the non-recursive cases. |
| 233 | + |
| 234 | + **Adriaan** asks the authors how importantly they value the recursive example. |
| 235 | + |
| 236 | + **Erik** answers that it he wouldn't mind if that part was dropped. The example was included because the methods |
| 237 | + used in present Scala to get the same result again rely on "compiler tricks". |
| 238 | + He clarifies that it was added under the assumption that if it is possible then it should be documented. |
| 239 | + |
| 240 | + **Jorge** agrees. |
| 241 | + |
| 242 | + **Adriaan** suggests that the recursive example is quite niche and could be postponed until a later time, as the rest |
| 243 | + of the proposal is favoured by the committee. |
| 244 | + |
| 245 | +#### Other Remarks |
| 246 | +> [YouTube time from 38'25'' - 41'54''](https://youtu.be/dFEkS71rbW8?t=2305) |
| 247 | +> |
| 248 | +>**Miles** asks **Martin** why he thinks that the fix type example is an entirely new kind of recursion. |
| 249 | +> |
| 250 | +>**Martin** answers that there is not a clear mapping to the DOT calculus, where recursion over types is through the |
| 251 | +>self type of the current object. On the other hand, the fix example is recursion over a type parameter. |
| 252 | +> |
| 253 | +>**Miles** responds by questioning if this is so different because the fix example syntactically maps directly to an |
| 254 | +>equivalent class-based implementation. |
| 255 | +> |
| 256 | +>**Martin** then offers a solution to fix that does not require recursion: two type aliases representing `Fix[F]` and |
| 257 | +>`F[Fix[F]]` with conversions between the two. He summarises that the problem with the opaque types proposal is that it |
| 258 | +>suggests that |
| 259 | +>these two types are the same type, which is not friendly to a compiler. |
| 260 | +
|
| 261 | +**Jorge** ends the item by clarifying that an implementation is available in Dotty in a pull request where |
| 262 | +discussion is also taking place. |
| 263 | + |
| 264 | +#### Conclusion |
| 265 | + |
| 266 | +Opaque types are a method of hiding the right hand side of a type alias, with the runtime semantics of the underlying |
| 267 | +type. It is discussed as an idiomatic method for tagging, and possibly a fixed point type, with performance benefits |
| 268 | +over value classes. |
| 269 | +The committee members who commented are in favour of the feature, with concerns for the semantics of recursive |
| 270 | +types and the precision of the language used in the proposal. |
| 271 | + |
| 272 | +**Actions:** |
| 273 | + - Emphasise semantics over performance benefits in document. |
| 274 | + - Postpone the inclusion of recursive opaque types. |
| 275 | + |
| 276 | +### [SIP-NN: Byname implicit arguments](http://docs.scala-lang.org/sips/byname-implicits.html) |
| 277 | +[YouTube time from 43'02'' - end](https://youtu.be/dFEkS71rbW8?t=2582) |
| 278 | + |
| 279 | +**Jorge** explains that the committee are waiting for an implementation in Scalac, and are currently acting on the |
| 280 | +proposal alone. At the end of the discussion the comittee will vote on whether or not to number the proposal. He also |
| 281 | +suggests that Martin will review the proposal. |
| 282 | + |
| 283 | +**Miles** introduces Byname implicits as a feature that adds the functionality of the Lazy macro in Shapeless as an |
| 284 | +intrinsic part of the Scala language, with the added motivation that the macro implementation in Scala 2 is very high |
| 285 | +maintenance, with unsafe casts to compiler internal classes. |
| 286 | +He explains that byname implicits are intended to be used to derive recursive implicit parameters, |
| 287 | +for example type class derivation for recursive types such as List. The SIP proposal is simplified when compared to the |
| 288 | +Lazy macro implementation and reuses exisiting byname parameter syntax. |
| 289 | +He explains that it is advantageous over the exisiting macro because it supports detection of implicit divergence. |
| 290 | + |
| 291 | +**Jorge** asks if this feature is desirable because users of Lazy have reported long compilation times with stack |
| 292 | +overflows. |
| 293 | + |
| 294 | +**Miles** answers by proposing that these cases are likely due to undetected implicit divergence, as the Lazy |
| 295 | +macro implementation turns off the implicit divergence checks, which is not an issue in the implementation for this SIP |
| 296 | +proposal. He clarifies that in any case, there is still performance overhead that could be improved for the |
| 297 | +intrinsic implementation, highlighting the high rate of creation of thunks, but proposed that the SIP should not add |
| 298 | +additional overhead to what is already given by using the Lazy macro. |
| 299 | + |
| 300 | +**Jorge** asks for comments from the other committee members. |
| 301 | + |
| 302 | +**Sébastien** offers that he has been convinced by the motivation section of the SIP, despite never personally requiring |
| 303 | +the feature. However he disagrees that the parameters should desugar to lazy vals after implicit |
| 304 | +expansion. Apart from concerns about performance, he suggests that the semantics are also surprising compared to |
| 305 | +ordinary byname parameters. |
| 306 | + |
| 307 | +After unproductive discussions about the correct encoding for the desugaring, **Adriaan** suggests that discussion |
| 308 | +should be taken to the pull request for the SIP. |
| 309 | + |
| 310 | +**Jorge** proceeds to introduce voting on numbering the issue, but notes that at this point **Iulian** has left the |
| 311 | +meeting, so there is no quorum. Therefore, the votes for him and the other members will be collected after the meeting. |
| 312 | + |
| 313 | +Votes of those present in favour of numbering: |
| 314 | +- **Sébastien** |
| 315 | +- **Martin** |
| 316 | +- **Adriaan** |
| 317 | +- **Miles** |
| 318 | +- **Seth** |
| 319 | +- **Eugene** |
| 320 | + |
| 321 | +No votes against from present members. |
| 322 | + |
| 323 | +#### Conclusion |
| 324 | + |
| 325 | +Byname implicits are a feature to construct recursive implicit parameters, replacing a brittle macro implementation but |
| 326 | +with idiomatic syntax and improved behaviour. |
| 327 | +The committee seems in favour of the feature, with some concerns for performance. All members |
| 328 | +present chose to number the proposal, but a quorum was not reached at the time. |
0 commit comments