Skip to content

Native applied types #3033

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

Closed
wants to merge 105 commits into from
Closed

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Aug 29, 2017

This is ready for review now.

Copy link
Member

@dottybot dottybot left a comment

Choose a reason for hiding this comment

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

Hello, and thank you for opening this PR! 🎉

All contributors have signed the CLA, thank you! ❤️

Commit Messages

We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).

Please stick to these guidelines for commit messages:

  1. Separate subject from body with a blank line
  2. When fixing an issue, start your commit message with Fix #<ISSUE-NBR>:
  3. Limit the subject line to 72 characters
  4. Capitalize the subject line
  5. Do not end the subject line with a period
  6. Use the imperative mood in the subject line ("Added" instead of "Add")
  7. Wrap the body at 80 characters
  8. Use the body to explain what and why vs. how

adapted from https://chris.beams.io/posts/git-commit

Have an awesome day! ☀️

@smarter
Copy link
Member

smarter commented Aug 29, 2017

Github seems to be having some issues with this PR and it's preventing the CI from checking it out. Could you try pushing to it again? If that doesn't work we may have to close this PR and open a new one.

@smarter
Copy link
Member

smarter commented Aug 29, 2017

Ah, I think that what's going on is that our CI is configured to use the github branch corresponding to this PR merged on top of master. Since merging currently fails with conflicts, this branch doesn't exist. So I'm afraid you cannot test this on the CI until you rebase.

@odersky odersky force-pushed the try-applied-type branch 2 times, most recently from d2b91c1 to f001e4c Compare August 31, 2017 11:18
@allanrenucci
Copy link
Contributor

@odersky The last CI failure is not legitimate. Github picked the wrong CI (I am testing a new CI instance with a newer version of Drone). If you push a new commit, it should pick up the right CI.

@@ -21,6 +21,7 @@ import dotc.printing.{ GlobalPrec, DotPrec, Printer, PlainPrinter }
import dotc.typer.Implicits.SearchResult
import dotc.typer.ImportInfo

// TODO: Avoid code duplication between userfacing and refined printers
Copy link
Member

Choose a reason for hiding this comment

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

Most of the duplication is gone in #3032 so you should be able to drop this commit when rebasing.

@smarter
Copy link
Member

smarter commented Aug 31, 2017

The dotty-bin-tests CI failure should go away if you rebase (things changed in .drone.yml)

@odersky odersky force-pushed the try-applied-type branch 8 times, most recently from 1aa8181 to 6324124 Compare September 2, 2017 09:52
@smarter
Copy link
Member

smarter commented Sep 2, 2017

The exhaustiveness checker is outputting lots of false warnings right now:

object Test {
  def test(i: Option[Int]) = i match {
    case Some(a) =>
    case None =>
  }
}
-- [E028] Pattern Match Exhaustivity Warning: try/pm.scala:2:29 ----------------
2 |  def test(i: Option[Int]) = i match {
  |                             ^
  |                             match may not be exhaustive.
  |                             
  |                             It would fail on: Some[Int](_)

AppliedType will be used for all type applications, higher-kinded
or not. That is, eventually, it will replace HKApply and also the
encodings of type applications as refined types.

This commit introduces AppliedType and adapts baseType computations
to take it into account. AppliedType is not yet constructed anywhere,
however.
So far, everything up to parents is adapted to new scheme. Parents is half done;
needs more work once we change layour of ClassInfo.
Simplifies usage and removes some obscure code in Types
Systematically introduce handlers for AppliedTypes where there
was a handler for HKApply.
Also, change asSeenFrom to use it for arguments
Avoid printing addresses and reduce junk.
We had a stackoverfloa in asSeenFrom even under the old scheme, since
there was a bad change involving checkRealizableBounds.
@liufengyun
Copy link
Contributor

That's very surprising since these points do not look any different from the non-bootstrapped points. I would expect some difference in one direction or another. Are we completely sure the new points are bootstrapped? :)

It's definitely the bootstrapped version.

It probably means that the generated code from Dotty is comparable to Scalac 2.12, or the optimisations in Dotty is insignificant compared to that of JVM.

@smarter
Copy link
Member

smarter commented Sep 5, 2017

test performance please d92e3e6 fb82b09 fc83c24 3034f59 1e6572d 7204538 393d91f 9af7324 922b379 a7ec349

@dottybot
Copy link
Member

dottybot commented Sep 5, 2017

performance test scheduled: 1 job(s) in queue.

@smarter
Copy link
Member

smarter commented Sep 5, 2017

@liufengyun Oops, I guess liufengyun/bench#47 is not active yet ^ ?

@liufengyun
Copy link
Contributor

liufengyun commented Sep 5, 2017

@smarter : a colon is required after please. I just removed the job from the queue. You can try issue the command again.

@smarter
Copy link
Member

smarter commented Sep 5, 2017

test performance please: d92e3e6 fb82b09 fc83c24 3034f59 1e6572d 7204538 393d91f 9af7324 922b379 a7ec349

@smarter
Copy link
Member

smarter commented Sep 5, 2017

@liufengyun Hmm I think there's a bug in your script that I didn't catch while reviewing it: 0 is allowed in git hashes, but the bot replaced 3034f59 by 334f59 😄

@liufengyun
Copy link
Contributor

@smarter : Thanks, I just noticed, fixed, deployed and removed the job.

@smarter
Copy link
Member

smarter commented Sep 5, 2017

test performance please: d92e3e6 fb82b09 fc83c24 3034f59 1e6572d 7204538 393d91f 9af7324 922b379 a7ec349

@scala scala deleted a comment from dottybot Sep 5, 2017
@dottybot
Copy link
Member

dottybot commented Sep 5, 2017

performance test scheduled for d92e3e6,fb82b9,fc83c24,334f59,1e6572d,724538,393d91f,9af7324,922b379,a7ec349: 1 job(s) in queue.

@smarter
Copy link
Member

smarter commented Sep 5, 2017

Hmm, 0 is still missing in the hashes.

@liufengyun
Copy link
Contributor

The polling service just restarted.

@smarter
Copy link
Member

smarter commented Sep 5, 2017

test performance please: d92e3e6 fb82b09 fc83c24 3034f59 1e6572d 7204538 393d91f 9af7324 922b379 a7ec349

@dottybot
Copy link
Member

dottybot commented Sep 5, 2017

performance test scheduled for d92e3e6 fb82b09 fc83c24 3034f59 1e6572d 7204538 393d91f 9af7324 922b379 a7ec349: 1 job(s) in queue.

@liufengyun
Copy link
Contributor

liufengyun commented Sep 5, 2017

The daily benchmark is running from 12:00pm. Depending on how many PRs we merged today, each PR or commit will take ~40min. If everything goes well, we should be able to get the result in the morning.

@dottybot
Copy link
Member

dottybot commented Sep 6, 2017

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/3033 to see the changes.

Benchmarks is based on merge(s) with master

@smarter
Copy link
Member

smarter commented Sep 6, 2017

@liufengyun The results don't seem to contain the commits scheduled for benchmarking.

@liufengyun
Copy link
Contributor

@smarter I'm investigating the problem, will keep you updated once it works.

@liufengyun
Copy link
Contributor

test performance please: d92e3e6 fb82b09 fc83c24 3034f59 1e6572d 7204538 393d91f 9af7324 922b379 a7ec349

@dottybot
Copy link
Member

dottybot commented Sep 6, 2017

performance test scheduled for d92e3e6 fb82b09 fc83c24 3034f59 1e6572d 7204538 393d91f 9af7324 922b379 a7ec349: 1 job(s) in queue.

@liufengyun
Copy link
Contributor

test performance please: d92e3e6 fb82b09 fc83c24

@dottybot
Copy link
Member

dottybot commented Sep 6, 2017

performance test scheduled for d92e3e6 fb82b09 fc83c24: 1 job(s) in queue.

@dottybot
Copy link
Member

dottybot commented Sep 6, 2017

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/3033 to see the changes.

Benchmarks is based on merge(s) with master

@smarter
Copy link
Member

smarter commented Sep 6, 2017

Looks like fb82b09 was bad for performance, and fc83c24 made things better but still worse than before.

@liufengyun It would be nice if clicking on a point on the graph jumped to the commit diff on github instead of the corresponding PR, sorry for making another feature request :).

@liufengyun
Copy link
Contributor

@smarter I'm happy to improve the bench infrastructure. Let's talk more about the feature tomorrow, it seems in some cases jump to PR is more friendly.

@odersky odersky mentioned this pull request Sep 30, 2017
@odersky
Copy link
Contributor Author

odersky commented Oct 8, 2017

We already integrated the optimizations that are easily applicable, and the rest is complicated and does not seem to buy us much.

@odersky odersky closed this Oct 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants