Skip to content

Instantly share code, notes, and snippets.

View oyvindberg's full-sized avatar

Øyvind Raddum Berg oyvindberg

View GitHub Profile
@oyvindberg
oyvindberg / farray-scala3-experiment.md
Last active July 20, 2026 12:18
farray-scala3-experiment

As some of you may have seen, a week or two ago I published an experimental collections library, farray — an immutable, Array-backed sequence with O(1) structural ops (via lazy nodes over flat leaves), no boxing of primitives, name-based ::/+: extractors, and a fusion macro. I chose its main characteristics specifically because I was convinced they'd be an ideal fit for the Scala 3 compiler: covariance (FArray[+A], like List), dedicated special-casing for length 0 and 1 (a shared empty singleton and a one-field leaf), unboxed flat storage, and O(1) ++/+:/take/drop. Given everything I thought I knew about JVM performance, I was fully convinced that replacing List with FArray throughout the compiler would be a large, obvious win.

It wasn't.

What I did

I started from Li Haoyi's "Vector as default Seq" branch and mechanically replaced essentially all internal collection use in the compiler with FArray — compiler/src in full, plus r

@oyvindberg
oyvindberg / diff-test.md
Created January 14, 2026 21:15
Testing diff rendering options

Test 1 - Standard diff block

- SELECT a, , b FROM users
+ SELECT a, b FROM users

Test 2 - With @@ header

@@ SQL Recovery @@
- SELECT a, , b FROM users

Thank you for your work on Bleep! Developing a first-class Scala build experience that goes beyond Sbt is a daunting task, but one I believe is very much necessary for the health of industrial Scala.

Some preliminary thoughts:

Thank you for having a look and sharing your thoughts around this, greatly appreciated!

  1. I love that you went build-as-data. Tooling matters, and the build tool is the center of the entire tooling pipeline. Other tools need the ability to both read and write build data, and this can only be done economically with build-as-data.

Bleep is an experiment of thow far we can take build-as-data. So far I see no limits 🚀

264
typings.babelCore.Anon_Exported
TsIdentLibrarySimple(babel-core).TsIdentSimple(Anon_Exported)
TsIdentLibraryScoped(babel,Some(core)).TsIdentSimple(Anon_Exported)
typings.babelCore.Anon_Loc
TsIdentLibraryScoped(babel,Some(core)).TsIdentSimple(Anon_Loc)
TsIdentLibrarySimple(babel-core).TsIdentSimple(Anon_Loc)
package hello.world
import org.scalajs.dom.console
import slinky.core._
import slinky.core.annotations.react
import slinky.core.facade.Hooks._
import slinky.web.html._
import typings.reactLib.reactMod.MouseEvent
import scala.scalajs.js

Anticipated questions

Whatsup with those version strings?

Oh yes, you've noticed the long version strings - Good! If you didn't, they look like this:

libraryDependencies ++= Seq(
  "com.olvind.scalablytyped" %%% "node" % "10.9.x-dt-20180910Z-53a4c0",
 "com.olvind.scalablytyped" %%% "rxjs" % "6.3.2-a446da"
package chandu0101.scalajs.react.components
import chandu0101.macros.tojs.JSMacro
import chandu0101.macros.tojs.JSMacro._
import japgolly.scalajs.react.{Callback, ReactElement, ReactComponentU_, React}
import scala.scalajs.js
import scala.scalajs.js.annotation.JSName
object ReactSlickComponent {
package minitest
import scala.util.{Failure, Success, Try}
trait MiniTest{
sealed trait Result
case object SuccessRes extends Result
case class FailureRes(reason: String) extends Result
case class PendingRes(reason: String) extends Result
import java.io.File
import java.net.URL
import org.scalatest.{FunSpec, Matchers}
import unfiltered.filter.Plan
import unfiltered.jetty.Server
trait UnfilteredFixture extends FunSpec with Matchers {
private val port = unfiltered.util.Port.any
package buzzwords
import java.io.File
import scala.io.Source
/**
* Det er fint å bruke typer som dokumentasjon/sikkerhet, og det gjør vi her
* med disse wrapper-typene.
*
* `extends AnyVal` vil si at det er er value types - dvs at det