HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
tensorflow
swift
Jupyter Notebook2018–2026
tensorflow / swift · Archived

swift

Swift for TensorFlow

52Distinct people
59Mentions
0Explicit recommenders
6.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Swift for TensorFlow

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year59 dated mentions

Observed mentions: 2018-04-26 17:57:07 UTC to 2026-03-26 11:29:00 UTC.

01020302018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 10 mentions; 4 submissions, 6 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 28 mentions; 4 submissions, 24 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 10 mentions; 0 submissions, 10 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 8 mentions; 1 submissions, 7 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC1046
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC28424
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC10010
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC817
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Swift for TensorFlow (Archived) Swift for TensorFlow was an experiment in the next-generation platform for machine learning, incorporating the latest research across machine learning, compilers, differentiable programming, systems design, and beyond. It was archived in February 2021. Some significant achievements from this project include: Added language-integrated differentiable programming into the Swift language. This work continues in the official Swift compiler. Developed a mutable-value-semantics-oriented deep learning API. Fostered the development of a model garden with more than 30 models from a variety of deep learning disciplines. Enabled novel research that combines deep learning with probabilistic graphical models for 3D motion tracking and beyond. Powered a(n almost) pure-Swift prototype of a GPU+CPU runtime supporting parallel map. Spun off multiple open source side efforts which continue to be under active development: PythonKit: Python interoperability with Swift. swift-jupyter: Enables use of Swift within Jupyter notebooks. swift-benchmark: Provides a robust benchmarking suite for Swift code. Spun off several other open source efforts: penguin: Parallel programming, data structures, graph algorithms, and more. Tensors Fitting Perfectly: Static analysis of tensor shape mismatches. Swift Evolution proposals pitched, implemented, and accepted: SE-0195: User-defined "Dynamic Member Lookup" Types (@dynamicMemberLookup) SE-0216: Introduce user-defined dynamically "callable" types (@dynamicCallable) SE-0233: Make Numeric refine a new AdditiveArithmetic protocol SE-0253: Callable values of user-defined nominal types (func callAsFunction) This site will not receive further updates. The API documentation and binary downloads will continue to be accessible as well as the Open Design Review meeting recordings. Getting started Using Swift for TensorFlow Google Colaboratory: The fastest way to get started is to try out Swift for TensorFlow right in your browser. Just open up a tutorial, or start from a blank notebook! Read more in our usage guide. Install locally: You can download a pre-built Swift for TensorFlow package. After installation, you can follow these step-by-step instructions to build and execute a Swift script on your computer. Run on GCP: You can spin up a GCE instance using a Swift for TensorFlow Deep Learning VM image, with all drivers and the toolchain pre-installed. Instructions can be found in the Installation Guide. Compile from source: If you'd like to customize Swift for TensorFlow or contribute back, follow our instructions on building Swift for TensorFlow from source. Tutorials Tutorial Last Updated A Swift Tour March 2019 Protocol-Oriented Programming & Generics August 2019 Python Interoperability March 2019 Custom Differentiation March 2019 Sharp Edges in Differentiability November 2020 Model Training Walkthrough March 2019 Raw TensorFlow Operators December 2019 Introducing X10, an XLA-Based Backend May 2020 Resources Models and Examples TensorFlow Swift API Reference Release Notes Known Issues Frequently Asked Questions TensorFlow Blog Posts Forums The discussions happened on the swift@tensorflow.org mailing list. Why Swift for TensorFlow? Swift for TensorFlow is a new way to develop machine learning models. It gives you the power of TensorFlow directly integrated into the Swift programming language. We believe that machine learning paradigms are so important that they deserve first-class language and compiler support. A fundamental primitive in machine learning is gradient-based optimization: computing function derivatives to optimize parameters. With Swift for TensorFlow, you can easily differentiate functions using differential operators like gradient(of:), or differentiate with respect to an entire model by calling method gradient(in:). These differentiation APIs are not just available for Tensor-related concepts—they are generalized for all types that conform to the Differentiable protocol, including Float, Double, SIMD vectors, and your own data structures. // Custom differentiable type. struct Model: Differentiable { var w: Float var b: Float func applied(to input: Float) -> Float { return w * input + b } } // Differentiate using `gradient(at:_:in:)`. let model = Model(w: 4, b: 3) let input: Float = 2 let (𝛁model, 𝛁input) = gradient(at: model, input) { model, input in model.applied(to: input) } print(𝛁model) // Model.TangentVector(w: 2.0, b: 1.0) print(𝛁input) // 4.0 Beyond derivatives, the Swift for TensorFlow project comes with a sophisticated toolchain to make users more productive. You can run Swift interactively in a Jupyter notebook, and get helpful autocomplete suggestions to help you explore the massive API surface of a modern deep learning library. You can get started right in your browser in seconds! Migrating to Swift for TensorFlow is really easy thanks to Swift's powerful Python integration. You can incrementally migrate your Python code over (or continue to use your favorite Python libraries), because you can easily call your favorite Python library with a familiar syntax: import TensorFlow import Python let np = Python.import("numpy") let array = np.arange(100).reshape(10, 10) // Create a 10x10 numpy array. let tensor = Tensor<Float>(numpy: array) // Seamless integration! Documentation Beware: the project is moving very quickly, and thus some of these documents are slightly out of date as compared to the current state-of-the-art. Overview Document Last Updated Status Why Swift for TensorFlow? April 2018 Current Swift for TensorFlow Design Overview April 2018 Outdated Supported Backends May 2020 Current Technology deep dive The Swift for TensorFlow project builds on top of powerful theoretical foundations. For insight into some of the underlying technologies, check out the following documentation. Document Last Updated Status Swif
Read the full README on GitHub

What Hacker News says

59 sources
I remember several years ago when differentiable programming was an object of interest to the programming community and Lattner was trying to make Swift for Tensorflow happen[1]. I'm of the opinion that it was ahead of its time: Swift hadn't (and still hasn't) made enough progress on Linux support for it to be taken seriously as a language for writing anything that isn't associated with Apple. However, as a result, Swift now has language-level differentiability in its compiler. I'd love to see Swift get used for projects like this, but I suppose the reality of the matter is that there are so many performant runtimes for 2D/3D physics that there just isn't much of a need for automatic differentiation (and its overhead) to solve these problems. The tooling nerd in me thinks this stuff is fascinating. https://github.com/tensorflow/swift
In Designing bridge trusses with Pytorch autograd
Neat! This may have not been well known when they kicked off the project and wrote their reasoning. Here is what they had to say about Scala at the time of the document linked up-thread[0]: "Java / C# / Scala (and other OOP languages with pervasive dynamic dispatch): These languages share most of the static analysis problems as Python: their primary abstraction features (classes and interfaces) are built on highly dynamic constructs, which means that static analysis of Tensor operations depends on "best effort" techniques like alias analysis and class hierarchy analysis. Further, because they are pervasively reference-based, it is difficult to reliably disambiguate pointer aliases." If they were wrong about that, or if the state of the art has progressed in the meantime, that's great! You may well be right that Scala would be a good / the
Read the rest
best choice if they started the project today. [0]: https://github.com/tensorflow/swift/blob/main/docs/WhySwiftF...
In Swift for TensorFlow Shuts Down
> Having a half way decent type system solves so many problems What problems does it solve for you? When building ML applications I mean. Because that's what S4TF was supposed to be. ML researchers produce models that are used by ML applications for a particular purpose. The code to train the model _could_ be statically typed, sure, but I really don't see what the improvement would be. It would be more verbose, less readable, have significantly more noise. Just try reading some TensorFlow C++ code equivalents of their Python API. From the "WhySwiftForTensorFlow.md" document (https://github.com/tensorflow/swift/blob/main/docs/WhySwiftF...): .. static types: * can catch bugs at compile time instead of runtime. People get very frustrated when a silly type error brings down a long training run hours into it. * directly improve tooling experie
Read the rest
nce like code completion/intellisense, jump to definition, etc. * make it easy to know what operations are Tensor operations. > can catch bugs at compile time instead of runtime. OK, but what bugs? For most use cases of TensorFlow that I've seen, if there is a type error somewhere, you will catch it long before it hits production, and if you only catch it 100hr into training, your training code is either non-deterministic or there's some other issue that is not type related. Unless we're talking about dependent types a-la Idris, I don't see how Swift's type system can help catch these kinds of bugs. > directly improve tooling experience like code completion/intellisense Sure, but type-hints provide the same improved experience with language servers like PyLance [0]. Not a reason to jump to a new language. > make it easy to know what operations are Tensor operations. Easy. Anything that starts with "tf." is a tensor operation. Yes, I'm being a bit trite, but I was never convinced by the premise of S4TF, because I've never heard an ML researcher or engineer say "static typing will fix my problems". [0]: https://devblogs.microsoft.com/python/announcing-pylance-fas...
In Swift for TensorFlow Shuts Down
TF's own analysis[0] was hesitant on static vs dynamic, finding downsides for either choice and suggested choosing a "middle ground" (which IMHO was doable starting from Julia's optional types). So static typing might be your requirement, but it wasn't TF's requirement. When examining Julia later on, they don't mention dynamic types as a downside at all - and every argument save for "we're familiar with Swift's internal working" was contradicted within the same document... Now, being familiar with Swift is a very understandable reason for their choice, but it's IMHO not the best choice for others which are not as familiar with Swift or ML. Most ML users are very familiar with Python and I think they will find Julia to be a welcome improvement on Python's pain points without Swift's baggage. [0] https://github.com/tensorflow/swift/blob/mas
Read the rest
In Swift for TensorFlow – A system for deep learning and differentiable computing
>Who would want to use an Apple-centric language for ML, seriously? Apple hardware is outright incompatible Based on how you wrote your comment, I'm guessing you may not know this S4TF is a Google initiative. Yes, Chris Lattner used to work for Apple but he was at Google Brain during the start of this project. When his team wanted to create a language where automatic differentiation and gradient descent was a 1st-class concept in the core syntax (i.e. without libraries) of the programming language , they looked at Rust, Julia, Swift, etc[1]. They ended up choosing Swift as the base language to extend with new ML syntax. Also, Chris has said in previous interviews that he thought of Swift as general purpose language and that hoped it would be used outside of Apple's ecosystem. EDIT to address the confusion where some assume Apple hardwa
Read the rest
re dictates the direction of S4TF: For those not aware, Google's hardware TPU (Tensor Processing Unit)[2] is built with custom ASIC chips and not ARM nor Apple Silicon chips. Presumably, S4TF would run natively against Google's TPU. In other words, the goals and execution targets of S4TF are not restricted by Apple's ecosystem of macOS/iOS/Macbooks/iMacs/iPads in any way. Yes, the SwiftUI framework is Apple-specific but Swift-the-core-language-syntax[3] is not. [to downvoters: if I wrote inaccuracies, please correct me.] [1] https://github.com/tensorflow/swift/blob/master/docs/WhySwif... [2] https://en.wikipedia.org/wiki/Tensor_Processing_Unit [3] https://docs.swift.org/swift-book/ReferenceManual/zzSummaryO...
In Swift for TensorFlow – A system for deep learning and differentiable computing
They’re looking to build demand over time by making Swift available in as many places as possible. And this is the Swift Open Source team, not Apple specifically. It’s not an Apple business decision (aside from lowering the learning hurdle for new iOS projects) Not to mention there’s Swift for TensorFlow, would be nice if you could handle your code locally on a Windows machine: https://github.com/tensorflow/swift/blob/master/docs/WhySwif...
In Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

Showing the 15 most recent of 59 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.