9 ms·
VSCode Swift 1.0
- d12bb 4y agoI wonder how big the market is for this. Despite being an actually nice language, Swift is not that popular outside Apple's ecosystem, so I guess most developers would use XCode for it's integration (with Apple Developer, SwiftUI/preview etc).
- ianbutler 4y agoI am more likely to try Swift, if I can use it in my existing tools. So maybe the play is to make it more popular.
- kitsunesoba 4y agoSlowly but surely things are getting better in terms of cross-platform, with the latest in that realm being Apple itself committing to an open source rewrite of Foundation, which will fill in some holes and improve consistency on non-apple platforms. Swift on server has been usable for a while now too. I think the next big bottleneck on popularity will be tooling, and a solid VS Code extension is a small step forward in addressing that issue. As someone who’s been using Swift for years on iOS/macOS, I’d love to use it for desktop development on Windows and Linux. I think the language is well suited for that purpose, and it strikes a nice balance between safety, speed, features, ease of writing, and clean syntax which isn’t matched by too many other languages.
- isodev 4y agoThe use case is mainly for writing packages, command line tools or server side components where the Swift toolchains are quite nice to work with. The experience is very much like using Rust or Go.
- n0us 4y agoFor me XCode is just so so bad for actual code editing so I edit the code in VSCode and run it through XCode
- russellbeattie 4y agoI agree. I personally find XCode absolutely bewildering. The several times I've tried to do anything with it, I just gave up and found an alternative. My guess is that if you've been using Apple tools for years, then it makes sense, but to me it's indecipherable. The menu options don't seem to match with the GUI, resource views don't seem to match the files, random panels appear with unnecessary information, resources are needed for unclear reasons and more. It's all very Apple, but in the worst way possible. It's like the IDE version of AppleScript - seemingly useable but based on a logic which totally escapes me.
- adenozine 4y agoIt’s such a shame, i really envy some of the features in Swift but I just can’t justify the risk with how Apple-centric it is. Too many times I’ve been bitten by ducks that quacked just like that one, I suppose. I’d love to see like a gccSwift the way there’a a gccRust coming together. I think that would be really cool.
- tomashubelbauer 4y agoI don't think XCode is exactly popular or viewed as anything other than necessary evil by many Swift app developers. Like a sibling comment mentioned, many people already use other IDEs to write the code and just use XCode to compile stuff because it is just so ass. Get the compiler invocation experience and maybe even the Apple Developer integration to a decent enough shape in a VS Code extension and XCode can start counting its days methinks.
- jalino23 4y agothis is what I do with visual studio for unreal engine as well. I only use it to compile and edit my code with helix
- yakubin 4y agoI’ve only started learning Swift, so I don’t know how it performs on bigger projects, but so far I’ve been loving playgrounds, if not for the dog-slow compilation, but that’s in-character for all LLVM-based compilers, so maybe not exactly XCode’s fault.
- alexashka 4y ago> many people already use other IDEs to write the code and just use XCode to compile stuff If by many, you mean less than 1%, then yes. :)
- marcellus23 4y ago> many people already use other IDEs to write the code and just use XCode to compile stuff I've never met anyone who actually does this. JetBrains is even discontinuing AppCode, which as far as I know was the only real alternative IDE (and it had a lot of holes in its functionality). Xcode lacks decent refactoring tools but otherwise it's a perfectly fine IDE, and has some really powerful debugging abilities. Don't get me wrong, I don't think Apple is giving it the attention it deserves, but in my experience most people hate it just because it isn't IntelliJ or VSCode.
- comprev 4y agoDevelopers rarely use XCode out of choice, at least from the iOS devs I know. It also opens up the potential for development on non-Apple equipment if the CI can handle builds.
- akmarinov 4y agoYou can already develop Swift code on non-Apple equipment You can’t develop for iOS as their frameworks are as of now (this is changing, they’re rewriting Foundation) tied to macOS, so this doesn’t change much
- mrtksn 4y agoWell, with WASM everywhere I think that it might realize some of its potential as tooling improves. Don't you want to write your algorithms and data structures in such a nice language? Slap the native UI, when in iOS its SwiftUI and when on the web its ReactJS or something and when its on Android its whatever Android uses but have your actual processing of the user inputs in Swift. The traditional cross platform approach is to write it in JS and use the native UI framework API, which works but its not native anywhere and you have to write JS. So instead of doing that, you can start with Apple platforms and port to the other platform where porting would mean just UI and device specific API implementation as the Swift can be portable. You wouldn't be trying to build native UI with Swift but you would use the Swift code as a service which handles everything except the UI where the UI implementation will communicate with your Swift code. The advantages are: 1) Working with Swift, which is pleasant to work with. 2) Apple's all platforms are on the same architecture and as a result, running your code for mobile on your dev machine works at full speed. This means, even the cheapest Apple Silicon device provides great performance on your workflow. No more sluggish emulators. 3) Preserve the data structures across all platforms and these data structures are not JS data structures. You have integers for example :). Categories of bugs and work to make things fit vanish.
- lockhouse 4y agoFun fact, Swift is actually available in Fedora Linux’s default repos. It’s just “dnf install swift” and you’re all set. I would love to see more Swift adoption, I know at one point IBM was investing in it for server-side programming, but I think they’ve abandoned that. It seems to be a nice sweet spot of relatively easy to code, expressive, powerful, memory safe, and performant.
- galoisscobi 4y agoMy brain and fingers hurt using the vim keybindings in Xcode. Looking forward to trying this extension out in VSCode which has far superior vim keybindings.
- zefhous 4y agoThe vim keybindings that Xcode has implemented work fine for me, but some omissions like using the period character to repeat the last action are quite debilitating.
- wiseowise 4y agoGood. Wish something like that existed for Kotlin. And no, being locked into Intellij ecosystem is not the same.
- doerig 4y agoLink to the VSCode extension: https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang https://marketplace.visualstudio.com/items?itemName=sswg.swi...
- arunc 4y agoDoes anyone know of any reliable VSCode extension for Kotlin (Android or server side)?
- drewbitt 4y agohttps://github.com/fwcd/vscode-kotlin https://github.com/fwcd/vscode-kotlin uses the maintained Kotlin Language Server but it’s not perfect. There’s nothing on par with Jetbrains out there
- pjmlp 4y agoGiven that JetBrains officially stated they also want Kotlin to help drive InteliJ licenses, and removed support from Eclipse plugin, don't expect too much on that front.
- msie 4y agoStill trying to learn swift. My impression is that it’s an ugly language designed by committee (largeness and some extraneous features like guard) and part of the reason why the compiler is slow and why xcode has problems with slow syntax checking sometimes.
- danpalmer 4y agoThat's not really my impression at all. I see it as a fairly opinionated language that has taken a lot of inspiration from Ruby and Haskell. Things like strings are strongly opinionated and have gone through multiple revisions to get them to where they are. One of the opinions is that it values expressiveness, and having multiple ways to do things that means you can choose a nice way to express each line, rather than always being forced to write it the same way. This is a trade-off. To use `guard` as an example, sometimes it may be clearer to use a guard, and sometimes it may not. Swift has chosen to provide both options, at the cost of users needing to learn both. I think it developed a negative reputation for the fact that the first few iterations did have a lot of breaking changes and added a lot of features. This made sense to me, the first version was somewhat of an MVP and it needed plenty of work still, but the language is relatively mature now and has stabilised significantly in recent years. The compiler isn't generally that slow overall, but there are performance edge cases where complex type-checking can take far longer than other things. If you're having problems with speed, I'd recommend profiling your build, it's possible there are a handful of functions that are taking most of the build time.
- thewebcount 4y ago> If you're having problems with speed, I'd recommend profiling your build, it's possible there are a handful of functions that are taking most of the build time. How does one do that? I hit this problem a lot. (I’ve since learned to use lots of explicit casts to make it less bad.)
- danpalmer 4y agoI can't remember exactly, it's been a year since I last did this. I believe there's a setting for the threshold at which this should be logged, so you could set it to log any expression that takes more than 100ms to type-check. By default I think it just times out at 10 seconds or something.
- dep_b 4y agoStuff I really miss from Xcode: * Smarter refactoring like "extract protocol" * Detection of unused imports and dead code Both things the original Visual Studio had over a decade ago. I think the new generics system is finally making the language more usable for the typical scenarios I like to tackle with it. What still baffles me is that it's impossible to create protocols that have stuff like @Published in them. Massively decreases / complicates / uglifies reusability opportunities in ViewModels.
- Terretta 4y agoLink 1: It's out of preview. Link 2: It has release notes with no new information. Link 3: Available here: https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang https://marketplace.visualstudio.com/items?itemName=sswg.swi...
- mhaberl 4y agoFunny how things sometimes overlap, JetBrains dumps support for Swift [1], and a month later VSCode gets the production ready plugin. [1] https://news.ycombinator.com/item?id=33994406 https://news.ycombinator.com/item?id=33994406
- drewbitt 4y agoAnd in December an effort was started to get Copilot in Xcode[1] when it was previously limited to only in Jetbrains AppCode. Now we have two options for Swift Copilot. [1] https://github.com/intitni/CopilotForXcode https://github.com/intitni/CopilotForXcode
- crossroadsguy 4y agoI wish there is something like this for Kotlin and Android development. One of these I might Android development just because of the shit its development and build environment is — Android Studio, Gradle etc. What a glorious mess!
- SebastianKra 4y agoUnfortunately, it took me some digging to realise that this extension is primarily built for packages, not XCode-managed .xcodeproj projects [1]. This means that, unless I'm missing something, you can't open your existing project in VSCode like you could with AppCode. Overall, I'm unhappy with the tooling around Swift. The compiler is slow, the formatters and linters are worse than in the javascript-ecosystem, and since AppCode is sunset, there's only a single supported IDE which I dislike. I frequently run into issues where the compiler won't give me a useful error message until I simplify my code, and the SwiftUI previews don't seem to work at all. [1]: https://github.com/swift-server/vscode-swift/issues/128#issuecomment-1028954332 https://github.com/swift-server/vscode-swift/issues/128#issu...