Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>>> I'm not convinced much could have been done about it.

Are you sure? What stops Swift with its beautiful syntax and safe optionals from becoming a systems language?



As someone who has actually tried writing a kernel in Swift, the issue is purely the runtime. While you can technically build a module without it needing to link to external Swift standard library binaries, the second you try and do anything with an array or optionals, you suddenly need to link in a 15MB behemoth that requires SIMD to even compile (at least on x64 and arm64). Porting this to bare metal is possible (and some have done it for a few microcontrollers) but its a pain in the ass.

I do love Swift and would use it for systems stuff in a heartbeat if I could, but there are also some downsides that make it pretty awkward for systems. The performance isn't always the best but it's (generally) very clear and ergonomic.


Perhaps not that that much. Swift’s arrays are refcounted. And you can’t store an array on the stack. Classes are refcounted too, but you could avoid them. It also has a bit of a runtime, and you don’t know when it will take locks or allocate (though there is work to tag functions so they can’t do either).


Nothing, that is even Apple's official wording for Swift.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: