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

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 ⟶

Refactoring RxJS Code in Angular


Do you work with legacy RxJS code? Have you ever revisited your first few observables in your application? Do you need to fix bugs in an app of your learning phase? Are you still learning best practices for writing reactive code? This guide is for you. Even if you don’t have anything to do with Angular, you may find this interesting. I will show you a way of how to improve your reactive streams in order to understand their functionality in many isolated, but tiny steps.…
Read more ⟶

Never miss a dismiss in Ionic anymore


Have you ever experienced, that some loading indicators just don’t want to dismiss and literally stay forever? Maybe while users tried to login? The short story: you probably forgot to dismiss a loading indicator in some cases. Within this blogpost you will learn how to declaratively present loading indicators and how to prevent forgetting to dismissing it again. In our showcase we have a login page, that shall present a loading indicator while the user will be authenticated.…
Read more ⟶

CommandMine


Command mine is a concept of a swift library for parsing command line arguments. It is designed to support asynchronous implementations of CLIS, that may even be used inside frameworks. Definitions CommandMine is about extracting minerals out of your ore. let goldmine = Mine<Gold>() // declare your mine .drift( // One way to get to your gold named: "init", digging drift: Drift, // Prepares your Shaft to shaft: execute // your actual program ) Shaft A protocol describing factories of Rails.…
Read more ⟶