profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/dwijnand/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Dale Wijnand dwijnand @lightbend London, UK https://twitter.com/dwijnand @scala & @sbt maintainer at @lightbend. Interested in FP, tooling, & API/library design. Ex @rust-lang's Cargo+Rustup, & @playframework + @lagom maintainer.

dotty-staging/dotty 77

Research platform for new language concepts and compiler technologies for Scala.

dwijnand/abactis 0

Manages logging and auditing of the data in Consul KV

dwijnand/advisoryboard 0

Scala Center Advisory Board planning

dwijnand/akka 0

Build highly concurrent, distributed, and resilient message-driven applications on the JVM

dwijnand/akka-grpc 0

Akka gRPC

dwijnand/akka-grpc-play-quickstart-java 0

Example for akka-grpc services embedded in Play framework applications

dwijnand/akka-http 0

The Streaming-first HTTP server/module of Akka

dwijnand/akka-persistence-cassandra 0

A replicated Akka Persistence journal backed by Apache Cassandra

pull request commentscala/scala

Tweak pattern for cntrl chars in REPL

Most of my regressions never find release but are kept internal. Not sure it's a healthy way to live.

som-snytt

comment created time in 4 hours

PR opened scala/scala

sbt 1.4.8 (was 1.4.7)
+22 -22

0 comment

5 changed files

pr created time in 5 hours

pull request commentscala/scala

Tweak pattern for cntrl chars in REPL

marking as "internal" since the regression never made it into a release.

som-snytt

comment created time in 6 hours

Pull request review commentscala/scala

REPL: Wrap annotated expressions in a "resN" result val

++scala> import scala.annotation.nowarn+import scala.annotation.nowarn++scala> scala.#::.unapply(Stream(1))+                 ^+       warning: method unapply in object #:: is deprecated (since 2.13.0): Prefer LazyList instead+                         ^+       warning: value Stream in package scala is deprecated (since 2.13.0): Use LazyList instead of Stream+val res0: Option[(Int, Stream[Int])] = Some((1,Stream()))++scala> scala.#::.unapply(Stream(1)): @nowarn+val res1: Option[(Int, Stream[Int])] @scala.annotation.nowarn = Some((1,Stream()))++scala> (scala.#::.unapply(Stream(1)): @nowarn)+val res2: Option[(Int, Stream[Int])] @scala.annotation.nowarn = Some((1,Stream()))++scala> scala.#::.unapply(Stream(1)): @inline+                 ^+       warning: method unapply in object #:: is deprecated (since 2.13.0): Prefer LazyList instead+                         ^+       warning: value Stream in package scala is deprecated (since 2.13.0): Use LazyList instead of Stream+                                      ^+       warning: type Stream in package scala is deprecated (since 2.13.0): Use LazyList instead of Stream

why does this warning not occur for res0?

dwijnand

comment created time in 6 hours

issue commentscala/bug

Annotated expressions do not become a result in the REPL

Seth's comment on the PR

It seems wrong to me that @nowarn appears anywhere in the result.

may be taken to mean

Annotated expressions do not become a result

in the Victorian sense of

Annotated expressions do not become a woman of good breeding.

I was going to be clever and try to help, but I guess I'm doing something wrong:

➜  scala git:(review/12292) skala
Welcome to Scala 2.13.6-20210308-203707-27eee45 (OpenJDK 64-Bit Server VM, Java 15).
Type in expressions for evaluation. Or try :help.

scala> import annotation._
import annotation._

scala> scala.#::.unapply(Stream(1)): @nowarn
val res0: Option[(Int, Stream[Int])] @scala.annotation.nowarn = Some((1,Stream()))

scala> scala.#::.unapply(Stream(1)): Option[(Int, Stream[Int])]  @nowarn
                 ^
       warning: method unapply in object #:: is deprecated (since 2.13.0): Prefer LazyList instead
                         ^
       warning: value Stream in package scala is deprecated (since 2.13.0): Use LazyList instead of Stream
val res1: Option[(Int, Stream[Int])] @scala.annotation.nowarn = Some((1,Stream()))

scala>
NthPortal

comment created time in 7 hours

pull request commentscala/scala

REPL: Wrap annotated expressions in a "resN" result val

scala> scala.#::.unapply(Stream(1)): @nowarn
 val res1: Option[(Int, Stream[Int])] @scala.annotation.nowarn = Some((1,Stream()))

It seems wrong to me that @nowarn appears anywhere in the result.

: @nowarn isn't a type ascription, as per SLS 11.1; it shares a syntax with type ascriptions, but the meaning is to attach the annotation to the expression, it is not part of the type

and it doesn't make sense for the annotation to propagate from the expression to the definition (the val). Scala doesn't work that way; when you write val x = y: @foo, the @foo annotation is only on the expression y, it does not affect the val. So it seems to me that the same ought to be true of res1 here.

dwijnand

comment created time in 10 hours

issue commentscala/scala-dev

`travis/default.yml` doesn't work with sbt 1.4.8

do you think there's anything under maven-releases that isn't on maven central? That way I can ask internally to setup the redirect.

No. I've never used maven-releases on Bintray as actual repo. They should all be synced to Maven Central.

SethTisue

comment created time in 10 hours

pull request commentscala/scala

Make restarr <-> reload switching faster

LGTM, but let's discuss (at least briefly) at team meeting

dwijnand

comment created time in 10 hours

issue commentscala/scala-dev

`travis/default.yml` doesn't work with sbt 1.4.8

(as for the likelihood of getting Travis-CI on a newer sbt-extras, Dale notes that:

  • although this 2018 PR was ignored:
    • https://github.com/travis-ci/travis-build/pull/1423
  • this 2020 PR was merged:
    • https://github.com/travis-ci/travis-build/pull/1946

so there is at least some grounds for optimism that another version bump PR would be merged.)

SethTisue

comment created time in 10 hours

Pull request review commentscala/scala

Fixes String interpolator with \"

 trait Scanners extends ScannersCommon {       } else unclosedStringLit()     } -    private def unclosedStringLit(): Unit = syntaxError("unclosed string literal")+    private def unclosedStringLit(seenEscapedQuoteInInterpolation: Boolean = false): Unit = {+      val note =+        if (seenEscapedQuoteInInterpolation) "; note that `\\\"` no longer closes single-quoted interpolated string literals since 2.13.6, you can use a triple-quoted string instead"

This suggests to move from s"..." to s"""...""". The two behave the same, because escapes are handled by s in both cases.

To me the main goal of this PR is to avoid the surprise of going from "she: \"me?\"" to s"she: \"me?\"". The discrepancy between """yes\no""" and s"""yes\no""" is much less sublte and should maybe also be addressed somehow...

eed3si9n

comment created time in 11 hours

Pull request review commentscala/scala

Fixes String interpolator with \"

 alphaid                ::= upper idrest  ``` -Interpolated string consist of an identifier starting with a letter immediately +An interpolated string consist of an identifier starting with a letter immediately followed by a string literal. There may be no whitespace characters or comments -between the leading identifier and the opening quote ‘”’ of the string. -The string literal in a interpolated string can be standard (single quote) +between the leading identifier and the opening quote `"` of the string.+The string literal in an interpolated string can be standard (single quote) or multi-line (triple quote). -Inside a interpolated string none of the usual escape characters are interpreted -(except for unicode escapes) no matter whether the string literal is normal -(enclosed in single quotes) or multi-line (enclosed in triple quotes). -Instead, there are two new forms of dollar sign escape. +Inside an interpolated string none of the usual escape characters are interpreted+no matter whether the string literal is normal (enclosed in single quotes) or+multi-line (enclosed in triple quotes). Note that the sequence `\"` does not+close a normal string literal (enclosed in single quotes).++There are two new forms of dollar sign escape. 

new?

eed3si9n

comment created time in 11 hours

Pull request review commentscala/scala

Fixes String interpolator with \"

 alphaid                ::= upper idrest  ``` -Interpolated string consist of an identifier starting with a letter immediately +An interpolated string consist of an identifier starting with a letter immediately

consists

eed3si9n

comment created time in 11 hours

pull request commentscala/scala

Fixes String interpolator with \"

Pushed some spec'ese words for this change.

eed3si9n

comment created time in 11 hours

PR opened scala/scala

Tweak pattern for cntrl chars in REPL

As noticed at https://github.com/scala/scala/pull/9451#issuecomment-792773836

+13 -2

0 comment

3 changed files

pr created time in 11 hours

Pull request review commentscala/scala

REPL: improve handling of non-printable characters (to prevent messing up terminal)

  package scala.tools.nsc.interpreter -import scala.util.Properties.lineSeparator import scala.util.matching.Regex  /** This is for name logic which is independent of the compiler (notice there's no Global.)  *  That includes at least generating, metaquoting, mangling, and unmangling.  */ object Naming {-  def unmangle(str: String): String = {-    val ESC = '\u001b'-    val cleaned = lineRegex.replaceAllIn(str, "")-    // Looking to exclude binary data which hoses the terminal, but-    // let through the subset of it we need, like whitespace and also-    // <ESC> for ansi codes.-    val binaryChars = cleaned count (ch => ch < 32 && !ch.isWhitespace && ch != ESC)-    // Lots of binary chars - translate all supposed whitespace into spaces-    // except supposed line endings, otherwise scrubbed lines run together-    if (binaryChars > 5) // more than one can count while holding a hamburger-      cleaned map {-        case c if lineSeparator contains c => c-        case c if c.isWhitespace => ' '-        case c if c < 32 => '?'-        case c => c-      }-    // Not lots - preserve whitespace and ESC-    else-      cleaned map (ch => if (ch.isWhitespace || ch == ESC) ch else if (ch < 32) '?' else ch)-  }+  // The CSI pattern matches a subset of the following spec:+  // For CSI, or "Control Sequence Introducer" commands,+  // the ESC [ is followed by any number (including none) of "parameter bytes" in the range 0x30–0x3F (ASCII 0–9:;<=>?),+  // then by any number of "intermediate bytes" in the range 0x20–0x2F (ASCII space and !"#$%&'()*+,-./),+  // then finally by a single "final byte" in the range 0x40–0x7E (ASCII @A–Z[\]^_`a–z{|}~)+  private final val esc = "\u001b"    // "\N{escape}"+  private val csi = raw"$esc\[[0-9;]*([\x40-\x7E])"++  // Matches one of 3 alternatives:+  // group 1 is the CSI command letter, where 'm' is color rendition+  // group 2 is a sequence of chars to be rendered as `?`: anything non-printable and not some space char+  // additional groups are introduced by linePattern but not used+  private lazy val cleaner = raw"$csi|([^\p{Print}\p{Space}]+)|$linePattern".r

👍

som-snytt

comment created time in 12 hours

Pull request review commentscala/scala

REPL: improve handling of non-printable characters (to prevent messing up terminal)

  package scala.tools.nsc.interpreter -import scala.util.Properties.lineSeparator import scala.util.matching.Regex  /** This is for name logic which is independent of the compiler (notice there's no Global.)  *  That includes at least generating, metaquoting, mangling, and unmangling.  */ object Naming {-  def unmangle(str: String): String = {-    val ESC = '\u001b'-    val cleaned = lineRegex.replaceAllIn(str, "")-    // Looking to exclude binary data which hoses the terminal, but-    // let through the subset of it we need, like whitespace and also-    // <ESC> for ansi codes.-    val binaryChars = cleaned count (ch => ch < 32 && !ch.isWhitespace && ch != ESC)-    // Lots of binary chars - translate all supposed whitespace into spaces-    // except supposed line endings, otherwise scrubbed lines run together-    if (binaryChars > 5) // more than one can count while holding a hamburger-      cleaned map {-        case c if lineSeparator contains c => c-        case c if c.isWhitespace => ' '-        case c if c < 32 => '?'-        case c => c-      }-    // Not lots - preserve whitespace and ESC-    else-      cleaned map (ch => if (ch.isWhitespace || ch == ESC) ch else if (ch < 32) '?' else ch)-  }+  // The CSI pattern matches a subset of the following spec:+  // For CSI, or "Control Sequence Introducer" commands,+  // the ESC [ is followed by any number (including none) of "parameter bytes" in the range 0x30–0x3F (ASCII 0–9:;<=>?),+  // then by any number of "intermediate bytes" in the range 0x20–0x2F (ASCII space and !"#$%&'()*+,-./),+  // then finally by a single "final byte" in the range 0x40–0x7E (ASCII @A–Z[\]^_`a–z{|}~)+  private final val esc = "\u001b"    // "\N{escape}"+  private val csi = raw"$esc\[[0-9;]*([\x40-\x7E])"++  // Matches one of 3 alternatives:+  // group 1 is the CSI command letter, where 'm' is color rendition+  // group 2 is a sequence of chars to be rendered as `?`: anything non-printable and not some space char+  // additional groups are introduced by linePattern but not used+  private lazy val cleaner = raw"$csi|([^\p{Print}\p{Space}]+)|$linePattern".r

([\p{Cntrl}&&[^\p{Space}]]+) for group 2

som-snytt

comment created time in 12 hours

pull request commentscala/scala

REPL: improve handling of non-printable characters (to prevent messing up terminal)

US-ASCII FTW. "POSIX character classes (US-ASCII only)".

som-snytt

comment created time in 12 hours

issue commentscala/scala-dev

`travis/default.yml` doesn't work with sbt 1.4.8

I've opened https://github.com/scala/scala-dev/issues/766 proposing we adopt your solution.

SethTisue

comment created time in 12 hours

issue openedscala/scala-dev

Move `travis.yml/default.yml` off sbt-extras, onto official launcher

As per discussion on https://github.com/scala/scala-dev/issues/765

Yes, there is a risk that somebody's repo will actually be expecting sbt-extras, but I think we should just rip that bandaid off, there is no "good time" to rip it off.

Motivation: sbt-extras is not the standard, and the proliferation of multiple launch scripts (there's a coursier one now, too) is bad for the community. I think we should discourage use or perception of sbt-extras as a de facto default. The official script should be the de facto default. It's fine for sbt-extras to exist as a power-user alternative for those who want it. (And if sat-extra has some feature that is really so commonly needed, that feature should be ported to the official one.)

created time in 12 hours

issue commentscala/scala-dev

`travis/default.yml` doesn't work with sbt 1.4.8

oh, I see, sorry. okay, yours is better, then.

SethTisue

comment created time in 13 hours

issue commentscala/scala-dev

`travis/default.yml` doesn't work with sbt 1.4.8

The official launcher includes Bash script, sbt-launch.jar, sbtn binary, all in one tar ball. This eliminates the "where is sbt-launcher this month" problem.

SethTisue

comment created time in 13 hours

issue commentscala/scala-dev

`travis/default.yml` doesn't work with sbt 1.4.8

@eed3si9n I like that your solution uses the official launch script rather than sbt-extras, but I'm a bit uncomfortable with how it grabs an entire tarball just to extract one file from it. It's not exactly the worst thing in the world, but if the launch script were independently downloadable, that would be advantageous. Overall I'm rather anti-sbt-extras, but it's pretty nice that you can just get the script by itself.

SethTisue

comment created time in 13 hours

issue commentscala/scala-dev

`travis/default.yml` doesn't work with sbt 1.4.8

That's true. https://repo.scala-sbt.org/scalasbt/maven-releases/ can just redirect anything under it to Maven Central.

SethTisue

comment created time in 13 hours

pull request commentscala/scala

Fixes String interpolator with \"

(t7020.scala is flaky currently, likely since https://github.com/scala/scala/pull/9522)

eed3si9n

comment created time in 13 hours

pull request commentscala/scala

REPL: improve handling of non-printable characters (to prevent messing up terminal)

This seems a too eager...

2.13.4:

scala> "\uCAFE caffè"
val res0: String = 쫾 caffè

2.13.5

scala> "\uCAFE caffè"
val res0: String = ? caff?
som-snytt

comment created time in 14 hours

Pull request review commentscala/scala

allow $ escaping double quotes in interpolations under -Xsource:3

 trait Scanners extends ScannersCommon {         }       } else if (ch == '$') {         nextRawChar()-        if (ch == '$') {+        if (ch == '$' || (currentRun.isScala3 && ch == '"')) {

Then it probably also needs the spec changes in https://github.com/scala/scala/pull/6953

martijnhoekstra

comment created time in 14 hours

Pull request review commentscala/scala

allow $ escaping double quotes in interpolations under -Xsource:3

 trait Scanners extends ScannersCommon {         }       } else if (ch == '$') {         nextRawChar()-        if (ch == '$') {+        if (ch == '$' || (currentRun.isScala3 && ch == '"')) {

Yeah, but it's in Scala 3, so 🤷‍♂️

martijnhoekstra

comment created time in 14 hours

Pull request review commentscala/scala

allow $ escaping double quotes in interpolations under -Xsource:3

 trait Scanners extends ScannersCommon {         }       } else if (ch == '$') {         nextRawChar()-        if (ch == '$') {+        if (ch == '$' || (currentRun.isScala3 && ch == '"')) {

That's still in pre-SIP state: https://contributors.scala-lang.org/t/pre-sip-mini-sip-escapes-in-interpolations/2076/

martijnhoekstra

comment created time in 14 hours