logoalt Hacker News

dagmxtoday at 3:22 PM1 replyview on HN

I disagree that rust can be as ergonomic. I’ve been writing rust for longer than Swift , and there’s a lot of niceties in Swift.

Default parameters, null shortcircuits, lazy static initializers, computed properties, ease of binding to C++, RC by default, defer.

Both languages are great, but I don’t think they’re on the same ergonomic level by any means.


Replies

hypeateitoday at 3:44 PM

> ease of binding to C++

I wouldn't really call this an "ergonomic" feature of a language. That's a whole research project.

Regardless, C++ interop in Swift isn't straightforward and there are a multitude of issues. One being that you need to compile your C++ codebase with Apples fork of LLVM and in some cases add annotations in your C++ so that Swift plays nice (which basically isn't interop at that point)

You can see the Ladybird projects issue tracker[0] and issues on the Swift forum that LB maintainers have created[1][2] to get an idea. Swift adoption has stalled due to these.

0: https://github.com/LadybirdBrowser/ladybird/issues/933

1: https://forums.swift.org/t/ladybird-browser-and-swift-garbag...

2: https://forums.swift.org/t/ladybird-gc-and-imported-class-hi...

show 2 replies