TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Volvo is using Rust for its in-vehicle software

529 点作者 georgehill超过 2 年前

32 条评论

jandrewrogers超过 2 年前
Every automotive code base I&#x27;ve seen has been a dumpster fire. This (mostly) isn&#x27;t the fault of the developers and Rust won&#x27;t fix it. The business process creates this outcome. No one likes it but little is done to address it.<p>The software development timeline is slaved to the rigid manufacturing timeline. There is no allowance for slippage, so making things work By Any Means Necessary is the rule of the day. Concurrency problems often are not debugged; locks and similar are just sprinkled around until they disappear in testing. It is TDD taken to an extreme -- passing the enumerated tests, technically, is the definition of done even if the code is obviously poor or broken.<p>There are a vast number of software and hardware components sourced from myriad vendors that are swapped out every year to save a few dollars or deal with a supply chain issue. There is no stable baseline but all of these components need to work together. The code has to constantly adapt to the reality that someone sourced parts for a new model year that work differently or are in a different programming language.<p>This code is usually required to be supported for 10+ years. The developers don&#x27;t just have this year&#x27;s tech stack and code base to deliver on a rigid schedule, they are required to maintain several older implementations concurrently, often built in different languages and architectures.<p>Basically, the automotive industry has failed badly at the transition from being hardware manufacturing companies to being hardware + software manufacturing companies, and try to run their software processes the same way they ran their traditional hardware processes. Choice of programming language is the least of their concerns, that isn&#x27;t the source of their code quality issues.
评论 #32965076 未加载
评论 #32965105 未加载
评论 #32966847 未加载
评论 #32964034 未加载
评论 #32964542 未加载
评论 #32967830 未加载
评论 #32965564 未加载
评论 #32979590 未加载
评论 #32964369 未加载
TheRealDunkirk超过 2 年前
A lot of comments so far are complaining about the software quality in cars now. But what did you expect? This is what happens when you hire the same kinds of people to write the software for your car that you&#x27;ve hired for 25 years to write the terrible internal applications inside the company that everyone hates, and in the same terrible way. The end result is going to be exactly the same.<p>Over the years, I&#x27;ve seen various discussions brush up against the issue of professional certification. Professional Engineer, in civil engineering, is a serious credential, which can hold people professionally liable for bridges that fail, or buildings that fall over. Making cars a network of computers that all talk to each other, operated entirely &quot;by wire,&quot; and giving up any consideration of mechanical backups (like with a plane) is going to very quickly drive the point home that the programming profession needs a similar credential. As a mechanical engineer who has made a living writing software for 30 years, I understand the difference, but the legal externalities are not going to care that software is VASTLY more complicated than, say, designing a plane wing with a factor of safety.<p>Now, I have to go figure out why my Rails application can no longer restart the delayed_job process on deploy. Is the problem in Rails, Ruby, my gems, Capistrano, permissions, SSH, or some updated package on my Linux VM? Designing a bridge, frankly, is easier, because it&#x27;s &quot;concrete&quot; and closed-form. Sure, I&#x27;ll figure out my deployment problem, but next month some obscure thing in the 24 layers that make up a simple web app these days is going to get updated, and break something else. At least once a bridge is built, it&#x27;s done.
评论 #32963464 未加载
评论 #32963118 未加载
评论 #32963091 未加载
评论 #32962811 未加载
评论 #32963148 未加载
评论 #32963344 未加载
评论 #32964018 未加载
评论 #32963857 未加载
评论 #32964379 未加载
评论 #32963720 未加载
评论 #32963691 未加载
评论 #32966145 未加载
评论 #32968231 未加载
评论 #32965664 未加载
评论 #32963772 未加载
he0001超过 2 年前
I own a 2021 Volvo and the blinkers doesn’t blink regularly. They may blink fine for a awhile but then stops for a period, and then suddenly all missed blinks blinks in a rapid succession. It’s extremely annoying. There are other bugs, like when you are using the auto pilot where it sometimes may suddenly jerk the wheel even though there is nothing wrong with the road. Scares the shit out of you. That has happened thrice now.
评论 #32962093 未加载
评论 #32962262 未加载
评论 #32966273 未加载
评论 #32961452 未加载
评论 #32961373 未加载
评论 #32961598 未加载
评论 #32962519 未加载
评论 #32962009 未加载
评论 #32962377 未加载
评论 #32962254 未加载
评论 #32961695 未加载
评论 #32961854 未加载
评论 #32962717 未加载
评论 #32963024 未加载
评论 #32961644 未加载
评论 #32964077 未加载
评论 #32961745 未加载
评论 #32961748 未加载
评论 #32966417 未加载
评论 #32961295 未加载
esskay超过 2 年前
Honeslty I&#x27;d rather they just did as minimal programming as possible. Slap an open api on all cars and let carplay&#x2F;android auto&#x2F;any other piece of software have access to said api to do as they please.<p>The longevity of in car software is utterly attrocious. Taking a very basic car like a Toyota Aygo as an example, in 2015 they released their mid-range models with a large touchscreen in the center console, boasting support for connecting your phone and such. In reality it didn&#x27;t work from day 1. They used Mirrorlink which had already become out of date tech and wasn&#x27;t supported by any of the handsets anymore.<p>Now, they could&#x27;ve released a software update to fix this. Except they didnt. They kept selling that car for several years, advertising phone integration that didn&#x27;t work.<p>Car manufacturers give absolutely no care at all to their software and never have.
评论 #32965891 未加载
评论 #32963808 未加载
singhrac超过 2 年前
I saw a lot of fairly unstructured C in embedded programming - copied source &#x2F; header files, hacked together Makefiles, lots of &quot;works on my machine&quot;. Almost no abstraction to prevent use-after-free (mostly rigorous code review).<p>I always saw that the problem it would solve is more about tooling - Rust would be a fairly good fit because it has a good cross-compilation story, and the tooling around e.g. cargo and running builds is quite good (in my opinion). The blocker right now is absolutely vendor support; no reasonable hardware company can afford to hack their own HAL without vendor support (and in fact they pay a lot for support right now, and use it).<p>I think what these companies usually miss (good for Volvo) is that iteration time in a &quot;higher-level language&quot; like Rust can actually be much faster than in something like C. The setup time for a dev environment in embedded can be a week (making sure exact version match between compilers, checking out files, compiling, resolving build failures). On top of that, just having access to a language with strings and algebraic types is huge.<p>I think there&#x27;s maybe room for a Rust consultancy that could take one of the existing large manufacturers, build a toolchain around it (possibly with their blessing &#x2F; support). Ferrous Systems does this (I hope there is as much demand as I am imagining).
davedx超过 2 年前
Is this post being astroturfed or something? Lots of irrelevant, un-constructive or plain trashy comments
评论 #32966375 未加载
abusaidm超过 2 年前
“ Why Rust is actually good for your car.” That gave me a chuckle. It’s a better title the one in here too
评论 #32961171 未加载
评论 #32962615 未加载
评论 #32961294 未加载
评论 #32961772 未加载
jeena超过 2 年前
I remember proposing looking into introducing Rust as a second language next to C++ just 3 years ago while working with a German car manufacturer in Berlin, every single architect refused and most of them were making fun of me, anyway I&#x27;m not bitter ...<p>Actually back then it was the beginning of me stopping carrying about improving and just go with the flow like a dead fish. Everyone is happier, I have much less clashes with coworkers much less stress and you know what they say: Nobody got ever fired for choosing IBM.<p>I think this is the main reason for the state of software quality in cars now. People who care can&#x27;t stand the industry and leave, if you want to stay you have to stop carrying.
评论 #32963588 未加载
评论 #32976167 未加载
eggy超过 2 年前
I know Rust has many goals on paper that align with this decision, however, what large codebases in the field of high-integrity software are written in Rust? Does Rust comply with high-integrity software standards (CENELEC EN 50128, DO-178C,DEFSTAN 00-56, or IEC 61508) in any capacity?<p>SPARK2014 has been around much longer, does comply with those standards, is a formally defined PL with a great set of verification tools specifically designed for high-integrity software. There are large codebases (software for the safe operation of helicopters at sea (27k LOC of SPARK2014); NATS iFACTS air traffic control system (&gt;529K LOC of SPARK2014).<p>I am glad that AdaCore is teaming up with Ferrous Systems to help bring some of Ada and SPARK&#x27;s goodies to Rust, but it&#x27;s nowhere near them at this point. This seems more a Rust champion at Volvo convinced their group to use it.<p>&gt;&gt;&gt;JG: Then I pitched to the managers, “If we want to do a serious Rust effort within the company, then I want to take part in that and become an employee”, since I was a consultant at that point.<p>The availability of programmers in either Rust or SPARK2014 shouldn&#x27;t be a heavily weighted factor, since anyone working in SPARK2014 probably already has the relevant experience no matter how few apply, whereas the dozens or more of Rust programmers who might like working at Volvo would be cutting their teeth trying to build 1&#x2F;20 of what Ada&#x2F;SPARK2014 already have, and possibly deliver far less.<p>Rust is to C++ as SPARK2014 is to Rust at this point in my opinion, but current popularity wins out a lot in all human endeavors. I&#x27;ll stick with SPARK2014 and Zig for now until Rust catches up SPARK2014.
Onewildgamer超过 2 年前
I love Volvo cars. I hope they have enough investment in support and engineering, because Rust isn&#x27;t an easy language to pick up. I wouldn&#x27;t want to escalate minor software problems through the management that needs engineering team&#x27;s response and I&#x27;m waiting because there is not enough people to support across continents.
评论 #32962939 未加载
评论 #32967556 未加载
lizardactivist超过 2 年前
They&#x27;re hard at work in this thread today; people must be convinced to buy Tesla, and to stay away from Polestar.
autotech超过 2 年前
I&#x27;m an automotive technician, I have worked for an EV startup. Some of the most frustrating diagnoses I have been involved in were caused by bugs in the software. We had one where a power trunk would not release if the vehicle was out in the sun. The ambient light sensor and the power trunk actuator were not even on the same network bus. We had a gut feeling that it was software, but by the time we were sure, it had been 2 full days of extensive testing.
tazjin超过 2 年前
Makes sense that one of the most safety focused manufacturers would go for it.
评论 #32961613 未加载
评论 #32961216 未加载
评论 #32961231 未加载
jokoon超过 2 年前
What are the most commonly used UI software for rust?<p>I don&#x27;t think there is a QT equivalent? I guess there are bindings for QT, though, but I don&#x27;t know if it plays well with the particularities of QT.
评论 #32961932 未加载
评论 #32962734 未加载
tobyhinloopen超过 2 年前
Volvos software is absolute shit since they went with android
jugg1es超过 2 年前
What&#x27;s up with all these &quot;X uses Rust!&quot; articles recently? Is it that surprising that a memory-safe, low level language with a large community is actually getting used in production?
评论 #32969803 未加载
ddalex超过 2 年前
I drive a Volvo and it&#x27;s the most amazing car that I&#x27;ve driven. The comfort of long range drives is something else.
helloguillecl超过 2 年前
I have never done any Rust, but I love Volvo (I have driven 3 different Volvos) and I&#x27;d buy them without trying them (done it twice) if you want a car that is consistent and user-friendly, this is the one to go for.<p>Now I have a reason to try Rust.
评论 #32961491 未加载
评论 #32963822 未加载
评论 #32963867 未加载
评论 #32961781 未加载
logicchains超过 2 年前
It&#x27;s fitting as Rust is the Volvo of programming languages (and I mean that in a positive way, much as Volvo characterised itself in its successful &quot;Bloody Volvo Driver&quot; advertising campaign).
techwiz137超过 2 年前
Progressive on the cars, but their VIDA software uses terrible and slow database, and requires...get this: Internet Explorer to work on modern PCs.
donw超过 2 年前
That’s nothing. Chevrolet has built its cars with rust for decades now.
评论 #32961150 未加载
stephc_int13超过 2 年前
I can see where Rust could fill the same niche Ada once occupied.
评论 #32962161 未加载
benced超过 2 年前
They are the safest car manufacturer.
cultofmetatron超过 2 年前
as much as I love rust. why not ADA. it was designed for this sort of use case.
robomartin超过 2 年前
I am truly astounded by the hatred exhibited in some of the comments in this thread. Wow.<p>A few points:<p>If your software development experience is limited to web or mobile development, please understand you lack a massive amount of context when it comes to software in the context of complex hardware manufacturing. To put it in simple terms, you really don&#x27;t know what you are talking about. It&#x27;s like someone who writes code for embedded systems in clothes washing machines having a strong opinion about how to engineer, deploy and maintain a tech stack for a SaaS.<p>Next, the cults formed around programming languages are some of the funniest things I read on HN. Except, they are not funny at all. There is nothing wrong with C or C++. Nothing. The problem is people who don&#x27;t know how to program. At the core, to perform a certain function the microprocessor will, for the most part, do pretty much the same things, regardless of what language might be used to describe that. Blink a light in response to a button being pressed? At some point you are sensing and de-bouncing the input and then setting an output pin. Maybe there&#x27;s I2C, SPI or CANbus in between, but what you have todo is the same.<p>Languages like C and C++ have been around for longer than most people reading this have been alive. They have been used --successfully and without issues-- for more projects, products and systems than anyone can imagine and at scales from a watch to spacecraft and everything in between. This cult of languages as solutions to problems caused by bad programming is nonsensical. One can write bad code in any language.<p>Professional certifications. This isn&#x27;t going to stop people from writing bad code. At all. Designing and implementing complex code for real time systems is far more complex than designing a bridge or a building. Certifications are not magical inoculants against bugs and system design problems. Trying to view and fit software engineering from the context of other engineering disciplines is a mistake. They are not the same thing.<p>When you are dealing with fault-tolerant hardware + firmware systems things can get exponentially harder. Folks who work on web products have the luxury of being able to make lots of mistakes and fix them as fast as their deployment system allows. Imagine if you got ONE CHANCE to ship a non-trivial codebase and it has to be guaranteed to work to a high degree of certainty for ten or twenty years. Once you ship it, there will be millions of users and you cannot touch it at all. In fact, you have to telemetry data of any kind. You don&#x27;t know if there are issues, if it has random failures, race conditions or odd failure modes you cannot possibly simulate at scale in the lab.<p>Imagine this next time you deploy an update. Imagine you are not allowed to touch it at all after that and it has to work. Imagine that, and maybe you can get a sense of what some of this work can be like.<p>This isn&#x27;t limited to automotive. This goes for commercial, industrial, aerospace and other domains. Hardware is a million times more difficult that pure software products, particularly web type software. We just shipped a thousand units of one of our new products for installation in a large industrial facility. The firmware had to go through a year of testing before we dared ship even a single unit. That&#x27;s another thing to imagine; the idea of having to test and qualify your web SaaS --not with clients as test subjects, on your own-- for a year or more before you can launch your business (and you are not allowed to touch it after that).<p>Anyhow. Don&#x27;t be language cultists. That isn&#x27;t the problem. Bad programmers and bad process is far more of an issue. Changing languages isn&#x27;t going to magically fix that. It isn&#x27;t a solution. You can build anything with C or C++. If written correctly, it will perform better than just-about anything and be reliable within the bounds of system specifications.
评论 #33004209 未加载
评论 #32968883 未加载
评论 #32969854 未加载
评论 #32965651 未加载
sgt超过 2 年前
They used to keep the rust in the chassis. Now it&#x27;s on chips. That&#x27;s progress!
plankers超过 2 年前
So I guess this means Volvos will be... crashing... less?
huhtenberg超过 2 年前
Polestar is a Volvo subsidiary that does electrical vehicles that overlap a lot with Volvo&#x27;s own EVs. Polestar 2 is their main model and its specs are <i>nice</i>, pretty much the second best after Tesla.<p>However what PS2 is also known for is an absolute shite quality of their firmware.<p>Cars refusing to start and requiring a &quot;service&quot; out of blue (with one lucky guy scoring this in the middle of a forest). Chargers not engaging or, better yet, not disengaging. Basic functions, like blinkers and car locks, breaking after an update. Updates, in general, are more of &quot;oh, fuck, not again&quot; events rather than the positive news.<p>Like, I understand it&#x27;s a complex software. I had a Bimmer show at &quot;-10 km to destination&quot;, an Audi refusing to open a truck if parked too close to the wall, but the amount of bugs in Polestar is <i>insane</i> over the baseline.<p>But, yeah, it&#x27;s (possibly) written in Rust. Yay.<p>[1] <a href="https:&#x2F;&#x2F;www.polestar.com" rel="nofollow">https:&#x2F;&#x2F;www.polestar.com</a><p>[2] <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;Polestar&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;Polestar&#x2F;</a><p><pre><code> --- </code></pre> Edit - Added &quot;(possibly)&quot;. The point was that the choice of the language matters less if your bugs are higher level and your QA process is lacking.
评论 #32963299 未加载
评论 #32962716 未加载
评论 #32962776 未加载
评论 #32961904 未加载
评论 #32962447 未加载
ardel95超过 2 年前
They do claim to be the safest cars!
amelius超过 2 年前
Does it run on a GPU now?
rapind超过 2 年前
The goal being an SEO takeover of Rust + Volvo...
tus666超过 2 年前
Bit scary there is probably a bunch of code in a car explicitly marked as &quot;unsafe&quot;.
评论 #32961624 未加载
评论 #32961699 未加载
评论 #32961548 未加载
评论 #32961675 未加载
评论 #32965779 未加载