News for hackers. Stuff that matters.
Re:Prediction: AI will make formal verification go mainstream by blub on Wednesday December 17, 2025 @02:22AM (#46299153)
> No one claims that good type systems prevent buggy software. But, they do seem to improve programmer productivity.

To me it seems they reduce productivity. In fact, for Rust, which seems to match the examples you gave about locks or regions of memory the common wisdom is that it takes longer to start a project, but one reaps the benefits later thanks to more confidence when refactoring or adding code.

However, even that weaker claim hasn’t been proven.

In my experience, the more information is encoded in the type system, the more effort is required to change code. My initial enthusiasm for the idea of Ada and Spark evaporated when I saw how much ceremony the code required.

Re:Prediction: AI will make formal verification go mainstream by teiferer on Wednesday December 17, 2025 @02:28AM (#46299188)
> In my experience, the more information is encoded in the type system, the more effort is required to change code.

I would tend to disagree. All that information encoded in the type system makes explicit what is needed in any case and is otherwise only carried informally in peoples' heads by convention. Maybe in some poorly updated doc or code comment where nobody finds it. Making it explicit and compiler-enforced is a good thing. It might feel like a burden at first, but you're otherwise just closing your eyes and ignoring what can end up important. Changed assumptions are immediately visible. Formal verification just pushes the boundary of that.

Re:Prediction: AI will make formal verification go mainstream by blub on Wednesday December 17, 2025 @03:37AM (#46299577)
In practice it would be encoded in comments, automated tests and docs, with varying levels of success.

It’s actually similar to tests in a way: they provide additional confidence in the code, but at the same time ossify it and make some changes potentially more difficult. Interestingly, they also make some changes easier, as long as not too many types/tests have to be adapted.

Re:Prediction: AI will make formal verification go mainstream by gf000 on Wednesday December 17, 2025 @03:59AM (#46299712)
Constraints Liberate, Liberties Constrain. (I also recommend watching the presentation with the same title)
Re:Prediction: AI will make formal verification go mainstream by estebank on Wednesday December 17, 2025 @11:59AM (#46302085)
This reads to me like an argument for better refactoring tools, not necessarily for looser type systems. Those tools could range from mass editing tools, IDEs changing signatures in definitions when changing the callers and vice versa, to compiler modes where the language rules are relaxed.
Re:Prediction: AI will make formal verification go mainstream by jbritton on Wednesday December 17, 2025 @06:10PM (#46306889)
I was thinking about C++ and if you change your mind about whether some member function or parameter should be const, it can be quite the pain to manually refactor. And good refactoring tools can make this go away. Maybe they already have, I haven’t programmed C++ for several years.
Re:Prediction: AI will make formal verification go mainstream by jappgar on Wednesday December 17, 2025 @07:21AM (#46301152)
It is definitely harder to refactor Haskell than it is Typescript. Both are "safe" but one is slightly safer, and much harder to work with.
Re:Prediction: AI will make formal verification go mainstream by dnautics on Wednesday December 17, 2025 @08:40AM (#46301826)
> All that information encoded in the type system makes explicit what is needed in any case and is otherwise only carried informally in peoples' heads by convention

this is, in fact better for llms, they are better at carrying information and convention in their kv cache than they are in having to figure out the actual types by jumping between files and burning tokens in context/risking losing it on compaction (or getting it wrong and having to do a compilation cycle).

if a typed language lets a developer fearlessly build a semantically inconsistent or confusing private API, then llms will perform poorer at them even though correctness is more guaranteed.

Re:Prediction: AI will make formal verification go mainstream by gf000 on Wednesday December 17, 2025 @03:56AM (#46299696)
> but one reaps the benefits later thanks to more confidence when refactoring or adding code.

To be honest, I believe it makes refactoring/maintenance take longer. Sure, safer, but this is not a one-time only price.

E.g. you decide to optimize this part of the code and only return a reference or change the lifetime - this is an API-breaking change and you have to potentially recursively fix it. Meanwhile GC languages can mostly get away with a local-only change.

Don't get me wrong, in many cases this is more than worthwhile, but I would probably not choose rust for the n+1th backend crud app for this and similar reasons.

Re:Prediction: AI will make formal verification go mainstream by zozbot234 on Wednesday December 17, 2025 @04:47AM (#46299989)
The choice of whether to use GC is completely orthogonal to that of a type system. On the contrary, being pointed at all the places that need to be recursively fixed during a refactoring is a huge saving in time and effort.
Re:Prediction: AI will make formal verification go mainstream by gf000 on Wednesday December 17, 2025 @05:30AM (#46300293)
I was talking about a type system with affine types, as per the topic was Rust specifically.

I compared it to a statically typed language with a GC - where the runtime takes care of a property that Rust has to do statically, requiring more complexity.

Re:Prediction: AI will make formal verification go mainstream by lukan on Wednesday December 17, 2025 @02:36AM (#46299224)
"In my experience, the more information is encoded in the type system, the more effort is required to change code."

Have you seen large js codebases? Good luck changing anything in it, unless they are really, really well written, which is very rare. (My own js code is often a mess)

When you can change types on the fly somewhere hidden in code ... then this leads to the opposite of clarity for me. And so lots of effort required to change something in a proper way, that does not lead to more mess.

Re:Prediction: AI will make formal verification go mainstream by blub on Wednesday December 17, 2025 @03:33AM (#46299548)
There’s two types of slowdown at play:

a) It’s fast to change the code, but now I have failures in some apparently unrelated part of the code base. (Javascript) and fixing that slows me down.

b) It’s slow to change the code because I have to re-encode all the relationships and semantic content in the type system (Rust), but once that’s done it will likely function as expected.

Depending on project, one or the other is preferable.

Re:Prediction: AI will make formal verification go mainstream by sothatsit on Wednesday December 17, 2025 @03:58AM (#46299703)
Or: I’m not going to do this refactor at all, even though it would improve the codebase, because it will be near impossible to ensure everything is correct after making so many changes.

To me, this has been one of the biggest advantages of both tests and types. They provide confidence to make changes without needing to be scared of unintended breakages.

Re:Prediction: AI will make formal verification go mainstream by skydhash on Wednesday December 17, 2025 @08:41AM (#46301842)
There's a tradeoff point somewhere where it makes sense to go with one or another. You can write a lot of codes in bash and Elisp without having to care about the type of whatever you're manipulating. Because you're handling one type and encoding the actual values in a typesytem would be very cumbersome. But then there are other domain which are fairly known, so the investment in encoding it in a type system does pay off.
Re:Prediction: AI will make formal verification go mainstream by wolvesechoes on Wednesday December 17, 2025 @02:42AM (#46299255)
Soon a lot of people will go out of the way and try to convince you that Rust is most productive language, functions having longer signatures than their bodies is actually a virtue, and putting .clone(), Rc<> or Arc<> everywhere to avoid borrow-checker complaints makes Rust easier and faster to write than languages that doesn't force you to do so.

Of course it is a hyperbole, but sadly not that large.

Re:Prediction: AI will make formal verification go mainstream by el_pollo_diablo on Wednesday December 17, 2025 @05:01AM (#46300081)
Capturing invariants in the type system is a two-edged sword.

At one end of the spectrum, the weakest type systems limit the ability of an IDE to do basic maintenance tasks (e.g. refactoring).

At the other end of the spectrum, dependent type and especially sigma types capture arbitrary properties that can be expressed in the logic. But then constructing values in such types requires providing proofs of these properties, and the code and proofs are inextricably mixed in an unmaintainable mess. This does not scale well: you cannot easily add a new proof on top of existing self-sufficient code without temporarily breaking it.

Like other engineering domains, proof engineering has tradeoffs that require expertise to navigate.

Re:Prediction: AI will make formal verification go mainstream by GTP on Wednesday December 17, 2025 @06:22AM (#46300733)
In my opinion, programming languages with a loose type system or no explicit type system only appear to foster productivity, because it is way easier to end up with undetected mistakes that can bite later, sometimes much later. Maybe some people argue that then it is someone else's problem, but even in that case we can agree that the overall quality suffers.