Skip to content

Commit 5fc9800

Browse files
committed
examples for possible library additions, words about scala.js and plugin systems
1 parent 0c3ebd7 commit 5fc9800

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

content/drop-stdlib-forwards-bin-compat.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ Dropping forwards binary compatiblity allows adding new methods to existing clas
8888
While this opens a big door in principle, I am certain that stability, consistency and caution will remain core considerations when discussing additions to the standard library.
8989
However, I believe that allowing to (carefully) evolve the standard library is greatly beneficial for the Scala community.
9090

91+
Examples that came up in the past
92+
- various proposals for new operations are here: https://github.com/scala/scala-library-next/issues and https://github.com/scala/scala-library-next/pulls
93+
- addition of `ExecutionContext.opportunistic` in 2.13.4, which could not be made public: https://github.com/scala/scala/pull/9270
94+
- adding `ByteString`: https://contributors.scala-lang.org/t/adding-akkas-bytestring-as-a-scala-module-and-or-stdlib/5967
95+
- new string interpolators: https://github.com/scala/scala/pull/8654
9196

9297
## Alternatives and Related Work
9398

@@ -117,6 +122,16 @@ Concretely, a project might update one of its dependencies to a new version whic
117122
If the project continues using an old version of sbt, the build tool will keep the Scala library pinned.
118123
The new library might reference definitions that don't exist in the older Scala library, leading to linkage errors.
119124

125+
### Scala.js and Scala Native
126+
127+
Scala.js distributes a JavaScript version of the Scala library.
128+
This artifact is currently released once per Scala.js version.
129+
When a new Scala version comes out, a new Scala.js compiler is released, but the Scala library artifact continues to be used until the next Scala.js version.
130+
This scheme does not work if the new Scala version has new definitions, so it needs to be adjusted.
131+
Finding a solution for this problem is necessary and part of the implementation phase.
132+
133+
A similar situation might exist for Scala Native.
134+
120135
### Compiler and Library Version Mismatch
121136

122137
Defining the `scalaVersion` in a project would no longer pin the standard library to that exact version.
@@ -134,6 +149,11 @@ Because the build tool can update the Scala library version, a project might acc
134149
This is safe, as the project's POM file will have a dependency on the newer version of the Scala library.
135150
The same situation can appear with any other dependency of a project.
136151

152+
### Applications with Plugin Systems
153+
154+
In applications where plugins are dynamically loaded, plugins compiled with a new Scala library could fail to work correctly if the application is running with an older Scala library.
155+
156+
This is however not a new issue, the proposed change would just extend the existing problem to the Scala library.
137157

138158
## Limitations
139159

0 commit comments

Comments
 (0)