sudori part 2

in

I'm hacking on a small project called sudori, an experimental sbt. The initial goal is to port the macro to Scala 3. It's an exercise to take the macro apart and see if we can build it from the ground up. This an advanced area of Scala 2 and 3, and I'm finding my way around by trial and error. This is part 2.

  • contImpl macro implements both Applicative-do and Monadic-do. It does so by first scanning the abstract syntax tree for key.value. When there are none, it calls pure(...) and map(...) when there is exactly one.
  • To pass the Instance instance i to macro and back to the generated code, it uses Singleton type i.type, which internally holds on to the symbol of i.
  • Quotes API provides a convenient way to generating lambda expression, but it must know the exact type of the parameters. This means we can't gradually expand the definition of the lambda expression as we walk the tree. To workaround this, we will use var one scope outside of the lambda expression.
  • We defined Zero typeclass and summon a value for it to initialize the vars.

sudori part 1

in

I'm hacking on a small project called sudori, an experimental sbt. The initial goal is to port the macro to Scala 3. It's an exercise to take the macro apart and see if we can build it from the ground up. This an advanced area of Scala 2 and 3, and I'm finding my way around by trial and error.

Reference:
- Scala 3 Reference: Metaprogramming

sbt 1.5.5

in

sbt 1.5.4

in

I'm happy to announce sbt 1.5.4 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.5.4

  • Fixes compiler ClassLoader list to use compilerJars.toList (For Scala 3, this drops support for 3.0.0-M2) #6538 by @adpi2
  • Fixes undercompilation of package object causing "Symbol 'type X' is missing from the classpath" zinc#983 by @retronym
  • Fixes overcompilation with scalac -release flag zinc#982 by @retronym
  • Fixes BSP on ARM Macs by keeping JNI server socket to keep using JNI ipcsocket#14 by @quelgar

sbt-assembly 1.0.0

in

In June of 2011, I started working on sbt-assembly for sbt 0.10, based on Coda Hale's assembly-sbt from sbt 0.7, which in turn was probably inspired by maven-assembly-plugin. After ten years, I'm going to call this one 1.0.0. sbt-assembly 1.0.0 is published to Maven Central.

sbt 1.5.3

in
  • Fixes scalacOptions not getting forwarded to ScalaDoc in Scala 3 #6499 by @pikinier20
  • Fixes undercompilation of sealed traits that extends other seal traits zinc#979 by @dwijnand
  • Fixes version parsing not recognizing dots in a prerelease tag lm#377 by @Nirvikalpa108
  • Fixes inputFile resolving to incorrect files when file specific globs are used io#319 by @eatkins
  • Updates to Scala 2.12.14 #6522 by @mkurz

For more details please see https://github.com/sbt/sbt/releases/tag/v1.5.3

Scala, Python quick reference

syntax Scala Python
immutable variable val x = 1 Starlark:
REV = "1.1.0"
lazy variable lazy val x = 1 n/a
mutable variable var x = 1 in function:
x = 1
if expression if (x > 1) "a" else "b" "a" if x > 1 else "b"

POM consistency for sbt plugins

in

There's a long-standing bug that sbt maintainers have known for a while, which is that when sbt plugin is published to a Maven repository, the POM file sbt generates is not valid.

Here's an example. sbt-pgp 2.1.2 is published to https://repo1.maven.org/maven2/com/github/sbt/sbt-pgp_2.12_1.0/2.1.2/sbt-pgp-2.1.2.pom, but if you look at the POM file name it's sbt-pgp-2.1.2.pom, not matching the URL structure sbt-pgp_2.12_1.0. Since most plugins were published to Bintray until recently, and because only a few plugins were published to Sonatype OSSRH, which seems to be okay with this, this issue has not gotten too much attention.

Fast forward 2021, Bintray was discontinued, and now that more plugins are published to Sonatype OSSRH, companies that use Artifactory to front Maven Central are running into this. Active GitHub issue is sbt/sbt#3410. I will discuss an experimental workaround for this.

sbt 1.5.2

in

I'm happy to announce sbt 1.5.2 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.5.2

Syndicate content