-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Announcing Scala.js 1.17.0, and add doc for the Wasm backend. #646
Conversation
95df5a2
to
2642144
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only nits. Maybe it makes sense for @tanishiking to have a look at webassembly.md
?
_data/doc.yml
Outdated
@@ -28,7 +28,9 @@ | |||
- text: Emitting modules | |||
url: /doc/project/module.html | |||
- text: JavaScript Environments | |||
url: /doc/project/js-environments.html | |||
url: /doc/project/js-environments.htmlhtml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url: /doc/project/js-environments.htmlhtml | |
url: /doc/project/js-environments.html |
This is a **minor** release: | ||
|
||
* It is backward binary compatible with all earlier versions in the 1.x series: libraries compiled with 1.0.x through 1.16.x can be used with 1.17.0 without change. | ||
* It is *not* forward binary compatible with 1.15.x: libraries compiled with 1.17.0 cannot be used with 1.16.x or earlier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* It is *not* forward binary compatible with 1.15.x: libraries compiled with 1.17.0 cannot be used with 1.16.x or earlier. | |
* It is *not* forward binary compatible with 1.16.x: libraries compiled with 1.17.0 cannot be used with 1.16.x or earlier. |
* The reference types in the IR, such as `ClassType` and `ArrayType`, now have a `nullable: Boolean` flag. | ||
There is also a new type `AnyNotNullType`. | ||
* The `NewArray` node does not accept multiple dimensions anymore. | ||
If you want to emit a multi-dimensional array creation, emit a call to `java.lang.reflect.Array.newInstance` instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to double check: The only other change was the jl.Class
change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That and CheckNotNull
, which is also an addition to UnaryOp
. These are unlikely to hit other people who manipulate IR nodes, since they are confined to the javalib
in practice.
.withArgs(List( | ||
"--experimental-wasm-exnref", // required | ||
"--experimental-wasm-imported-strings", // optional (good for performance) | ||
"--turboshaft-wasm", // optional, bug significantly increases stability |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"--turboshaft-wasm", // optional, bug significantly increases stability | |
"--turboshaft-wasm", // optional, but significantly increases stability |
Otherwise it's funny :P
Moreover, the codebase must not contain any feature that require emitting multiple modules: `@JSExportToplevel` annotations with several module names, or `js.dynamicImport`. | ||
We expect to lift that limitation in the future. | ||
|
||
Other than that, we expect the WebAssembly backend to support all of Scala.js semantics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that, we expect the WebAssembly backend to support all of Scala.js semantics. | |
Other than that, we expect the WebAssembly backend to support all of Scala.js' semantics. |
or
Other than that, we expect the WebAssembly backend to support all of Scala.js semantics. | |
Other than that, we expect the WebAssembly backend to support all Scala.js semantics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one comment on requirements, otherwise looks good to me :)
If you want to use it in browsers, you will need: | ||
|
||
* For Firefox: in `about:config`, enable `javascript.options.wasm_exnref`. | ||
Also make sure to *disable* `javascript.options.wasm_js_string_builtins`: Firefox has two issues with it that break Scala.js ([1919901](https://bugzilla.mozilla.org/show_bug.cgi?id=1919901) and [1920337](https://bugzilla.mozilla.org/show_bug.cgi?id=1920337)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! 😮
|
||
* A JavaScript host (i.e., we do not currently generate standalone Wasm) | ||
* A Wasm engine with support for: | ||
* Wasm 3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Wasm 3.0 | |
* Wasm 2.0 |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasm 2.0 does not contain return_call
yet, which we also use. Wasm 3.0 does contain GC, so we could omit it in theory, but in practice IMO it matters a lot more that we need GC, since that has less widespread support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes sense. Didn't know return_call is not in 2.0
* Future versions of Scala.js may emit Wasm that requires *newer* versions of Wasm engines, dropping support for older engines. | ||
|
||
However, we do *not* expect the *quality* of the Wasm backend to be any lower than the JS backend. | ||
Feel free to report any issue you may experience with the same expectations as for the JS backend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thought about this: You might want to drop a line here about semantics v.s. performance:
IIUC as far as semantics are concerned, we expect full parity, as far as performance is concerned, we still expect improvements. (IMHO the text in the release announcement captures this quite nicely, probably can just be copied).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also codesize and linker incrementality, actually?
2642144
to
7b36cc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
* The reference types in the IR, such as `ClassType` and `ArrayType`, now have a `nullable: Boolean` flag. | ||
There is also a new type `AnyNotNullType`. | ||
* The `NewArray` node does not accept multiple dimensions anymore. | ||
If you want to emit a multi-dimensional array creation, emit a call to `java.lang.reflect.Array.newInstance` instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That and CheckNotNull
, which is also an addition to UnaryOp
. These are unlikely to hit other people who manipulate IR nodes, since they are confined to the javalib
in practice.
|
||
* A JavaScript host (i.e., we do not currently generate standalone Wasm) | ||
* A Wasm engine with support for: | ||
* Wasm 3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasm 2.0 does not contain return_call
yet, which we also use. Wasm 3.0 does contain GC, so we could omit it in theory, but in practice IMO it matters a lot more that we need GC, since that has less widespread support.
7b36cc2
to
08d2baf
Compare
Preparing a bit in advance this time, to review the docs about the Wasm backend and communicate its experimental status.