-
Notifications
You must be signed in to change notification settings - Fork 19
Write down source compatibility guidelines between Scala dialects #14
Comments
Here's the first guideline, from the blog post:
|
Proposed generic informal goals:
The first and second items should be easily testable just using projects in the Scala community (similar to what Typesafe does with its compatibility tests). The third item is somewhat harder and may require specific tests, but probably eased through the same sort of mass continuous integration. |
It's possible that (1) is slightly too conservative. For example, consider the following valid Scala program: \u006f\u0062\u006a\u0065\u0063\u0074\u0020\u004d\u0061\u0069\u006e\u0020\u007b
\u0020\u0020\u0064\u0065\u0066\u0020\u006d\u0061\u0069\u006e\u0028\u0061\u0072\u0067\u0073\u003a\u0020\u0041\u0072\u0072\u0061\u0079\u005b\u0053\u0074\u0072\u0069\u006e\u0067\u005d\u0029\u0020\u007b
\u0020\u0020\u0020\u0020\u0070\u0072\u0069\u006e\u0074\u006c\u006e\u0028\u0022\u0068\u0065\u006c\u006c\u006f\u0020\u0077\u006f\u0072\u006c\u0064\u0022\u0029
\u0020\u0020\u007d
\u007d My proposed change to unicode escaping (#7) would make this currently valid Scala program fail to compile. |
@djspiewak @non well, now I'm conflicted. |
@non For this reason, your Unicode stuff should be behind a flag. That is |
Sure, possibly |
@non is it actually easy to preserve both behaviours? |
Yes. In fact, my original patch does preserve both behaviors since we need to keep using it when parsing Java sources. If you look at the commit (sorry don't have a link) you'll see that I add a flag about whether to do pre-parse escaping or not. |
(Of course, the patch would have to be updated to ensure that we don't "double parse" |
So, we can still do anything sensible violating those guidelines, as long as it's behind a flag? I'd be happy with that, as long as we get -Zdefault and -Zall. BTW, calling -Zdefault -Ztypelevel would be risky, because we might well end up with some feature for type-level computation some day.
Generally speaking, we'll have to weight the maintenance overhead. Especially since we're keeping merge compatibility, so we can't go and simplify other stuff. |
Right. Features that follow the "spirit" of these rules (expected to work widely with realistic Scala sources but break on edge cases or dysfunctional code) might be grouped into a (Came up with the name on #typelevel but I'm sort of enamored with it now.) |
One thing to add though is that as @milessabin said the fork is intended to be conservative. The goal is not to add a ton of flags to create a totally different language. But rather, to use flags in cases where we can't quite meet our compatibility requirements but want to accept a benign change that meets the spirit of them. |
Indeed, It would be kind of ironic if compiling scalaz/shapeless/spire with the fork would require a complex combination of flags. |
One other thing to note, in the rules above, rule (2) should probably be amended to rule out reflection. Otherwise, it will be impossible to even add annotations to the stdlib (since that would change the behavior of valid code that gets all the annotations for a class). This is relevant due to #17. |
Since that's about adding something to a library, this reminds me: What about forward compatibility guarantees between Typelevel Scala minor releases? What's the binary version of Typelevel Scala releases? |
Add support for Java 8 in filtered check feature.
@aloiscochard actually, I wouldn't be at all surprised if shapeless or Scalaz were the first to break ... but that should be fine if we're prepared to branch those projects to support tlc (we are, that's kinda the point). |
The discussion moved to https://github.com/typelevel/scala/wiki/Typelevel-Scala-Compatibility-Guide & https://groups.google.com/d/msg/typelevel/bCJhQvIhqG4/6y4nf5kFpJMJ. |
I've started documenting our features on the wiki: https://github.com/typelevel/scala/wiki/Differences |
I also added a page called "Roadmap". It basically says we don't have one https://github.com/typelevel/scala/wiki/Roadmap That said, it would be good to open the discussion on what we should expect Jon On 6 October 2014 16:29, Brian McKenna [email protected] wrote:
Jon Pretty | @propensive |
Again and again, we want to merge pull requests which change the Scala source language.
We should evolve precise guidelines for how to handle them and where to draw the line.
I think changing the source language is the point of the exercise, but of course we need good changes.
Guidelines to decide what's in and what's out are hard, that's why I say "evolve"; but already now we should have some guidelines on how to do the breaking changes we want.
The text was updated successfully, but these errors were encountered: