swiftlang/swift
View on GitHub ↗ ★ 70,522 Swift
The Swift Programming Language
269 mentions on Hacker News by 203 people: 58 stories, 211 comments · first 2015-12-03 · latest 2026-03-26
20082026
-
…UTM as playground. I found out that there is no packaging for Debian at the time of this writing: https://github.com/swiftlang/swift/issues/60690 . No problem! They have a script for installing: https://www.swift.org/install/linux/ curl -O…
comment by rickstanley · 2026-01-31 · in Swift is a more convenient Rust (2023) -
…success(Success) /// A failure, storing a `Failure` value. case failure(Failure) } Source code: https://github.com/swiftlang/swift/blob/256ff127c93d7e59a75f... I'm not sure what the parent commenter meant when they claimed that " Result…
comment by hutao · 2026-01-24 · in Kotlin's rich errors: Native, typed errors without exceptions -
▲ 4
Show HN: I am self-hosting a time-sorted list of top STEM, Arts and Design postsstory by busymom0 · 2025-11-18 · 2 comments
-
…declared as: func f() throws -> T { } Could be read as func f() -> (T|any Error) { } More here: https://github.com/swiftlang/swift/blob/main/docs/ErrorHandl...
comment by nielsbot · 2025-11-12 · in Problems with C++ exceptions -
…(for lack of a better term) between Swift and Rust and there’s a proposal to add ownership https://github.com/swiftlang/swift/blob/main/docs/OwnershipM...
comment by jolux · 2025-10-04 · in Systems Programming with Zig -
https://github.com/swiftlang/swift
comment by stray · 2025-09-17 · in Swift 6.2 Released -
…uses to generate their pages, using https://www.swift.org/documentation/docc/ . For example, AFAIK, https://github.com/swiftlang/swift/blob/main/stdlib/public/c... is used to generate https://developer.apple.com/documentation/swift/array .
comment by Someone · 2025-08-29 · in Show HN: Sosumi.ai – Convert Apple Developer docs to AI-readable Markdown -
…bug and I'm a Swift noob, but I was pretty impressed. (It's what led me to write this post) https://github.com/swiftlang/swift/issues/78435
comment by searls · 2025-08-22 · in Sprinkling self-doubt on ChatGPT -
https://github.com/swiftlang/swift/blob/main/docs/Differenti...
comment by saagarjha · 2025-08-02 · in Carbon Language: An experimental successor to C++ -
…swift's which fully (well tries to) model cpp AST and do what i suggested (emitting code directly): https://github.com/swiftlang/swift/blob/c09135b8f30c0cec8f5f...
comment by almostgotcaught · 2025-07-11 · in Jank is C++ -
…this comment, get interested and do it. [1] http://download.swift.org/docs/assets/generics.pdf [2] https://github.com/apple/swift/tree/main/docs/Generics
comment by mananaysiempre · 2025-06-06 · in (On | No) Syntactic Support for Error Handling -
https://github.com/swiftlang/swift
comment by fnfjfk · 2025-05-11 · in US vs. Google amicus curiae brief of Y Combinator in support of plaintiffs [pdf] -
…have fewer rejections due to any excess random bits[2]? [1] https://github.com/lemire/fastrange [2] https://github.com/swiftlang/swift/pull/39143
comment by aqrit · 2025-03-09 · in Constantly Divisionless Random Numbers -
…https://www.youtube.com/watch?v=LqxbsADqDI4 More documentation on embedded Swift tooling here: https://github.com/swiftlang/swift/blob/main/docs/EmbeddedSw... (Disclosure: I work at Apple.)
comment by timsneath · 2025-02-01 · in Apple is open sourcing Swift Build -
A division free integer in a range RNG has been developed: https://github.com/apple/swift/pull/39143
comment by zgs · 2024-08-17 · in Faster random integer generation with batching -
…I'll give you my next upvote on HN. https://static.aminer.org/pdf/20170130/pdfs/popl/o8rbwxmj6h2... https://github.com/apple/swift
comment by floxy · 2024-06-12 · in The Swift compiler is slow due to how types are inferred -
There are a bunch of other chokepoints, but type inference is a big part of it: https://github.com/apple/swift/blob/main/docs/CompilerPerfor... Another thing I would add to swift as a flag is to make imports based on specific files vs. an…
comment by novok · 2024-06-12 · in The Swift compiler is slow due to how types are inferred -
…of input — a uint128 may or may not be enough. But there is one related algorithm that doesn’t: https://github.com/apple/swift/pull/39143 . This method only requires (output word size + 64) bits, which is really convenient for us since we…
comment by arthur2e5 · 2024-06-04 · in Optimizing 128-bit Division (2020) -
https://github.com/apple/swift/pull/73429
comment by Kallikrates · 2024-05-06 · in Swift's native Clocks are inefficient -
…and dynamically link against that, but I have no idea how well those paths are supported. 0. https://github.com/apple/swift/blob/main/CHANGELOG.md 1. https://github.com/apple/swift-evolution/blob/main/proposals... 2.…
comment by pdpi · 2024-05-06 · in Swift's native Clocks are inefficient -
…make the bias practically undetectable. Comprehensive overview of the approach can be found here: https://github.com/apple/swift/pull/39143
comment by flyingmutant · 2024-05-02 · in Evolving the Go Standard Library with math/rand/v2 -
…- https://learn.microsoft.com/en-us/dotnet/core/deploying/nati... Swift non-C ABI: - https://github.com/apple/swift/blob/main/docs/LibraryEvoluti... - https://www.swift.org/blog/library-evolution/ Swift ARC: -…
comment by neonsunset · 2024-04-08 · in Vala Programming Language -
▲ 3
Swift: Differentiable Programming Manifestostory by banjoe · 2024-03-08 · 1 comment
-
…with CMake, you can just add Swift to a Zephyr project and it pretty much Just Works. [The docs]( https://github.com/apple/swift/blob/main/docs/EmbeddedSwift/... ) should mostly apply to the Zephyr SDK as well.
comment by zoecarver · 2024-03-06 · in Embedded Swift on the Raspberry Pi Pico -
…"Swift is intended as a replacement for C-based languages (C, C++, and Objective-C)." -- from https://github.com/apple/swift/blob/main/docs/tools/swift.po... . Understandable that some don't include the above bullets but just pointing out…
comment by jasode · 2024-01-13 · in Apple hiring compiler developers for improving Swift / C++ interoperability -
They do! See https://github.com/apple/swift/blob/main/docs/LibraryEvoluti... You can also see an example of what a .NET integration with Swift ABI looks like here: https://github.com/dotnet/designs/blob/main/proposed/swift-i...
comment by neonsunset · 2023-12-16 · in Swift was always going to be part of the OS (2022) -
…but dunno if that's "public API" $ codesign --force --sign - --entitlements entitlements.plist foo https://github.com/apple/swift/blob/main/docs/Backtracing.rs... $ SWIFT_BACKTRACE="enable=yes" ./foo Very cool!
comment by torarnv · 2023-11-09 · in On-Crash Backtraces in Swift -
> Perhaps biggest of all Swift doesn’t need a runtime like Obj-C Swift most certainly has a runtime: https://github.com/apple/swift/tree/main/stdlib/public/runti... And most or all of it is written in C++, not Swift last I checked.…
comment by b3morales · 2023-10-20 · in Apple's use of Swift and SwiftUI in iOS 17 -
Two examples from Apple: • The Swift Programming Language: https://github.com/apple/swift • FoundationDB - the open source, distributed, transactional key-value store: https://github.com/apple/foundationdb
comment by surprisetalk · 2023-10-11 · in Apple should acquire Wolfram Research -
You can do the same thing the other way around - https://github.com/apple/swift/blob/main/docs/Android.md .
comment by dickersnoodle · 2023-09-25 · in Kotlin Multiplatform for Android and iOS Apps -
…to be a semantic macro[1] rather a syntactic one, which isn't currently possible in Swift[2]. [0] https://github.com/apple/swift/blob/main/lib/Sema/DerivedCon... [1] https://gist.github.com/DougGregor/4f3ba5f4eadac474ae62eae83... [2]…
comment by itaiferber · 2023-08-26 · in This isn’t the way to speed up Rust compile times -
…candidates a swift compiler engineer could tell you that would be small but significant like that. https://github.com/apple/swift/blob/main/docs/CompilerPerfor...
comment by novok · 2023-07-24 · in Mixing Swift and C++ -
▲ 92
Ownership in Swift: Manifesto and meta-proposal (2017)story by praseodym · 2023-06-06 · 75 comments
-
…semantics, for the same reason as rust: it saves copies without requiring a refcount[1] [1] https://github.com/apple/swift/blob/main/docs/OwnershipManif...
comment by olliej · 2023-05-22 · in Apple is rewriting Foundation in Swift -
…the obvious and sensible step, unless you propose re-implementing them in yet another language? [1] https://github.com/apple/swift/blob/main/docs/CppInteroperab...
comment by olliej · 2023-05-22 · in Apple is rewriting Foundation in Swift -
…could've changed since I've last looked, but there are still things like that are lurking around. https://github.com/apple/swift/blob/main/docs/CompilerPerfor...
comment by novok · 2023-05-04 · in Mojo might be the biggest thing to happen in programming for decades -
There are some interesting approaches in Swift: https://github.com/apple/swift/blob/main/stdlib/public/Obser... https://github.com/apple/swift/blob/main/stdlib/public/Obser...
comment by andrewjl · 2023-04-21 · in Developers should be force-fed state machines (2011) -
I think you're referring to the SR-103 issue: https://github.com/apple/swift/issues/42725
comment by meindnoch · 2023-04-20 · in Defining interfaces in C++: concepts versus inheritance -
…years since then and I didn’t work on the compiler side of things so my memory could be faulty. [1] https://github.com/apple/swift/pull/32233 [2] https://opensource.apple.com/source/lldb/lldb-112/llvm/tools... [3]…
comment by vlovich123 · 2023-04-08 · in The Garbage Collection Handbook, 2nd Edition -
…https://dl.acm.org/doi/abs/10.1145/3170472.3133843 [2]: https://doi.org/10.1145/3243176.3243195 [3]: https://github.com/apple/swift/blob/main/docs/ARCOptimizatio...
comment by NobleExpress · 2023-04-08 · in The Garbage Collection Handbook, 2nd Edition -
…optimization opportunity, although you do need to convince the borrow checker it's correct. [0]: https://github.com/apple/swift/blob/3b00177f768b630a8f7a1135... [1]: https://forums.swift.org/t/a-roadmap-for-improving-swift-per...
comment by Gankra · 2023-01-30 · in Swift Achieved Dynamic Linking Where Rust Couldn't (2019) -
…although there is some Swift in it now [1]. The compiler doesn't depend on Foundation though. [1] https://github.com/apple/swift/tree/main/SwiftCompilerSource...
comment by lukeh · 2023-01-12 · in Apple announces full Swift rewrite of the Foundation framework (2022) -
…by storing a private refcounted object in your struct. See the implementation of Array for example: https://github.com/apple/swift/blob/main/stdlib/public/core/... There’s no magical copy-on-write mechanism at the language level.
comment by meindnoch · 2023-01-11 · in Apple announces full Swift rewrite of the Foundation framework (2022) -
…library source code. I believe the semantics annotations are primarily to help the optimizer. https://github.com/apple/swift/blob/main/stdlib/public/core/...
comment by mayoff · 2023-01-11 · in Apple announces full Swift rewrite of the Foundation framework (2022) -
According to https://github.com/apple/swift/blob/6d2a3bbf9d518c2ff8c63731... > The Swift language contains a number of features not part of the Hindley-Milner type system, including constrained polymorphic types and function overloading,…
comment by lilyball · 2022-11-29 · in SwiftUI Is Convenient, but Slow -
…of targets and architectures [2] They officially provide release build for all major OSs [3] [1] - https://github.com/apple/swift/blob/main/docs/OwnershipManif... [2] - https://github.com/apple/swift/blob/aff7c14d92fd241aff85ba4c... [3] -…
comment by Kukumber · 2022-11-14 · in Tell HN: Rust Is Complex -
…[2] https://github.com/llvm/llvm-project/blob/7555c589af006c9c4d... [3] https://github.com/apple/swift/blob/main/LICENSE.txt
comment by stormbrew · 2022-10-22 · in Linux M1 GPU driver passes 99% of the dEQP-GLES2 compliance tests -
…SIL the way that @inlinable does, but it's still experimental and subject to breakage and change: https://github.com/apple/swift/blob/main/docs/Generics.rst#s...
comment by slavapestov · 2022-10-18 · in Compiling Swift Generics [pdf] -
Thanks again, I'll keep reading. For posterity, another good resource (at least for Swift): https://github.com/apple/swift/blob/main/docs/HowSwiftImport...
comment by n8henrie · 2022-10-10 · in Ask HN: Best book to learn C in 2022?