A DSL for Swift Package Manager

Hi everyone,

I'm trying to get a feel for the following. Personally I really like SwiftPM, yet I'm always having trouble with editing Package.swift : for some reason it takes me a lot of time to add dependencies, targets or compiler directives. Typically I need to move lines around a lot, tend to forget parenthesis (and other interpunction) and go from one very small step to another to get it to work. Error messages are usually unclear about where the actual issue is.

Now this could just be me, so I'm curious:

  • Are you experiencing similar issues? If not, any tips?
  • If you are experiencing these issues, do you believe a DSL using a SwiftUI style syntax would help? Or would you prefer more 'tool based' solutions?

If this is big enough of a problem, I'm considering writing a pitch for this.

Cheers, Maarten

5 Likes

Very good idea. Iā€˜d like to see this happening

Yes, it is quite of a burden sometimes, I've been trying to automate some of actions few years ago for local needs, but haven't had enough time to complete.

As DSL sounds appealing, I think CLI commands for management are better fit. We already have Git as reference to manage repositories. Applying similar idea to SPM tools can help more as in general it will require less manual interaction with package file. Having something like swift package add-dependency <url> -target <target-name> will simplify handling of such changes and probably will reduce interactions with Package.swift to minimum.