Another newsletter from your friendly neighborhood swift tinkerer:
I managed to migrate to the 6.2 swift.org WebAssembly SDKs essentially without any issues.
Building embedded wasm files now works with plain old SwiftPM - no custom linking scripts or other tricks outside of the official SDK needed!
As an example, here is the command for the Swiftle demo (using JavaScriptKit's js
plugin for wasm-opt and packaging)
# build.sh - 6.2-snapshot-2025-08-21
swift package \
--swift-sdk "$(swiftc -print-target-info | jq -r '.swiftCompilerTag')_wasm-embedded" \
--enable-experimental-prebuilts \
--allow-writing-to-package-directory \
js -c release --output $OUTDIR --use-cdn
I think this is fantastic progress!
In general, the WebAssembly/JS-interop part has never given me any issues (that I know of).
Now, the embedded part still has a few sharp edges in store for you. I stubbed my toe on at least these issues:
opened 09:04PM - 12 Dec 24 UTC
bug
triage needed
embedded
### Description
There is a bug where despite the class being `final` the comp… iler does not let me use generics in the initializer. This can't be fixed by adding `final` as it seems to be disallowed on initializers. There appears to be a workaround, I made the initializer only create an empty texture and put the generics in a convenience initializer
### Reproduction
```swift
public final class Texture {
private let id: GLuint
public var unit: GLuint
public init(_ unit: GLuint = 0, image: some Drawable) { // Error
var id: GLuint = 0
glad_glGenTextures(1, &id)
(...)
}
(...)
}
```
### Expected behavior
This class is final and only being used for reference semantics. It should compile.
### Environment
```
Apple Swift version 6.2-dev (LLVM 4930d5a55e7728b, Swift ec5bee8bc94399a)
Target: arm64-apple-macosx15.0
```
### Additional information
_No response_
opened 09:21PM - 24 Aug 25 UTC
bug
crash
triage needed
### Description
I don't quite know what is going on, but I get a
`Assertion fai… led: (hasValidSignatureForEmbedded(f)), function addLazyFunction at GenDecl.cpp:1498.`
for the case below.
adding "as Int" (even though it is just an array.indices range) makes it compile.
### Reproduction
```swift
func f<V>(_ a: [V]) -> [String] {
return a.indices.map { String($0 /* as Int*/) } // adding `as Int` makes it compile
}
print(f(["A"]).joined())
```
### Stack dump
```text
1. Apple Swift version 6.2-dev (LLVM 66efdf7c877cecb, Swift 7df1fe7289786ed)
2. Compiling with effective version 5.10
3. While evaluating request IRGenRequest(IR Generation for module HelloEmbedded)
4. While emitting IR SIL function "@$e13HelloEmbedded1fySaySSGSayxGlFSSSiXEfU_".
for expression at [HelloEmbedded.swift:5:26 - line:5:39] RangeText="{ String($0) "
5. While lowering reference to SIL function "@$eSS_5radix9uppercaseSSx_SiSbtcSzRzlufcfA0_".
for 'init(_:radix:uppercase:)' (in module 'Swift')
6. While lowering address of SIL function "@$eSS_5radix9uppercaseSSx_SiSbtcSzRzlufcfA0_".
for 'init(_:radix:uppercase:)' (in module 'Swift')
#0 0x000000010a184e08 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x1059dce08)
#1 0x000000010a183534 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x1059db534)
#2 0x000000010a185450 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x1059dd450)
#3 0x0000000199c9d6a4 (/usr/lib/system/libsystem_platform.dylib+0x1804ad6a4)
#4 0x0000000199c6388c (/usr/lib/system/libsystem_pthread.dylib+0x18047388c)
#5 0x0000000199b6ca3c (/usr/lib/system/libsystem_c.dylib+0x18037ca3c)
#6 0x00000001062ecfac (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x101b44fac)
#7 0x0000000104dd8d00 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x100630d00)
#8 0x0000000104ddb468 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x100633468)
#9 0x0000000104f5ae74 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x1007b2e74)
#10 0x0000000104f417b4 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x1007997b4)
#11 0x0000000104f3cefc (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x100794efc)
#12 0x0000000104f3a76c (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x10079276c)
#13 0x0000000104dd8260 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x100630260)
#14 0x0000000104eeb5a0 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x1007435a0)
#15 0x0000000104f398fc (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x1007918fc)
#16 0x0000000104ef2cd0 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x10074acd0)
#17 0x0000000104eec468 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x100744468)
#18 0x0000000104a40110 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x100298110)
#19 0x0000000104a3cc04 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x100294c04)
#20 0x0000000104a3c398 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x100294398)
#21 0x0000000104a48800 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x1002a0800)
#22 0x0000000104a3de34 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x100295e34)
#23 0x0000000104a3d5f0 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x1002955f0)
#24 0x00000001047e11b8 (/Users/simon/Library/Developer/Toolchains/swift-6.2-DEVELOPMENT-SNAPSHOT-2025-08-14-a.xctoolchain/usr/bin/swift-frontend+0x1000391b8)
#25 0x00000001998c2b98
```
### Expected behavior
it compiles and works (without the cast)
### Environment
swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Target: arm64-apple-macosx15.0
### Additional information
_No response_
opened 02:52PM - 31 Jul 25 UTC
standard library
numerics
embedded
### Description
We should make the standard library floating point and integer … printing and parsing functions available in embedded swift.
### Additional information
_No response_
opened 05:22PM - 23 May 25 UTC
embedded
Embedded Swift should have a way to select which types of references are support… ed:
- none (no classes)
- strong (simple arc count)
- strong + weak (arc + side table)
This means we need frontend support for disabling features as needed and backend support for different codegen depending on the mode chosen.
opened 06:44PM - 22 Nov 24 UTC
bug
embedded
### Description
Example use case:
[JavaScriptKit](https://github.com/swiftwasm… /JavaScriptKit) provides interop via `@_expose(wasm)` declarations.
However, when an embedded swift app is depending on it, these symbols are missing from the final binary. After a brief discussion with @rauhul it is pretty clear why:
+ all swift module dependencies are actually only "compiled" into the final module via swiftmodules
+ the object files of the swift dependencies cannot be used for linking (otherwise we'd get duplicate symbols)
+ since the app module does not actually reference the swift declaration, it will not end up in an object file used for linking
I suspect this is true for any "unused" top-level swift declaration that should end up in the binary, and I guess this is also the reason for `@_cdecl`s not working (see https://github.com/swiftlang/swift/issues/74328)
### Reproduction
see a package with this issue here (with the work-around of referencing the expose as an underscored public swift symbol)
https://github.com/swiftwasm/JavaScriptKit/blob/dd0c977dde0ad056b5b0665bc66335b8c77ce59e/Examples/Embedded/Sources/EmbeddedApp/_thingsThatShouldNotBeNeeded.swift#L3-L8
### Expected behavior
ideally all `@_expose` and `@_cdecl` symbols end up "somewhere" so they are available for linking.
maybe it is possible to "just" add them to an object file in the entry module?
we also talked about the `@_used` attribute, but I am not sure it should be needed. (eg: a cdecl can always NOT be linked, that is fine, but it needs to be available at link-time)
### Environment
Apple Swift version 6.1-dev (LLVM 5c0d283c37132bf, Swift b5af518638c9a16)
Target: arm64-apple-macosx15.0
### Additional information
forum post with all the context
https://forums.swift.org/t/web-app-with-embedded-swift-poc-demo/75486
opened 11:32AM - 27 Aug 25 UTC
bug
crash
triage needed
### Description
I don't have a small reproducer, but the ElementaryDOM example … app builds fine with 6.2-snapshot WASM SDK, but crashes the compiler on main-snapshot-2025-08-26.
### Reproduction
https://github.com/sliemeobn/elementary-dom/tree/19ac4de675a82e7e86c7bad5474a634004cc0971/Examples/Basic
run `./build.sh` with swift.org wasm sdk installed
### Stack dump
```text
0. Program arguments: /Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Data/Environment/Environment+ReactiveObject.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Data/Environment/Environment.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Data/Environment/View+Envionment.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Data/State/Binding.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Data/State/State.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Data/State/ViewStateStorage.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Data/StoredValue.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Data/ValueStorage.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Elementary/Elementary+View.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Elementary/KeyedView.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Elementary/ModifiedView.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Elementary/View+DOMEvents.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Elementary/View+Function.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Elementary/View+LifecycleEvents.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Elementary/ViewKey.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Elementary/ViewTuples.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Interop/Elementary+JavaScriptKit.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Interop/EmbeddedSupport.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Interop/EventHandlers.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Interop/GlobalEvents.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Interop/View+Mount.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Macros.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/Nodes/_ConditionalNode.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/Nodes/_ElementNode.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/Nodes/_FunctionNode.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/Nodes/_KeyedNode.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/Nodes/_LifecycleNode.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/Nodes/_TextNode.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/Nodes/_TupleNode.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/ReconcilerNode.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/RenderedView.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/_App.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/_DOMInteracting.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Reconciler/_DOMReconciler.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/exports.swift /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/logging.swift -supplementary-output-file-map /var/folders/7w/fd5kdmmj5mqd5j5yjznxs5g40000gn/T/TemporaryDirectory.oRROAU/supplementaryOutputs-1 -target wasm32-unknown-wasip1 -disable-objc-interop -sdk /Users/simon/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a_wasm.artifactbundle/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a_wasm/wasm32-unknown-wasip1/WASI.sdk -I /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/Modules -color-diagnostics -Xcc -fcolor-diagnostics -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ModuleCache -swift-version 5 -O -D SWIFT_PACKAGE -D SWIFT_MODULE_RESOURCE_BUNDLE_UNAVAILABLE -mergeable-symbols -load-plugin-executable /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/arm64-apple-macosx/debug/ReactivityMacros-tool#ReactivityMacros -load-plugin-executable /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/arm64-apple-macosx/debug/ElementaryDOMMacros-tool#ElementaryDOMMacros -enable-upcoming-feature ExistentialAny -enable-upcoming-feature ConciseMagicFile -enable-upcoming-feature ImplicitOpenExistentials -enable-experimental-feature Embedded -empty-abi-descriptor -plugin-path /Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/lib/swift/host/plugins/testing -resource-dir /Users/simon/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a_wasm.artifactbundle/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a_wasm/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift -use-static-resource-dir -file-compilation-dir /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic -Xcc -fmodule-map-file=/Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/checkouts/JavaScriptKit/Sources/_CJavaScriptKit/include/module.modulemap -Xcc -I -Xcc /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/checkouts/JavaScriptKit/Sources/_CJavaScriptKit/include -Xcc --sysroot -Xcc /Users/simon/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a_wasm.artifactbundle/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a_wasm/wasm32-unknown-wasip1/WASI.sdk -Xcc -D__EMBEDDED_SWIFT__ -Xcc -g -no-auto-bridging-header-chaining -module-name ElementaryDOM -package-name elementary_dom -in-process-plugin-server-path /Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/local/lib/swift/host/plugins -enable-default-cmo -parse-as-library -num-threads 10 -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/Environment+ReactiveObject.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/Environment.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/View+Envionment.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/Binding.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/State.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/ViewStateStorage.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/StoredValue.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/ValueStorage.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/Elementary+View.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/KeyedView.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/ModifiedView.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/View+DOMEvents.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/View+Function.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/View+LifecycleEvents.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/ViewKey.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/ViewTuples.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/Elementary+JavaScriptKit.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/EmbeddedSupport.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/EventHandlers.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/GlobalEvents.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/View+Mount.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/Macros.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/_ConditionalNode.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/_ElementNode.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/_FunctionNode.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/_KeyedNode.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/_LifecycleNode.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/_TextNode.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/_TupleNode.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/ReconcilerNode.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/RenderedView.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/_App.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/_DOMInteracting.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/_DOMReconciler.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/exports.swift.o -o /Users/simon/dev/swift-projects/elementary-dom/Examples/Basic/.build/wasm32-unknown-wasip1/release/ElementaryDOM.build/logging.swift.o
1. Apple Swift version 6.2-dev (LLVM 720e920f24c166e, Swift a5fa3edf54e72fa)
2. Compiling with effective version 5.10
3. While verifying SIL function "@$es5NeverO13ElementaryDOME9_makeNode_7context10reconcilerAC06_EmptyE0VABn_AC12_ViewContextVnAC07_RenderJ0VztFZ".
for '_makeNode(_:context:reconciler:)' (at /Users/simon/dev/swift-projects/elementary-dom/Sources/ElementaryDOM/Elementary/Elementary+View.swift:42:12)
4. Abort: function reportError at MemoryLifetimeVerifier.cpp:265
| in function:
| // static Never._makeNode(_:context:reconciler:)
| // Isolation: unspecified
| sil [ossa] @$es5NeverO13ElementaryDOME9_makeNode_7context10reconcilerAC06_EmptyE0VABn_AC12_ViewContextVnAC07_RenderJ0VztFZ : $@convention(method) (Never, @owned _ViewContext, @inout _RenderContext, @thin Never.Type) -> _EmptyNode {
| // %0 "view" // user: %5
| // %1 "context" // user: %7
| // %2 "reconciler" // users: %19, %15, %11, %9, %8
| // %3 "self" // user: %22
| bb0(%0 : @noImplicitCopy @_eagerMove $Never, %1 : @noImplicitCopy @_eagerMove @owned $_ViewContext, %2 : $*_RenderContext, %3 : $@thin Never.Type):
| %4 = alloc_stack [var_decl] [moveable_value_debuginfo] $Never, var, name "view", type $@moveOnly Never // users: %5, %24
| store %0 to [trivial] %4 // id: %5
| %6 = alloc_stack [var_decl] [moveable_value_debuginfo] $_ViewContext, var, name "context", type $@moveOnly _ViewContext // users: %7, %23
| store %1 to [init] %6 // id: %7
| debug_value %2, var, name "reconciler", argno 3, expr op_deref // id: %8
| %9 = struct_element_addr %2, #_RenderContext.scheduler // user: %10
| destroy_addr %9 // id: %10
| %11 = struct_element_addr %2, #_RenderContext.commitPlan // user: %13
| // function_ref CommitPlan.deinit
| %12 = function_ref @$e13ElementaryDOM10CommitPlanVfD : $@convention(method) (@owned CommitPlan) -> () // user: %14
| %13 = load [take] %11 // user: %14
| %14 = apply %12(%13) : $@convention(method) (@owned CommitPlan) -> ()
| %15 = struct_element_addr %2, #_RenderContext.pendingFunctions // user: %17
| // function_ref PendingFunctionQueue.deinit
| %16 = function_ref @$e13ElementaryDOM20PendingFunctionQueueVfD : $@convention(method) (@owned PendingFunctionQueue) -> () // user: %18
| %17 = load [take] %15 // user: %18
| %18 = apply %16(%17) : $@convention(method) (@owned PendingFunctionQueue) -> ()
| %19 = struct_element_addr %2, #_RenderContext.parentElement // user: %20
| destroy_addr %19 // id: %20
| debug_value undef : $*_RenderContext, var, name "reconciler", argno 3, expr op_deref // id: %21
| debug_value %3, let, name "self", argno 4 // id: %22
| dealloc_stack %6 // id: %23
| dealloc_stack %4 // id: %24
| unreachable // id: %25
| } // end sil function '$es5NeverO13ElementaryDOME9_makeNode_7context10reconcilerAC06_EmptyE0VABn_AC12_ViewContextVnAC07_RenderJ0VztFZ'
#0 0x0000000107c9c4e4 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x105a304e4)
#1 0x0000000107c9ac10 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x105a2ec10)
#2 0x0000000107c9cb2c (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x105a30b2c)
#3 0x0000000199c9d6a4 (/usr/lib/system/libsystem_platform.dylib+0x1804ad6a4)
#4 0x0000000199c6388c (/usr/lib/system/libsystem_pthread.dylib+0x18047388c)
#5 0x0000000199b6ca3c (/usr/lib/system/libsystem_c.dylib+0x18037ca3c)
#6 0x0000000103df8610 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x101b8c610)
#7 0x0000000103df86c4 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x101b8c6c4)
#8 0x0000000102f211ec (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100cb51ec)
#9 0x0000000102f20918 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100cb4918)
#10 0x0000000102f20c68 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100cb4c68)
#11 0x0000000102f1fba0 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100cb3ba0)
#12 0x0000000102f21ce8 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100cb5ce8)
#13 0x0000000102ed6774 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100c6a774)
#14 0x0000000102f1e60c (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100cb260c)
#15 0x0000000102f1d0bc (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100cb10bc)
#16 0x0000000102f2dc08 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100cc1c08)
#17 0x0000000102f27a08 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100cbba08)
#18 0x0000000102f2a7cc (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100cbe7cc)
#19 0x0000000102f2a6a4 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100cbe6a4)
#20 0x00000001027630cc (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x1004f70cc)
#21 0x0000000102518bfc (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x1002acbfc)
#22 0x0000000102518774 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x1002ac774)
#23 0x00000001025286a0 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x1002bc6a0)
#24 0x000000010251c214 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x1002b0214)
#25 0x0000000102519884 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x1002ad884)
#26 0x00000001022a4864 (/Users/simon/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-08-26-a.xctoolchain/usr/bin/swift-frontend+0x100038864)
#27 0x00000001998c2b98
```
### Expected behavior
it compiles
### Environment
main-snapshot-2025-08-26
Apple Swift version 6.2-dev (LLVM 720e920f24c166e, Swift a5fa3edf54e72fa)
Target: arm64-apple-macosx15.0
Build config: +assertions
### Additional information
_No response_
And, more generally, every now and then you accidentally use some API that requires unicode handling - but nobody tells you where. All you get is a "where is my _swift_stdlib_getNormData
symbol?" linker error, but to my knowledge, there is no way to get a diagnostic on the line in question for this.
In other news, I refactored the reconciler part a tiny bit (ie: complete overhaul) with the goal of making it fit for transitions and animations. It came out as a completely generic node tree, which should be great for runtime performance (no double dispatch, almost no indirections, reduced allocations) - but I fear the code size consequences, we will see.
I thought I was being very clever making rendered nodes generic over a ~Copyable
protocol, but associated types are not yet able to suppress Copyable
. Also, noncopyable tuples don't work, and enum and collection handling of noncopyables is still rough anyway, so I guess we'll have to call that idea a "future direction" for now - sure would be cool.
In conclusion, I believe there is not much keeping us from having a viable solution for low-fuss real-life client-side web apps written in Swift. In my mind the only real "blocker" is missing first-class handling of JSON data that works in Embedded Swift. But once the much desired future of serialization & deserialization APIs enters the chat, we should be good on that front.
Other nice-to-haves would include Observation for Embedded (maybe more support for KeyPaths in general) and the dust settling around _Concurrency
/@MainActor
/Swift 6 language mode in Embedded Wasm.
wdyt?