News for hackers. Stuff that matters.
Re:Swift Static Linux SDK by mdhb on Tuesday June 11, 2024 @05:36PM (#40651846)
You almost caught up to Dart.

- Built for embedded devices and already has RISC-V support

- Already has WASM was a compilation target

- Not just an LSP but amazing VSCode tooling

- Native C, C++, Java, Rust and JavaScript interop and a .NET bridge is in the works it seems.

- Typed "throws"

- Static linking (in development)

- Data-race free by default

Unique features to Swift:

- Distributed actors for concurrency that run on distant machines. (This is doable but not native to the language)

- non-copy RAII generic types (not actually sure what this is so I assume it’s not in Dart)

Re:Swift Static Linux SDK by almostgotcaught on Tuesday June 11, 2024 @06:04PM (#40652138)
> - Native C, C++, Java, Rust and JavaScript interop

dart doesn't do C++ interop

Re:Swift Static Linux SDK by manmal on Tuesday June 11, 2024 @06:12PM (#40652218)
Isn’t “data-race free” in Dart achieved by just not really sharing mutable memory between isolates? Probably because the web version needs to map isolates to web workers, right?
Re:Swift Static Linux SDK by mdhb on Tuesday June 11, 2024 @06:33PM (#40652424)
Re:Swift Static Linux SDK by manmal on Wednesday June 12, 2024 @03:56AM (#40655644)
Great writeup, and I love that the authors looked at a lot of other languages. The solution section on how to prevent races is a bit light still - I‘m curious how they will solve this.

I think there will need to be exceptions to a strict race-free model eto not take away from dart‘s current capabilities, and without forcing people into something like a borrow checker. Swift has `@unchecked Sendable` which lets you tell the compiler "I promise I'll take care myself to keep everything in there race-free".

What I‘ve been missing in Swift are tools that let me add safety _within_ such @unchecked Sendables. There's the Swift Atomics lib: https://www.swift.org/blog/swift-atomics/, but its quite limited in its capabilities. So for now, I find myself reaching for tools provided by the community, like pointfree's LockIsolated: https://github.com/pointfreeco/swift-concurrency-extras/blob....