Live data from Hacker News

Apple is looking for engineers to convert its code from C to Rust

jobs.apple.com

221–230 of 240 posts

Re: Apple is looking for engineers to convert its code from C to Rust

#221
post #173

Earlier quoted context omitted.

For Apple or for employees you mean? I would imagine that many people are going to apply. I would have loved to write Rust at Apple, if I ever got the chance to. And Canada is on my list of countries I would like to live in already anyway.

Not everyone who applies is qualified.

[deleted]

Re: Apple is looking for engineers to convert its code from C to Rust

#222

Earlier quoted context omitted.

Swift is not yet a zero-abstraction-cost language like C or Rust which might be one of their concerns.

C is far from zero-abstraction-cost. For example you can't do a generic qsort supporting user defined types with zero overhead, other than with preprocessor macros (ugly, unsafe, unmaintainable).

Here is a widely-used example of a zero abstraction cost, type safe red black tree in C:

http://libredblack.sourceforge.net/

It supports a few modes of operation, including codegen, and preprocessor tricks. It’s clearly maintainable, given its age and continued use.

Your third complaint is that C with preprocessor macros is ugly. That’s subjective.

I think C++ is more elegant than C + macros, but the GTK people clearly disagree.

Re: Apple is looking for engineers to convert its code from C to Rust

#223
post #187

Earlier quoted context omitted.

C is far from zero-abstraction-cost. For example you can't do a generic qsort supporting user defined types with zero overhead, other than with preprocessor macros (ugly, unsafe, unmaintainable).

I think you've inverted the meaning of "zero abstraction cost" here. It's not that writing abstract code is well-supported and free; it's that the language basics aren't built upon a stack of expensive abstractions.

When I’ve seen “zero abstraction cost” used, it generally has meant that writing high-level abstract code is the idiomatic way to use the language, and that it comes with zero runtime overhead. (This is the main selling point of modern C++.)

Re: Apple is looking for engineers to convert its code from C to Rust

#224

Earlier quoted context omitted.

Rust definitely does not share the simplicity of C. It is the equivalent of C++, not C. You can write code which you cannot guess the machine code, as soon as you use any of the abstractions, just like C++.

Rust’s standard library is about on par with C’s, though.

Rust standard library is dramatically more useful than C’s. C doesn’t offer any kind of collections in its libraries. Every C project just grows its own differently broken hash maps and linked lists.

Re: Apple is looking for engineers to convert its code from C to Rust

#225

Earlier quoted context omitted.

Rust’s standard library is about on par with C’s, though.

Rust standard library is dramatically more useful than C’s. C doesn’t offer any kind of collections in its libraries. Every C project just grows its own differently broken hash maps and linked lists.

Compared to C++, Rust's libraries are severely anemic, especially in the areas where C++ is strong at such as collections, algorithms, and metaprogramming constructs such as type traits. Rust's standard library is better than C in certain areas–you identified one, which is dictionaries. (Linked lists are hard to provide a useful, performant API for; it's often better to roll your own–especially in C–than rely on a library to do it for you.) But even without including C's POSIX libraries, Rust seems to be missing things like random number generation. I general, yes, I would probably say that I would prefer Rust's standard library over C's, but it's not huge in any sense and much closer to C's than C++'s. In any case, I came into Rust thinking it would be like C++, and ergonomically it certainly is. But its standard library is nothing like C++'s and this caused me disconcertion until I began treating it like C's, and being happy whenever it provided me anything beyond that rather than disappointed whenever it was missing something I found useful.

Re: Apple is looking for engineers to convert its code from C to Rust

#226
post #166

Earlier quoted context omitted.

Ah, is this your 45th account @gasthem_1? :P

No, on HN I usually just type something related to whatever is on my mind at the time. No prizes for guessing what it was this time.

In this case we've banned the account because you can't have a trollish username. Those end up trolling every thread the account posts to.

In other cases it's probably because your new accounts are breaking the site guidelines. If you're sincere about wanting to use HN as intended, you're welcome to email hn@ycombinator.com and we'll look into it for you and be happy to help. But could you please not create accounts to break the site guidelines with?

Re: Apple is looking for engineers to convert its code from C to Rust

#228
post #182

Earlier quoted context omitted.

Oh, I've always had plenty naysayers. If I ever paid any attention to them, I'd be a total failure.

I think D didn't gain the momentum because of GC. O/B system is interesting but makes the syntax ugly (at least in Rust's case). Had D gone with a (deterministic) ref counting like Swift and Vala, it would've been much more popular I think. Such memory management keeps the syntax cute :) while not sacrificing the determinism.

We looked hard at an automatic ref counting system. We could not find a way to make it 100% memory safe while allowing pointer access for efficiency. An O/B system makes this workable.

D doesn't change the syntax for O/B.

Re: Apple is looking for engineers to convert its code from C to Rust

#229
post #209

Earlier quoted context omitted.

IMHO it's worth learning at least to internalize the concept of ownership. Ownership in some form exists in most languages, but Rust makes it very explicit. It guides you towards clearly organizing program's data into isolated tree-like structures, instead of a web of everything referencing everything else. Like Lisp, even if you don't use it, it may change how you think about code. I see companies adopting Rust inte…

> Cloudflare writes most new code in Rust, I think you might be over-stating this. We do write a bunch of Rust though!

I mean newly started projects. Of course there's a ton of existing code to maintain, but — at least in my team — Rust is the default for new services.

Re: Apple is looking for engineers to convert its code from C to Rust

#230

Converting code seems like an incredibly boring job.

> Following a very successful first foray into Rust we are migrating an established codebase from C to Rust, and building new functionality primarily in Rust.

That doesn't say the job is ONLY converting code. It says that code was converted, and new code will be in Rust.

Post reply on HN