Live data from Hacker News

Swift Static Linux SDK

swift.org

101–110 of 274 posts

Re: Swift Static Linux SDK

#101
post #70

Earlier quoted context omitted.

I haven't used it yet, but I've heard really good things about Vapor as far as server side Swift goes... https://vapor.codes

Thanks. What is a "protocol server?"

Not a super-expert but I've used Vapor on some personal projects. Do you have a link to the mention for "protocol server"? I'm not familiar with the concept but might be able to help.

Re: Swift Static Linux SDK

#102

Swift 6 is amazing - I say this as a big Rust person. It seems like Swift is now its own entity outside the Apple bubble and has a few very interesting features: - An "embedded" mode that turns off reflection for kilobyte-sized binaries - An upcoming WASM target - An LSP for VSCode - Native C++ interop - Typed "throws" - Static linking on linux and the linux sdk - Porting a number of "core foundation" / foundation pr…

Given there is native C++ interop, is exporting a C ABI still a seemingly experimental/niche feature? Same question with interop between C and Swift. Recently went with using Kotlin Native over Swift on macOS for this reason, the C ABI export and C interop were painless.

Swift has painless interop with Objective-C, which is just C plus small talk.

C should already be pretty easy, though I haven’t really used it myself. I only use the Objective-C stuff.

I know they’ve been working on C++ but don’t have any experience to comment. Someone else had a nice comment listing resources on that.

Re: Swift Static Linux SDK

#103
post #19

Earlier quoted context omitted.

How’s the compilation speed?If it’s going to replace Go, that’s gotta be sub second for a medium sized project on my clunky old laptop.

Why, would you care if it's a full second or even 5 seconds? Go hyped their compilation speed a lot in its early years, but unless it's C++ templates level slugginess it's not like it's that big of deal.

Once you use a language where compile times are essentially invisible, it’s hard to go back.

Re: Swift Static Linux SDK

#104

Swift tooling has some really! Sharp! Edges!!! If you need something quick and easier than rust or have some reason to want to take your swift code and run it elsewhere I guess this is good but I don't see why you'd use it besides that.

Could you elaborate?

Re: Swift Static Linux SDK

#105
post #81

Swift 6 is amazing - I say this as a big Rust person. It seems like Swift is now its own entity outside the Apple bubble and has a few very interesting features: - An "embedded" mode that turns off reflection for kilobyte-sized binaries - An upcoming WASM target - An LSP for VSCode - Native C++ interop - Typed "throws" - Static linking on linux and the linux sdk - Porting a number of "core foundation" / foundation pr…

> - No garbage collector ARC is a GC, and a slower one than most traditional tracing GC's.

Reference counting and garbage collection are different.

They’re both forms automatic memory management, but they work in very different ways.

Re: Swift Static Linux SDK

#106
post #91

Swift could've easily replaced python. but the language got complex and is now a baby C++.

Those are pretty different languages. One you just run as a script with no compilation and no static typing, the other is fully compiled and linked into a binary. How could they replace each other?

And what’s the complexity now that even remotely approaches c++?

Re: Swift Static Linux SDK

#107
post #85

Earlier quoted context omitted.

I had my Python and pip installed from distribution packages. One day I needed to build something from source, but it needed Meson... Ok installed Meson also from my distro packages! But no, the project required a newer Meson version. Ok let's install Meson with pip! But no, it turns out pip packages themselves can require a minimum pip version !! Go figure. So I couldn't build that program without first pip-installi…

Were you using a virtualenv? Or were you pip installing into your distro / system python, like a true savage?

I just knew the basics. So I was just following commands from stack overflow or similar. Silly me, thinking that it would work logically like other languages do! Later I ended up learning about all that stuff with venvs and whatnot, not to mention it's not even a unified solution but there are multiple alternatives, adding to the confusion... All this, no doubt, is a consequence of how terrible the Python packaging story is. Rust, Go, Ruby, Node, and more, I had used without remotely similar hassles.

Re: Swift Static Linux SDK

#108
post #26

Earlier quoted context omitted.

Some distros do actually break out rust dependencies into separate packages (e.g. Guix does this). It's just that a lot of rust software isn't distributed primarily by distros.

Fedora and Debian do this too. That's why it sometimes takes longer for a project to be packaged - you literally have to recursively package all of the dependencies first.

> Fedora and Debian do this too.

IIRC Arch does as well (or at least tries to).

Re: Swift Static Linux SDK

#109
post #68

This static SDK is just one example of Swift's new support for user-definable platforms, timed to amplify support for embedded and WASM. Along with the move to a non-Apple GitHub organisation, it represents real progress in extending swift to other platforms. It would be interesting to see if this is used for the AI OS that they are inviting researchers to validate for security purposes.

Wow, I had no idea people were using Swift for Embedded: https://github.com/apple/swift-embedded-examples

It's relatively new. Apple put out a WWDC session video about embedded Swift today: "Go small with Embedded Swift" https://developer.apple.com/videos/play/wwdc2024/10197/>

Re: Swift Static Linux SDK

#110

Swift tooling has some really! Sharp! Edges!!! If you need something quick and easier than rust or have some reason to want to take your swift code and run it elsewhere I guess this is good but I don't see why you'd use it besides that.

I'd love to hear some specific examples. Ive built several iOS apps and a whole backend (on linux) with Swift and other than lack of OSS library support for some SaaS APIs, it's been quite nice.

Sure Swift itself has some sharp edges, but not any more (or worse) than many other popular languages.

Post reply on HN