
Apple is starting to use Rust for low-level programming - azhenley
https://mobile.twitter.com/oskargroth/status/1301502690409709568
======
thrwn_frthr_awy
An an ex-Apple engineer I can assure almost every programming language you can
think of is probably used by one team or another. The idea that a team rewrote
a service in Rust means Apple is "all-in" in Rust is ridiculous.

Every large company I've worked at has had many, many internal services using
all sorts of different languages/frameworks.

~~~
Matthias247
Agreed. It's the same for the other bigger companies (Microsoft, Amazon, etc).

However people with less experience often assume those big companies have
strategic directions for tech stacks, and that one teaming using something
must be really important and implies bigger usage. I might even have assumed
the same when being fresh out of university.

Therefore any news about "X is using Rust" seem to get a lot of traction.

~~~
cbHXBY1D
For example, my team at one of the big software companies has code in Rust,
Python, C++, Go, Elixir, C#, Scala (Spark), and probably another that I don't
remember right now.

------
judge2020
From the job posting[0]:

> We interface directly to low-level Linux kernel interfaces, using
> asynchronous I/O and threads to distribute workload. 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.

However, the team specifically works on the cloud services:

> We develop and deploy software which forms the foundation for some of
> Apple's most important services, including iCloud, Maps, iTunes, and more.

So no rust-based software is going into MacOS or iOS quite yet.

0: [https://jobs.apple.com/en-us/details/200170723/software-
engi...](https://jobs.apple.com/en-us/details/200170723/software-engineer-
networking-privacy?team=SFTWR)

~~~
ksec
So I am reading this as more like Apple is funding ( so to speak ) some work
on Linux Networking using Rust? Which seems reasonable given Linux Kernel
recently shared their intention to accept Rust code.

And I was thinking why did they make Swift for low level usage if they were
going to use Rust.

~~~
bee_rider
Swift is 6 years old, Rust might have been popular among programming language
connoisseurs at the time, but it wouldn't have been that silly to expect it to
be a fad.

~~~
yannikyeo
I see more people and companies adopting Rust since last year after Rust 2018
version with async support.

------
orev
That tweet really blowing things out of proportion. Migrating one project, out
of presumably many thousands, is not “going all in”. It’s still interesting
though.

~~~
jagtesh
Most large companies typically have a bunch of primary languages/frameworks,
so IMO there's never really such a thing as going all in. Unless you're FB and
you're stuck with PHP/Hack.

~~~
jagtesh
That said, I think it's safe to say - this tweet is a sign that Rust is
gaining traction at Apple. It might end up influencing others at Apple to
consider Rust as an option and evangelize it within.

~~~
IshKebab
Yeah I've definitely found it's much easier to persuade a team to use some new
technology if you can point to another team that is already using it. Nobody
can say "we can't use Rust in Apple because X" because you can just say "but
team Y is already doing it so that can't be true".

------
notacoward
One project/team out of how many? Any of the FAANG companies will _already_
have code in dozens of languages. Rust has probably been in the mix for years,
as has Go, as has Erlang, as has Haskell, and so on. It's great that there are
job postings for this, but not sure if it's really news.

~~~
melling
Companies don’t let you use production code in any language you choose. There
is usually a discussion.

I was in a Perl shop many years ago and introducing Python was strongly
discouraged.

~~~
notacoward
> Companies don’t let you use production code in any language you choose.

You might be surprised. At _most_ companies I've worked at (over a dozen)
that's largely true. Three jobs ago I was product architect for the entire
company and spent a significant part of my time fighting just this kind of
language proliferation. However, it's a very different story at a large
company. Google seems to try pretty hard to keep this under control. OTOH,
Facebook (where I work) prides itself on a "bottom up" "engineer driven"
culture in which any such top-down prescriptivism doesn't fly. Don't know
where the others fit in along that spectrum. The situation gets even murkier
when code is inherited via acquisition or imported from open source. So such
code often exists, whether it's "supposed to" or not.

~~~
nindalf
Interesting that you mention Facebook. A team at Facebook can choose whatever
language they want, but they're on the hook for creating and maintaining
libraries that talk to internal services (config, database etc). There's a
tendency to choose one of the existing popular languages (C++, Python, Java)
so you get those libraries for free.

Therefore in practice, giving engineers the freedom to make their choices
doesn't lead to an explosion in the number of languages used in production.

An engineering team that can get started with a new, esoteric language without
having to first build internal libraries is much more likely to try that new
language.

~~~
biztos
Particularly in the case of Java, wouldn't a lot of people be tempted to try
languages that can use Java libraries?

Like Scala or Kotlin for example?

~~~
nindalf
It’s not just libraries though. All software needs to build when invoked with
“buck build” and it’s dependencies need to be specified in buck’s
configuration format. Scala’s build is different enough that it can’t
piggyback off Java here.

This requirement is a stumbling block for many languages. For example when
compiling Rust, no one actually calls rustc directly, everyone uses cargo.
Effectively this meant someone had to reimplement cargo within buck.

------
linuxlizard
I wish Rust's non-x86 support was a bit better. I wish I had time to jump in
and help on the MIPs target. I wish I could figure out how to cross-compile to
ARM/ARM64+uClibC. I wish I had a pony, too.

Very exciting to see a language tuned toward reliability taking off like this.

~~~
zip1234
Limited experience here but seems like fairly large binaries for embedded as
well. Though have not spent much time investigating how to make them smaller.

~~~
bsder
Actually, the embedded Rust guys track this.

no_std is the result of that. The panic/backtrace machinery turns out to be
remarkably expensive. formatting machinery turns out to be expensive. etc.

The fundamental problem is that Rust relies _REALLY_ hard on LLVM optimizing
stuff away after code generation. That's not a good way to deal with embedded.
It has issues even on Desktop, too (for example, the difference in speed
between debug and release modes is enormous--often to the point that if you
have performance code you can't realistically run a debug build to actually
... you know ... debug).

There are changes afoot because of MIR, but they will take a while to land.

People forget how many companies created weird and wacky compilers for C on
8-bit targets because C code was "too large/too slow/etc." And how many
_years_ those companies persisted.

Optimization for embedded takes time, and the amount of resources available
for it is _orders_ of magnitude smaller than general development.

------
mplanchard
This is so exciting. They just opened the 2020 State of Rust Survey[1], and I
would imagine that I’m not the only one who noted that I hoped more companies
would start writing software in Rust, so that hopefully I can use it as a
primary language at my next job. Apple using Rust for new low-level
functionality definitely is a step in the right direction!

[1]: [https://blog.rust-lang.org/2020/09/10/survey-
launch.html](https://blog.rust-lang.org/2020/09/10/survey-launch.html)

~~~
colmvp
It's interesting because I spent time learning C++/Rust a year or so back and
I stupidly didn't look into the job market before devoting time to it only to
get the sober realization in my city of 6 million that very few companies were
looking for it. I ended up learning Javascript not because I truly loved it
but because there are/were significantly more positions available.

~~~
bsder
Rust, yeah, that's not really going to net you a job.

However, for a city of 6 million I'd expect a couple hundred C++ jobs.

~~~
colmvp
That's what I expected too but honestly when I was looking I found maybe... 5
positions? And none of them were entry level.

------
ausjke
[https://www.youtube.com/watch?v=iOBXVOAbpdY](https://www.youtube.com/watch?v=iOBXVOAbpdY)
8-min video says rust is not that safer comparing to C in practice

------
checker659
Didn't Apple use Java at one time for iCloud / mobileme backend?

~~~
pjmlp
They still do, WebObjects.

~~~
masklinn
WO was last updated 12 yeas ago, removed from the default OSX Server 11 years
ago and officially discontinued 4 years ago.

Saying that they're still using it might be a bit optimistic.

~~~
pjmlp
Just because the outside world doesn't get it, doesn't mean they haven't kept
it running inside.

------
mrfusion
Could rust be used for low level os modules or for drivers? Why or why not?

~~~
steveklabnik
Yes. In fact, the Linux kernel has been talking about allowing drivers to be
written in Rust. (There are other examples of stuff in this space too, but
that's the biggest deal so far.)

~~~
zokula
Don't get ones hopes up about rust module code shipping with the kernel for at
least a decade, or until you can build rust code with GCC.

~~~
steveklabnik
The kernel devs have said that that is not a blocker. (This is because what's
being discussed are drivers, not the kernel itself, though they would be in
the kernel tree.)

And, there's been some interest towards getting gcc to be able to compile Rust
too, so that may happen regardless of its need or not.

------
r053bud
What happened to "Swift for everything"

~~~
buzzerbetrayed
Wait did you really think they were going to start writing OSes in Swift?

------
tblacky
Rust is a very clean language with several use cases. It gives a lot of power
to the programmer and it's super easier to be productive compared. Rust will
win over Go much like React.js won over Angular. I'd predict that the Rust
language will dominate and become a must-know in a couple years time.

~~~
higerordermap
Rust is the new systems language with a good safety story (which implies some
cognitive overhead, but that's fine for low level programming where you don't
want a GC), gives C++-like performance by virtue of being close-to-the metal,
and a zealot crowd around it with many kinds of political bullshit and ruby /
Javascript hipsters learning it and thinking they have understood computer
science because they understood difference between stack and heap.

Rust is a fringe language and it won't get a lot of traction, because of more-
noise-than-signal more-politics-than-technical-talent surrounding it.

