#SwiftNIO

2024-12-30

Books I would like to write but have no time:
- Robotic #Astronomy (actually, I do work on this)
- Server-Side #Swift with #SwiftNIO
- Astronomical Image Processing with #FITS
- Understanding Swift Macros
- Understanding Swift Concurancy
- Neuromuscular disorders - molecular pathways
- Understanding Computational Molecular Biology
- Writing Modern Unix Tools with Swift
- Designing an Exabyte File Archive
- Making Your Old House #Energy and Food Independent
- High Performance Swift

2024-11-25

Today I was asked again (N-th time) to explain #SwiftNIO

My reaction: create a Git repository called `swiftnio-book`

My hope was that either @twostraws or @dimsumthinking will create such repo before me. Well, I still hope, and would gladly do `rm -rf swiftnio-book` if they do.

Helge Heßhelge
2024-10-24

FWIW it turns out that the compilation does not break. When resolving the semver, SPM actually does consider the Swift versions a specific tag supports and will select the last that is compatible w/ the host Swift version.
E.g. when resolving in Swift 5.6, you'll get SwiftNIO 2.59.0, not the latest (Swift incompatible) 2.76.1. And on top the team backports critical security fixes to older releases. Nice!
Thanks go to @fabianfett for pointing out my misconception on this 🙈

2024-10-01

Last month I went to 2 Swift conferences and asked many #swift developers if they know anyone who is working on properly documenting #SwiftNIO.
It seams nobody that I know does this. So I am seriously considering to write a series of blogposts or even a book on the subject. Although SwiftNIO is one of the most important frameworks released by Apple, it is difficult to understand its architecture and design patterns and even more difficult to teach.

Any feedback?

Gleboneglebone
2024-09-17

findings - is not available in the iPad Swift Playgrounds (because it has C targets), and Swift.Network is not available on linux due to GCD and other Darwin-specific dependencies, so still have no solution for cross-platform web framework so far....

Helge Heßhelge
2024-09-09

doesn't seem to build w/ Swift 5.5 anymore due to some concurrency issues? 🤔 github.com/SwiftNIOExtras/swif

2024-05-16

Swift sucks at web serving… or does it?

A few weeks ago, Axel Roest published a simple web server comparison, that turned out to not be doing what it was thought to be doing. Figuring that out was a very interesting discussion that warrants a retrospective, to look at which parts were particularly helpful and which not so much.

Tangentially, I want to highlight that Axel's comparison is notable because he is interested in efficiency, not mere brute performance. The two are usually correlated but not always the same. He correctly [...]

wadetregaskis.com/swift-sucks-

Chart showing throughput (requests per second) over number of concurrent requests, for four different web servers (representing the programming languages JavaScript, PHP, Kotlin - erroneously labelled as Java on the chart - and Swift).
2024-05-12

Every time I return to coding Proxygen for Mac it kinda surprises me how awesome it is to be developing it. It ticks so many boxes for me: Mac development using AppKit, working with HTTP and networking, requires some amount of thinking and consideration of app architecture.

And it’s just so much more fun to click “Build and Run” and see the app launch on the same desktop.

And I get to use my own TestFlight build at work the following week.

So cool 🥰

#appkit #swift #swiftnio

2024-04-07

“SwiftNIO is Apple non-blocking networking library. It can be used to write either client libraries or server frameworks and works on macOS, iOS and Linux.”

#SwiftNIO #Concurrency #Programming #iOS #macOS #Linux
process-one.net/blog/swiftnio-

2024-03-04

On the plus side, I’m pleased and surprised to report that receiving an uploaded file and then doing what needs to be done with it, all within the context of a request handler, Just Works. I couldn’t find an example that does what I want (and I’ve been using server frameworks for longer than my adult children have been alive) so I was nervous. But the reason no example exists is that the code really is that trivial. Wow. Nice job! #Vapor #swift #swiftnio

Helge Heßhelge
2024-01-29

Good news everyone. I've updated Redi/S, my Redis server implementation in , to work w/ the latest .
Didn't bench against the official C implementation again, but on an M1 Mini it is ~3.5x faster than the 4.2 Swift version on the trashcan MacPro. Interesting enough it is fastest when configuring NIO to use just one thread. 🙃
github.com/NozeIO/redi-s

Helge Heßhelge
2023-11-29

@jsq @maxd @cjwirth That's something I'm also interested in. I think theoretically you should add a task to the "main task group", but I think there is no such thing? (i.e. the problem here is that you have no hook into the concurrency system?). It wouldn't give you ordering, but it would make the task structured.
This article clarified a few things for me: swiftpackageindex.com/apple/sw

Helge Heßhelge
2023-11-22

Every time I look at Swift Concurrency and I'm getting frustrated. I thought I give it another try, only to figure out that you essentially need `withDiscardingTaskGroup` ... which is only available w/ macOS 14+. I mean, FTW, is no one even playing with this? 🙂

2023-09-20

If you use or want to use gRPC Swift, I have great news for you – work for gRPC #Swift v2 is currently being planned out:

forums.swift.org/t/grpc-swift-

IMO the biggest feature is the pluggable transport. This will allow client apps on Apple platforms to not require #SwiftNIO anymore. Instead Network.framework or URLSession can be used in those cases.

Rachel Brindleyounata@tech.lgbt
2023-09-02

1. I feel seen.
2. There should be an option to select both. There are people who use Quick & Nimble, or even all three in the same codebase.

chaos.social/@fabianfett/11099

#Swift #SwiftOnServer #SwiftNIO #SwiftServer #SwiftLang

Screenshot of the Swift Server Working Group developer survey, highlighting "Do you use any libraries/frameworks/tools for testing besides XCTest?" with available answers "Yes, Nimble (https://github.com/Quick/Nimble)", "Yes, Quick (https://github.com/Quick/Quick)", "Yes, something else (please describe):". There is also one other answer, for "No, I just use XCTest" which is cut off.
"Yes, Quick" is selected.
2023-09-02

🧑‍💻⁉️ Please make your voice heard in the #Swift Server Working Group developer survey. Please do so, even if you don‘t use #SwiftOnServer today. We would love to understand your reasons.

#SwiftNIO #SwiftServer #SwiftLang

forums.swift.org/t/sswg-commun

Helge Heßhelge
2023-06-21

That's not bad GitHub.

2023-06-21

I’m excited to help move #RediStack, a #Swift #Redis client build on top of #SwiftNIO, forward.

Read about @joannis and my plans:
forums.swift.org/t/redistack-f

Helge Heßhelge
2023-04-27

A few days ago I was checking whether I could at least hack-patch async/await support into MacroExpress (ignoring the perf implications).
I.e. allowing async Middleware (`app.get { req, res in await db.persons.fetch()`).
Just that can be done, but I figured isn't that useful, because most of the API is really built around/on-top of eventloops and would require tons of locking to work in an async/await context (it currently stays on a single loop for good reasons).

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst