Skip to content

Instantly share code, notes, and snippets.

View SethTisue's full-sized avatar

Seth Tisue SethTisue

View GitHub Profile
@SethTisue
SethTisue / foreword.md
Last active October 18, 2024 02:14
book foreword for O’Reilly

here is my 2021 foreword to Dean Wampler’s Scala 3 book for O’Reilly

“Scala [...] is worth fighting for.” ✊

public <T> boolean exists(scala.collection.Iterable<T>, scala.Function1<T, java.lang.Object>);
Code:
0: new #19 // class scala/util/boundary$Label
3: dup
4: invokespecial #44 // Method scala/util/boundary$Label."<init>":()V
7: astore_3
8: aload_1
9: aload_0
10: aload_2
11: aload_3

From scala.xml.pull to javax.xml.stream.events

Want to process XML that's too large to fit in memory?

The Scala standard library used to offer scala.xml.pull for this. It became part of the scala-xml library when scala-xml became separate. But then scala.xml.pull got deprecated (in scala.xml 1.1.1) and finally removed entirely (in scala-xml 2.0.0-M1). The recommended replacement is javax.xml.stream.events.

I had some old code that used scala.xml.pull to digest my iTunes Music Library.xml and print various statistics. Recently I converted it to Scala 3, so I decided to get off the deprecated API at the same time.

So, here is the before-and-after. Perhaps this will help other users of scala.xml.pull who want to convert.

@SethTisue
SethTisue / release-notes-2.13.3.md
Last active June 25, 2020 21:06
Scala 2.13.3 draft release notes
@SethTisue
SethTisue / release-notes-2.12.11.md
Last active March 11, 2020 10:10
draft release notes for Scala 2.12.11

Collections fixes

  • Fix 2.12-only bug where some toX methods could expose the underlying mutability of a ListBuffer-generated collection (#8674)

(The release includes other collections bugfixes, but this one is especially notable.)

Java interoperability

@SethTisue
SethTisue / 2-12-10.md
Last active September 10, 2019 20:44
Scala 2.12.10 release notes (DRAFT)

Highlights

The main purpose of this release is to fix the following regressions in 2.12.9:

  • Fix regression in large string interpolations with non-String typed splices (#8315)
  • Revert "Generate shallower ASTs in pattern translation" (#8327, reverting #8061)
  • Fix regression in classpath when JARs have 'a.b' entries beside 'a/b' (#8321)

Further highlights

Fixes with compatibility implications

Scala 2.12.9 generates shallower ASTs in pattern translation, to reduce stack size requirements (-Xss) during compilation.

Scala.js users must update to 0.6.28+ or 1.0.0-M8+ for compatibility with Scala 2.12.9. (#7375)

Highlights of 2.12.9

  • Improved compatibility with JDK 11, 12, and 13 (see below)
@SethTisue
SethTisue / chaining-implicits.md
Last active February 19, 2024 00:56
chaining implicit conversions in Scala 2 and Scala 3

in Scala 2, they don't chain 😇, even if we try to give the compiler an assist

can we make them chain in Dotty? 😈

let's try it!

first let's set up sbt:

% cat project/plugins.sbt
@SethTisue
SethTisue / RC2.md
Last active May 17, 2019 13:59
Scala 2.13.0-RC2 draft release notes
@SethTisue
SethTisue / RC1-draft-release-notes.md
Last active April 5, 2019 13:06
Scala 2.13.0-RC1 draft release notes