Hacker Newsnew | past | comments | ask | show | jobs | submit | jadengeller's commentslogin

Modern Swift borrows a lot from Rust! And it also has its own benefits, both ergonomic and also supporting eg generic in dynamic libraries

These days I mainly write Rust but I did write a semi complex iOS app and enjoyed Swift. I just didn't love how slow the type checker was and how it got lost. I recall having to break things into smaller bits to help the compiler, and there were some oddities about the language.

The gap between the two languages is quite small, it just makes me wish Apple was also all-in on Rust


In the last year they’ve added improvements to the type checker to speed it up, those would have been released now.

They have further and much more significant changes that I think might have recently landed in the development version. That should make an even bigger difference. But it’s not in a released version yet.

And yes, none of us like that one part of Swift. Especially the DRASTIC difference compared to objective-C which really only checked syntax and little else.

It’s still probably my favorite language right now though I don’t get to write in it much.


Apple is not going bet all on language whose roadmap they do not control 100%.

maybe so on the surface, but it remains quite massive underneath; these languages are fundamentally different and target entirely different use cases

I'm not sure Rust has one specific use case as its main goal, despite being immediately suitable for systems programming.

I use it for making user-facing desktop applications, to name one example.


I see Swift as a more approachable version of Rust.

If somebody is mulling over Rust but finds it too difficult to grasp, they could start off with Swift first and then move over to Rust.

One of the main advantages of Rust is a more developed and thriving ecosystem.


It has an unfortunate name though, maybe a short shelf life. Rust++ doesn’t seem inviting either.

Rust does not have a ++ operator, so that name would make no sense.

Not yet.

Swift and Rust were developed at similar times. I think of them more as having similar influences than borrowing from each other.

There’s no reason to invent your own head canon, the influence was openly acknowledged when Swift was new and it continues now that the language is developed out in the open (see Swift Ownership Manifesto)

Obviously Rust was first but over time both languages have been taking inspiration from each other. For example let-else was motivated directly because of its success in Swift: https://rust-lang.github.io/rfcs/3137-let-else.html#prior-ar...

Additionally both have influences from CLU, C++, Object Pascal, Modula-2, Mesa/Cedar, Standard ML, Cyclone.

Many features that get discussed as being Swift/Rust, trace back to one of those languages.


Similar times and the Rust originator went on to work on Swift after it.

Graydon Hoare's impact on the language is marginal than that of Chris Lattner, the originator (also, Hoare joined the team much later)

Does it borrow borrow checker?

I believe Swift tends to use reference counting and copy-on-write strategies. This, like GC, is less for the programmer to think about and doesn't require the semantic checks, but sometimes the performance cost is unacceptable compared to what you'd write in Rust.

You can choose to use either refcounting or unique ownership for your types. For most use cases, refcounted (+ copy-on-write) is the best choice and is the default, but the truetype interpreter made extensive use of non-refcounted types to achieve this performance.

You can pick and chose, and memory ownership is getting better in latest versions.

Being more ergonomic is relevant enough for increasing language adoption, that possible improvements are now on Rust roadmap.


They have either recently added or talked about a borrow style system in the language as a way to avoid more copies and speed things up/lower memory usage/help with asynchronous programming.

Yes, it has a borrow checker.

this comment seems to be astroturfing to sell a course


What do you mean, the LLM from Scratch book?


exfiltrating a credential provides persistent access (until detected and rotated) tho! probably one of the more leveraged things to prevent


No, you misread


And you are absolutely correct. I've seen the DT page thanks to the linked HN submission (actually comment [1]. And incorrectly associated the DT article incorrectly today. Thank you.

[1]: https://news.ycombinator.com/item?id=47200131


I think this is a bit similar to Mojo's origin types: https://docs.modular.com/mojo/manual/values/lifetimes/#origi...


what do you verify about the bots?


some quick feedback on the user interface:

- i pressed "Amino Acids", and nothing updated below the toolbar. can't figure out what it does

- the "Tools" buttons looks like a segmented picker, but both seem to actually initiate a modal presentation

this tool seems interesting, but it would be worth polishing some of these ui quirks because my first impression was that it seems a bit broken (or confused me)!

but seems like a cool project otherwise, love people building and sharing explainers as they learn stuff!


I'd probably say we ought to use DNS.


And while we’re at it, 1) mark domains as https-only, and 2) when root domains map to a subdomain (eg www).


I might amuse you to know hat we also already have a text file as a solution for https-only sites.


If there are rate limits, or if the search space is vast, this is notably more limited (even if arguably still enumeration)


is it actually free? or are we collectively paying for it by allowing the big business to gain control of an otherwise competitive market and jack up prices

individuals are not pricing that in. coordination is needed. that's why we regulate the market


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

Search: