Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blog Post: Announcing Dotty 0.6.0 and 0.7.0-RC1 #4053

Merged
merged 23 commits into from
Mar 6, 2018

Conversation

allanrenucci
Copy link
Contributor

@lampepfl/dotty-core Feel free to edit

You can visit our website for more information about [enumerations](/docs/reference/enums/enums.html)
and how we can use them to model [Algebraic Data Types](/docs/reference/enums/adts.html).

### Unused Parameters [#3342](https://github.com/lampepfl/dotty/pull/3342)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nicolasstucki Do you want to do this?

Copy link
Contributor

Choose a reason for hiding this comment

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

@nicolasstucki Probably we should say a couple words about going from phantom types to unused parameters (#2040 (comment)), probably in the release notes rather than in the docs for the latest release (to avoid confusing new users). Starting point:

TL;DR: With unused parameters you can mark values of arbitrary types to be erased at runtime, instead of having to implement separate phantom types.

@smarter
Copy link
Member

smarter commented Mar 1, 2018

This needs a section on improved GADT support and a section on improved completions in the IDE. I'm not available to write this myself thid week unfortunately.

```

You can visit our website for more information about [enumerations](/docs/reference/enums/enums.html)
and how we can use them to model [Algebraic Data Types](/docs/reference/enums/adts.html).
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these links up-date?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These links will become valid once the page is generated. An alternative would be to write absolute links (e.g. http://dotty.epfl.ch/docs/reference/enums/enums.html) so that they are also valid links in GitHub

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry: I was asking if the docs in the target pages have been updated (and I thought not).

You can visit our website for more information about [enumerations](/docs/reference/enums/enums.html)
and how we can use them to model [Algebraic Data Types](/docs/reference/enums/adts.html).

### Unused Parameters [#3342](https://github.com/lampepfl/dotty/pull/3342)
Copy link
Contributor

Choose a reason for hiding this comment

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

@nicolasstucki Probably we should say a couple words about going from phantom types to unused parameters (#2040 (comment)), probably in the release notes rather than in the docs for the latest release (to avoid confusing new users). Starting point:

TL;DR: With unused parameters you can mark values of arbitrary types to be erased at runtime, instead of having to implement separate phantom types.

@allanrenucci
Copy link
Contributor Author

This needs a section on improved GADT support and a section on improved completions in the IDE.

For reference, the PR which improved IDE completions is #3960.

@smarter What improvements do you have in mind regarding GADT support? #3990?

@Blaisorblade
Copy link
Contributor

@allanrenucci PRs on GADTs include #3918, #4034 (finding more...)

@smarter
Copy link
Member

smarter commented Mar 1, 2018

What improvements do you have in mind regarding GADT support? #3990

Soundness was improved by #3918, although there are still holes related to variance until #4013 is merged. @liufengyun also did work related to gadt exhaustiveness checking

@Blaisorblade
Copy link
Contributor

Blaisorblade commented Mar 1, 2018

So #3645 was in fact fixed in December (so for last release), though it fits well under "ongoing GADT improvements". IIUC, even without #4013, invariant GADTs appear fixed, and with #4013 variant GADTs will be fixed as well.
EDIT: it was merged after 0.6.0-RC1.


## What’s new in the 0.7.0-RC1 technology preview?

### Enums Simplicification [#4003](https://github.com/lampepfl/dotty/pull/4003)
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: Simplification

[#3645](https://github.com/lampepfl/dotty/issues/3645),
and improved handling of matches using repeated type variables
[#4030](https://github.com/lampepfl/dotty/issues/4030).
More test cases appear in [#3999](https://github.com/lampepfl/dotty/pull/3999).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would drop this line.

}
```

Earlier Dotty releases had issues typechecking such interpreters.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would say versions instead of releases.

}
```

Earlier Dotty releases had issues typechecking such interpreters.
Copy link
Member

Choose a reason for hiding this comment

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

I think it's important to note that Scala 2 also has unresolved issues typechecking GADTs, like with the neg example in https://github.com/lampepfl/dotty/pull/3990/files#diff-e7b3b26b928fa129081481ffc513af95

Copy link
Contributor

Choose a reason for hiding this comment

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

Added a bit; I think Dotty's already much better than Scalac, but I haven't tried enough personally to make strong claims this in release notes. Feel free to add stronger claims you feel comfortable with.

@@ -162,7 +162,7 @@ object Interpreter {
}
```

Earlier Dotty releases had issues typechecking such interpreters.
Earlier Scalac and Dotty releases had issues typechecking such interpreters.
Copy link
Member

Choose a reason for hiding this comment

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

This makes it sound like recent releases of scalac have fixed this, but they haven't. Also I would use the term "Scala 2" and not "Scalac".

Copy link
Member

Choose a reason for hiding this comment

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

The most convincing thing to do would be to give an example that doesn't typecheck in Dotty but does in Scala 2.

Copy link
Contributor

@Blaisorblade Blaisorblade Mar 6, 2018

Choose a reason for hiding this comment

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

This program works in Scalac, while trickier ones trigger bugs in Scalac or Dotty. I propose to write "Scala 2 and Dotty have issues [...]", since we fixed some.

case class MapS[S, T](xs: Exp[List[S]], f: Exp[S => T]) extends Exp[List[T]]
case class Map[S, T, That](xs: Exp[List[S]], f: Exp[S => T])(implicit val cbf: CanBuildFrom[List[S], T, That]) extends Exp[That]

//...

    case m @ Map(xs, f)    =>
      //val f1: Exp[Any => Any] = f //accepted by Scalac, rejected by Dotty!
      eval(xs).map(eval(f))(m.cbf)

    case MapS(xs, f) =>
      eval(xs) map eval(f) //rejected by Dotty, not 100% sure why. Passing the 

   //alternatively:
    case m: MapS[s, t] =>
      //(eval(m.xs) map eval(m.f))(List.canBuildFrom) //fails in Dotty
      (eval(m.xs) map eval(m.f))(List.canBuildFrom[t]) //succeeds in Dotty

Failures in #4069 might be relevant.

EDIT: full example in #4076.

Earlier Scalac and Dotty releases had issues typechecking such interpreters.
We fixed multiple bugs about GADT type checking and exhaustiveness checking, including
Scala 2 and Dotty have issues typechecking such interpreters.
In this release we fixed multiple bugs about GADT type checking and exhaustiveness checking, including
Copy link
Contributor

@Blaisorblade Blaisorblade Mar 6, 2018

Choose a reason for hiding this comment

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

@smarter @allanrenucci WDYT? A bit less bold, which seems appropriate.

@smarter
Copy link
Member

smarter commented Mar 6, 2018

I've written an alternative version of the GADT section, I'll let others decide which one is better.

@allanrenucci allanrenucci merged commit 27f6673 into scala:master Mar 6, 2018
@allanrenucci allanrenucci deleted the 0.7.0-blogpost branch March 6, 2018 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants