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

There literally ARE correctness proofs of Lean kernels like con-leche and con-ron. The correctness of elaboration is also irrelevant to the correctness of the kernel.

Maybe that is why kernels weren't mentioned? What if the elaboration does not match the source text and inserts False into the hypothesis of the main goal and the kernels dutifully check the generated .olean? Just the most drastic example.

That's trivially checkable, there's also `lean comparator`, as well as human checks from Lean FRO.

If consumers were willing to pay more for GPUs like datacenters do, NVIDIA would have sold plenty of consumer GPUs. Or would you press a button to halve your revenue for some reason?

(I say this as someone who would have liked a 5090...)


There's a lot to CUDA and there isn't. The API is public. Anyone could make something as good or better than CUDA. SOMEHOW, this hasn't happened, still. Make of that what you will.

Relevantly, there's also the the CUDA -> PTX -> (per device) SAAS compilation which allows NVIDIA to support backward compatibility very well. Compared to AMD, NVIDIA just has way better software. Then compared to Metal (Apple), NVIDIA has way better GPGPU (i.e. atomics).


It's okay guys, the authors simply don't know how to write good C. A real C programmer would not have shipped such a basic use-after-free bug. Rust is just a crutch.


The fallacy is the idea that a Rust implementation would automatically achieve the same performance, and not resort to "unsafe" to be competitive, and then be open to exactly the same issues.

Illustrative example: This CVE in a Rust matrix transpose code: https://github.com/advisories/GHSA-5gmm-6m36-r7jh

Conceptually, there is not really anything much simpler than a matrix transpose. So how did they manage to create a bug? To make it fast you need simd, which implied using unsafe, and the dimension check to make it safe used unsigned integers that could wrap around. So they same bullshit as in C.


Your fallacy is that you present the comparison 'if' either of the two can be done poorly.

Rust can separate the question: "Is a set of functions is safe in a certain condition" from "using functions in that condition".

They are materially different. SIMD has a safe interface now.


The only question is to what extend this is relevant in reality, and how it compares to other efforts to avoid bugs.


I won't comment on your entire comment, but this:

> To make it fast you need simd, which implied using unsafe

Is just false. There are multiple safe SIMD libraries for Rust that can exploit the full SIMD potential. Only very rarely they require unsafe for maximum performance and only to avoid bound checks.


Google already did it and resorted to unsafe rust to be competitive.


Counterpoint, more than memory bugs exist, and everything's written in C. You're welcome to rewrite in Rust but you'll create countless bugs that aren't memory bugs that mostly already got fixed in the C version. I can't help but think things like fil-C are the most pragmatic route, despite performance costs, for most people relying on programs written in C.


Yes, you'd introduce a lot of new bugs because the code is newly written[1], but eventually you'll get to the same maturity as today except you can't have all these devastating memory-handling-related vulnerabilities

The question is whether your software will be in use long enough to be worth the cost of change more than whether it's a good idea in the long run. For Linux, I'd argue that that's likely. At least new code would ideally be contributed in a safe language, where practically possible (there'll surely be places where you need to deal with memory as a kernel)

Relevant article: reducing memory vulnerabilities through a combination of memory-safe languages and an exponential decrease of bugs as existing code ages https://security.googleblog.com/2024/09/eliminating-memory-s..., from which I'll also quote my reference for [1]: "A large-scale study of vulnerability lifetimes published in 2022 in Usenix Security [...] found that the vast majority of vulnerabilities reside in new or recently modified code"


This is a dumb argument imo. Critical vulnerabilities are mostly due to memory bugs (and not for a lack of other kinds of bugs). Most people relying on programs written in C (or even C++) should consider plans for migrating to software created with toolchains from this century. You cannot indefinitely carry on this tech debt.


Here are some CVEs identified in Rust coreutils [1]. These are mostly really trivial issues. I'd bet money that the nastier logic bugs are still in there and that the people who maintained the old C utils or helped identify the old bugs can find similar ones in these utils, although half these issues probably never appeared in the C version because Rust is much more complicated than C so makes it easier to hide logic bugs in plain site, looking at many of the issues in this article they seem like bugs that are extremely unlikely to get written in C, like accidentally forcing everything to be UTF-8, or aborting on routine errors.

[1] https://corrode.dev/blog/bugs-rust-wont-catch/


I strongly disagree with the idea that Rust makes it easier to hide logic bugs. Rust is a much more complicated system than C but allows software engineers to work at a much higher level of abstraction which generally reduces logic bugs. Of course, new projects will inherently have bugs but with Rust it is easier to achieve a higher level of rigor.

To be clear, this is not due to the borrow checker at all, Rust does not have the tooling to statically determine the absence of logic bugs. What it has is the necessary programming language features to manage much more complex systems through abstraction and modeling.


At least it doesn't silently launch nuclear rockets, smaller bugs are manageable, like accidentally forcing everything to be UTF-8 is basically nothingburger.


until you can't delete a file because it's not valid UTF-8


One issue with this argument is that, almost everything is memory, especially in C. It's not really descriptive. If you write a reactionary language like Rust, it may be possible that you just fix one type of issue (with an error type taxonomy that's not very refined), and end up with a language that does not necessarily cause less bugs and vulns, but that causes less vulns that can be classified as that type of issue, while increasing other types of bugs/vulns, either of an existing type, or of a new type that only exists in that new language.

Like are we empirically seeing less Rust CVEs? Adjusted for popularity of software and perhaps age of software.


Are you saying by attempting to reduce certain types of bug category such as memory safety, other types of vulns would suddenly be increased because of it? It sounds to me like you are saying we shouldn't treat common cold because cancer rates might increase. And what do you mean by reactionary?


> It sounds to me like you are saying we shouldn't treat common cold because cancer rates might increase

surprisingly that’s almost not a strawman, I’d support an argument like that, and it’s how medicine works

if a cancer treatment is discovered, it needs to be trialled for side effects, and actually chemotherapy can have side effects that are worse than the cancer, it’s entirely possible for chemo to weaken the immune system and thus increase colds.

so hillariously, yes, that’s almost what I’m saying. but to be precise I’m not saying we shouldn’t cure cancer or solve bugs, just saying that solving one kind of issue doesn’t prove the tech is beneficial overall, and the more generic the problem being solved, the more likely the panacea will fail or have side effects


It’s also never been easier to replace C programs with safe alternatives.


Sure. Where's my rust chromium rewrite then?


I wouldn't be surprised if Google is experimenting with exactly that right now.


I'm not suggesting anything like "rewrite in Rust", at least not in general. I'm simply poking at the fact that use-after-free (and other such issues) are effectively deprecated classes of bugs.


With all the "Claude rewrote X in rust!" posts lately, I'm waiting on the inevitable Linux kernel rewrite post.

Vibe code aside I feel targeted rewrites are becoming more and more justified.


I wouldn’t be surprised if we start seeing individual drivers and subsystems move over.

The Linux maintainers have been extremely conservative with the Rust introduction but after the endless CVE apocalypse they might be more receptive.


> I wouldn’t be surprised if we start seeing individual drivers and subsystems move over.

Already happening. https://lwn.net/SubscriberLink/1102982/c3a3a2d4f17108c5/ "Removing binder.c" is an article from yesterday, about discarding the old C implementation of the Android Binder driver (used by every single Android phone) in favor of its Rust reimplementation.


Linus is using LLMs


It's because the cache comes from the prefix. `f(f(f(A,B),C),D)` is quite different from `f(f(A,B),D)`.


Yes, that's my understanding- though I realize that OpenAI has made changes to what you can do with caching over the API recently, so you may be able to do some fancy stuff to get around this.


I disagree. There are things which are very annoying outside of core ideas or otherwise take a lot of time. Too much time and energy to justify normally. Personal example: https://github.com/wiwa/gpu-typing

Typechecking with my own algorithm. Simple enough to specify in Python. Annoying with much boilerplate in CUDA. Similarly annoying to test.


I've been thinking about building a GPGPU language, but it's definitely going to take a while, even with AI. AI, unfortunately(??), cannot replace taste at the moment, and generally cannot unless it becomes a lot more disagreeable.

Taste is disagreeable.

Maybe Claude should not let me build a two-level type theory with just a "You're absolutely right!". In fact, now it will say "You're absolutely right, and it would be so amazing to use cubical types for blah blah", and adamantly defend it with several paragraphs of vomit.


Why would you want a new language if you're using AI? Training set size more than compensates for token usage, so unless you plan on writing in this language by hand I don't really see a point.


I find that frontier AI is very good at understanding new syntax/semantics, for whatever reason. But that's moreso "why is it not just a huge waste immediately".

I want a new language because current GPU (and really, parallel programming) languages are just not it. Also, I think we'd be better off if it weren't just CUDA dominating the developer experience.

Moreover, I feel that we should be embracing advanced type systems with AI. The past couple decades have shown that people do want advanced typing even without AI. And now we have stuff like "Lean is faster than Rust" (https://kim-em.github.io/blog/2026-7-24-why-lean-is-faster-t...).

Programming is hard. Programming when you can't just rely on the classic RAM model is harder. Parallel programming at scale on vector processors with small amounts of cache (and slow cache at that) is even harder. We can do better. Rust has already shown this for normal systems programming.


So complile lean to GPU, maybe?


That may be a not-terrible idea (possibly even great idea), though it's not quite the base language I'm looking for. Maybe I need to just experience it more.


It's too good.


I remember chatting with about AI a few months ago about the issue of foreign RAM sticks being able to cooperate with websites to serve different files/instructions, undetectably. Scary stuff.


Are you sure whatever the LLM said was actually credible though?


Why would I assume it would be credible? Instead, I simply proposed some designs and had it find out if such hardware existed / was feasible.


Absolutely not… but maybe the LLM was trying to tell them it’s a crazy idea and they are only reporting that a conversation occurred.


Lol, this feels like it would otherwise be a good thing, out of context.


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

Search: