logoalt Hacker News

gjajrictoday at 9:02 AM4 repliesview on HN

Swift does not seem suitable for OS development, at least not as much as C or C++.[0] Swift handles by default a lot of memory by using reference counting, as I understand it, which is not always suitable for OS development.

[0]: Rust, while no longer officially experimental in the Linux kernel, does not yet have major OSs written purely in it.


Replies

astrangetoday at 10:06 AM

There's an allocation-free subset.

https://www.swift.org/get-started/embedded/

Rust's approach is overkill, I think. A lot of reference counting and stuff is just fine in a kernel.

show 1 reply
pjmlptoday at 9:28 AM

What matters is what Apple thinks, and officially it is, to the point it is explicitly written on the documentation.

show 1 reply
porneltoday at 10:40 AM

Apple is extending Swift specifically for kernel development.

saagarjhatoday at 10:05 AM

Nothing wrong with using reference counting for OS development.

show 1 reply