Blog posts about programming languages, Swift, Go and more by me.

Swift, VS Code and you


Editors like Visual Studio Code live from a wide range of extensions and customization. In contrast there are IDEs like Xcode and AppCode, which have everything set up and are ready to go. In order to provide a rich set of features, they cannot not offer the same level of flexibility. Which editor you might want to use is a highly personal decision. Disclaimer: I am the maintainer of the extensions Maintained Swift Development Environment, sourcekite, SwiftLint, SwiftFormat, apple-swift-format.…
Read more ⟶

Debugging Swift in VS Code the old way


Running and debugging your targets in Visual Studio Code is not prepared by default. Especially for us Swift developers this might come unexpected, especially in comparison to Xcode. In VS Code we require extensions and configs for this purpose. Update from 2022: the Swift Server Work Group released their own official VS Code extension which dramatically improves the debugging user experience. Here is the new, updated blog post. Within this blog post, we will set up debugging for a Swift Package Manager project.…
Read more ⟶

InferIt: a Constraint Solving Package Manager


The initial idea behind InferIt was to create some mixture of a constraint solver and a dependency manager: you would just tell it what to install and it would gather as much information as possible to install it. The goal is to fulfill a requirement. InferIt would then try to resolve all variables by trying to fulfill several requirements. If a requirement has been met, the value can be propagated.…
Read more ⟶

ReactifSwift: async function composition


Async operators debounce, throttle or delay that functional reactive programming libraries as RxSwift and ReactiveSwift provide are super useful and expressive. Though their biggest benefit lays within composability. This playground tries to achieve the same using plain functions with little help of a global scheduler for a greater testing experience. For better composability it relies on Overture in version 0.2.0. Originally written at 2018-06-10 Example var count = 0 let countChars = with({ count += $0 }, pipe( map(get(\String.…
Read more ⟶

Swifducks: simple Redux store with multiple reducers


A simple example implementation of the Redux pattern with multiple reducers and listeners. The name is derived from Swift + Redux = 🏎🦆 Originally written at 2018-06-10 Definitions public final class Store<State, Action> { public typealias Reducer = (Action, inout State) -> Void public private(set) var state: State private var reducers: [Reducer] = [] private var callbacks: [Weak<Listener<State>>] = [] public init(initial state: State) { self.state = state } public func select(_ changes: @escaping (State) -> Void) -> Any { let subscription = Listener(on: changes) callbacks.…
Read more ⟶

Archery 0.3.0 released


Archery is about doing something with your project’s metadata. The new version 0.3.0 puts everything on steroids and allows you to script your metadata. A detailed overview of all changes can be found on GitHub. Archerfile Loaders At first you will notice the new option to load additional contents into your Archerfile an incredibly open field of new possibilities. The most obvious use case is to collect metadata from multiple configuration files.…
Read more ⟶

SDE 2.7.0 released


Today I released the new 2.7.0 update to SDE for VS Code and the companion project sourcekite has been updated, too. The new sourcekite 0.5.0 now supports Swift 5, but drops support for Swift 3. If you still need support for Swift 3.1, I also tagged 0.4.2. Since 2.6.0, SDE already supported Apple‘s official sourcekit-lsp by using the "sde.languageServerMode": "langserver" and the swift.languageServerPath setting. As announced in Apples SourceKit-LSP and SDE Roadmap SDE 2.…
Read more ⟶

Apple’s SourceKit LSP and SDE Roadmap


Apple recently announced to develop a language server for Swift and C-family languages. Or said more clearly: Apple started development to support every editor implementing the language server protocol like VS Code, Sublime Text, Jet Brains‘ IDEs and Atom. Later they published the source code in GitHub including support for VS Code and Sublime Text. It will work on Linux but is currently limited to Swift snapshots and the VS Code extension hasn’t been published yet.…
Read more ⟶

Thoughts on: Elegant Objects


Writing things down is part of my learning process. These thoughts came up while reading through Yegor Bugayenko’s book Elegant Objects about a more declarative and less procedural approach of object oriented programming. This is more a personal document than a book review or summary and as I already knew some topics, I do not mention several chapters or details, I might explain concepts different than the original author and many examples from Java, Ruby or C++ cannot be applied to Swift as they would already solve the issue.…
Read more ⟶

ArgumentOverture


A Swift Playground aiming to provide some functional helpers to parse arguments for command line tools. It uses Overture and is build for high composability, flexibility and little impact on your project’s freedom to evolve. A central use case was Archery’s: only actually interpreted arguments shall be consumed. Any others shall be collected (remaining) or should prevent execution (exhaust), depending on the current command. First of all an example usage.…
Read more ⟶