News for hackers. Stuff that matters.
Re:Swift Server Work Group Annual Update by echelon on Thursday October 31, 2019 @03:23PM (#21412604)
> This idea that for Swift to thrive as a server language it has to win some contest against Go and Rust makes absolutely no sense to me.

That's not the point! It's that engineers have to use Mac machines to develop Swift because they're tied to a development platform. Go and Rust (simply called out as nearest neighbors) do not have this limitation. Even Microsoft has made great progress in making their tools available on other platforms.

It would be foolish to choose Swift for this reason. You're tied to Mac machines until it's been proven other platforms will have full support. It's a real handicap for Swift as a language and platform for anything beyond writing Apple software.

Re:Swift Server Work Group Annual Update by wlesieutre on Thursday October 31, 2019 @03:37PM (#21412748)
The language server runs on linux and works with VS Code. Is there something in particular you're missing?

You don't have XCode on linux, but I've never heard of someone being disappointed about that.

And does Apple have to be the source of all tooling? Is that how it is for Rust and Go? It's certainly not for Javascript and Python tools.

Re:Swift Server Work Group Annual Update by Tainnor on Thursday October 31, 2019 @04:23PM (#21413315)
I can't even get sourcekit-lsp running without errors.

"failed to create SwiftPMWorkspace: could not find executable for 'xcrun'"

Until such time as there is a working installer that is as simple as "download XCode from the app store", I don't really consider that to be an alternative. I certainly can't recommend it to anyone on my team.

Re:Swift Server Work Group Annual Update by mickael on Friday November 01, 2019 @03:14AM (#21416796)
Re:Swift Server Work Group Annual Update by Razengan on Thursday October 31, 2019 @03:27PM (#21412648)
> It's that engineers have to use Mac machines to develop Swift

That is patently untrue.

Re:Swift Server Work Group Annual Update by Tainnor on Thursday October 31, 2019 @03:37PM (#21412747)
As it's written, this is untrue. You don't need a Mac to develop Swift. However, you really ought to have one, because the development experience is subpar on Linux:

- there is no free IDE (XCode is only for macOS, and CLion costs money - plus, it has its own bugs)

- a lot of tips and tricks on the internet (e.g. about profiling your application, etc.) heavily rely on XCode. Actually, even Apple's own documentation usually references XCode settings (or other apple tools) instead of exposing a good cross-platform interface

- the code just behaves differently on Linux than it does on the Mac (especially with Foundation)

Re:Swift Server Work Group Annual Update by scarface74 on Thursday October 31, 2019 @03:43PM (#21412839)
This is server side Swift. It supports the LSP and is supported by Visual Studio Code.
Re:Swift Server Work Group Annual Update by Tainnor on Thursday October 31, 2019 @04:24PM (#21413334)
Apart from the fact that you ignored the other two arguments I made, the LSP is not production ready. It even says so on its very own github page: https://github.com/apple/sourcekit-lsp#status
Re:Swift Server Work Group Annual Update by scarface74 on Thursday October 31, 2019 @04:28PM (#21413376)
The XCode profiling is mostly for iOS apps - not server side code. You wouldn’t really be better off using a Mac for profiling server side code.

And what server side code “behaves differently”

Where does it say it’s not “production ready” on the GitHub link?

Re:Swift Server Work Group Annual Update by Redoubts on Thursday October 31, 2019 @06:11PM (#21414297)
> Behaves differently

For me, lots of string and substring operations throw NotImplemented exceptions on Linux, when they just work on Mac. This kinda sucks because there’s no compiletime or linttime warning for this.

Re:Swift Server Work Group Annual Update by saagarjha on Thursday October 31, 2019 @06:01PM (#21414193)
> The XCode profiling is mostly for iOS apps - not server side code. You wouldn’t really be better off using a Mac for profiling server side code.

Instruments, which ships with Xcode, is quite powerful.

Re:Swift Server Work Group Annual Update by badrequest on Thursday October 31, 2019 @05:03PM (#21413693)
Your response to "there's no good tools for profiling Swift apps on Linux" is "you only want to do that for iOS apps anyway?" I profile server code all the time, it's simply unacceptable to think I'd ever use a language that didn't facilitate it. Go does (https://blog.golang.org/profiling-go-programs). I've not used Rust, so I can't speak to that.
Re:Swift Server Work Group Annual Update by scarface74 on Thursday October 31, 2019 @05:07PM (#21413720)
You mentioned specific profiling in XCode and how that makes it necessary for server development. XCode doesn’t have much of any profiling that would be beneficial to server development - the entire topic of the submission.
Re:Swift Server Work Group Annual Update by Eric_WVGG on Thursday October 31, 2019 @05:06PM (#21413719)
> And what server side code “behaves differently” [mean]

Spend a bit of time on the Vapor Discord channel and read about all the quirks Linux users have to deal with that the rest of us don’t.

(My impression is that it’s due to Foundation libs.)

Re:Swift Server Work Group Annual Update by scarface74 on Thursday October 31, 2019 @05:08PM (#21413726)
So instead of a specific example you want us to go to a random discourse channel?
Re:Swift Server Work Group Annual Update by veidr on Thursday October 31, 2019 @06:24PM (#21414406)
But that _is_ true: the Foundation library — which because Swift has a super small core library is really kind of critical to basically any kind of program — behaves differently on Linux.

I write Swift code that runs on Linux and also on macOS or iOS, and we frequently have to have sections of "if Linux, run this code, else run this other code".

And while that's trivial to write, it's not trivial to find all the places where you have to do that.

(Nevertheless, I like Swift a lot and am using it on Linux.)

Re:Swift Server Work Group Annual Update by pjmlp on Thursday October 31, 2019 @04:25PM (#21413348)
On Ubuntu...