State of IDE tooling and creating beginner guides

Lately I've been really interested in getting into swift since it looks like it's a language with a great design and few compromises in terms of speed and ease of development. Here is my perspective as a newcomer. Feel free to correct me:

  • I've been surprised to find that it's hard to get information on how to get started.
  • In OSX the swift version is tied to XCode and the language to Cocoa framework which makes me question if the language can ever truly stand on its own without apple
  • In linux you either need CLion (trial version or EAP) or Visual Studio Code (with most tutorials telling you to install the sourcekit-lsp from the command line). Hardly beginner friendly.

In my perspective, for a healthy ecosystem we would need the following things:

  • Official getting started guide with Linux in Visual Studio Code and CLion
  • Official getting started guide on Windows with Visual Studio Code + swift in WSL (I haven't manged to make the code linting work and there's no tutorials).
  • For the future: Make server side programming independent of Apple and apple related tooling.
  • Nice to have: Intellij IDEA plugin for swift so we can have a cross platform Jetbrains IDE for server side programming + official guides on setting up Visual Studio Code on all three platforms (using WSL on windows).
  • ???: Apple independent package manager (conda as suggested here https://www.fast.ai/2019/01/10/swift-numerics/?)
3 Likes

It feels like most complaints could be solved by making sourcekit-lsp better

Have you seen "Getting started" link on the left side of swift.org? Do you find it insufficient? I suppose apple should add a link to sourcekit-lsp project somewhere in there...

I think you can set up Xcode to use a different swift toolchain than the one built in. Anyway, isn't c++ version also tied to Xcode on OSX? It does extremely well on other platforms

In what way is it tied? Swift works on linux with zero Cocoa

You could also use other IDEs/text editors that implement LSP, but as far as I can tell vscode is the best.

It would be nice if you could install it from Extension Marketplace. I wonder why isn't it published yet.

Have you seen this page? It's just about setting sourcekit-lsp. Do you think we should move it directly to swift.org, or add more info to it? What kind of info?

As far as I can tell there are no closed source libraries used in swift for linux, and lack of apple dependent tooling is being solved with sourcekit-lsp.

I searched the plugins.jetbrains.org and found one https://plugins.jetbrains.com/plugin/10209-lsp-support Have you tried it with sourcekit-lsp? What was your experience?

I agree that SPM isn't good, but how divorcing it from apple would help? It's already open source.

@elhoov sourcekit-lsp is going to bundle with the swift toolchain in the future, and after publishing VSCode Extension you'll need only to download the swift and VScode extension only.

I'm still dipping my toes in the framework so some of what I say might have been wrong.

Have you seen getting-started/ link on the left side of swift org? Do you find it insufficient?

Well, it is sufficient to install swift, but I'd like to see a section about setting up the most popular tools. At a minimum Visual Studio Code.

In what way is it tied? Swift works on linux with zero Cocoa

From my limited experience you need to use Foundation for a lot of things that should be standard library making the code not portable. Maybe it has nothing to do with Cocoa, I've never programmed OSX so forgive me if I'm using the terms wrong.

Have you seen github com/apple/sourcekit-lsp/tree/master/Editors? It's just about setting sourcekit-lsp

I have seen it, but only because I've been looking a lot into it the last few days. AFAIK there's no link in www.swift.org. Better yet, the whole tutorial should be in swift.org instead of/as well as github. Furthermore one of the points that I can't stress enough how much that would improve things would be an explanation of how to set sourcekit-lsp for visual studio code with WSL. This would lower the barrier of entry a lot as you could immediately start using windows as a development environment for swift when your target is linux.

I searched the plugins.jetbrains.org/ and found one plugins.jetbrains com/plugin/10209-lsp-support Have you tried it with sourcekit-lsp? What was your experience?

Honestly I did not know that plugin existed. I guess it's something, but if I want to use lsp I think the experience with Visual Studio Code would be a lot more painless to set up. I was thinking more about putting some pressure on Jetbrains to make them release their CLion Swift plugin for intellij IDEA so you can use it with community edition and have some healthy competition between that and visual studio code with sourcekit.

I agree that SPM isn't good, but how divorcing it from apple would help? It's already open source.

Well best case scenario when Swift is more mature we'd get an influx of users from python interested i checking it out (especially if swift for tensorflow gets finished). If it's as easy as doing conda install swift, then install all the dependencies with conda which they are used to doing that would be amazing. If they need to download and install everything manually, configure the editor manually, then learn a new package manager on top of that then I suspect a lot of people won't bother and it will hurt adoption.

That and the ability to install it in a remote WSL connection in VS code would be a huge step forward in my opinion.

That could be true (though anecdotally I use packages from github most of the time). Still, corelib-foundation comes with Swift right off the bat. So I don't see how it is a problem.

This is little to do with SPM, but rather how to install Swift itself, which you've explained already.

That's interesting. Anyhow, what you want isn't an Apple independent PM, you want "Swift support for existing PM" which are different things, and the distinction could be important here.

Foundation is part of the swift project and is actively being worked on for feature parity on Linux, Windows, and android. Could you please elaborate on what the exact concern here is? Its just another library, one which would usually be bundled with the rest of the Swift stack.

Anyhow, what you want isn't an Apple independent PM , you want "Swift support for existing PM" which are different things, and the distinction could be important here.

Fair point. If an existing tool solves a problem well already and it's something a lot of new swift developers are already familiar with then win-win.

Sounds like the concern was a misunderstanding and/or lack of knowledge that the project was going in that direction.

I do agree that trying Swift without Xcode is very far from a streamlined experience and that idiot-proof (I often enter idiot mode when trying things out myself) guides for other environments is a necessary tool for acceptance outside Apple platforms.