This year I decided I wanted to start playing with Swift again. I decided to write a small back-end project with Vapor and everything's going well. However, I needed a way to add functionality at runtime so I wouldn't have to recompile my project everytime I wanted to change something. This resulted in a small library for managing plugins (which are just dynamic libraries).
(docs are here: Documentation)
It was very fun writing this library. It uses macros (finally!!!) so you can easily write plugins.
The library does everything you'd expect: it loads, unloads and reloads plugins. You communicate with them by using an API based on Node.js's EventEmitter, except it's way prettier. It also has some security features, such as checking the MD5 hash of the plugin.
It's great to see how the Swift ecossystem is evolving. Swift-DoCC is amazing, support for Linux is even better nowadays, the language feels more "stable", etc. And swift-mmio? That's a game changer. 2024 is the year of Swift!