78 comments

  • markhermeling3 hours ago
    Well written piece and certainly on-topic. There is a ton of conversation going on how AI can assist with formal methods.<p>Personally I am having great success using Ada SPARK. The SPARK subset has been greatly enhanced over the past years. I spent yesterday taking existing C repos, translating to SPARK, lifting it to SPARK Silver (absence of runtime errors) and then reporting the findings to the various maintainers. All as a background activity.<p>Result: integer overflows, typically on boundary conditions, some logic mistakes, again on boundary conditions.<p>I have not looked into Magmide, but I think the next breakthrough is a combination of something like SysMLv2 to describe architecture and requirements, TLA+ for modeling and formal proofs at the system level and then Lean or SPARK for the implementation.
    • irundebian55 minutes ago
      Thank you for your work on improving Ada&#x2F;SPARK projects!
  • spankalee11 hours ago
    Wow, I feel like Blaine is describe a language a lot like the one I&#x27;m working on now, Zena: <a href="https:&#x2F;&#x2F;zena-lang.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zena-lang.dev&#x2F;</a><p>I started Zena from wanting a TypeScript-like syntax that compiled to very efficient WebAssembly GC, and AssemblyScript had issues...<p>The motivation for targeting Wasm was as a good sandboxing and orchestration unit for AI-generated code. So, out of both general PL curiosity and enthusiasm, and an attempt to make a language that&#x27;s good for AI generation, I started adding what I thought were the best features from other languages with a lot of focus on correctness, structure, and optimizability: pattern matching with exhaustiveness checking, ADTs and sum types via sealed classes, value types, async cancelation &#x2F; structured concurrency, ownership and borrow checking for resources, unicode safe strings, and recently I added runtime contracts and I&#x27;ll start on refinement types and some kind of proof system soon.<p>The idea is exactly to take a mainstream and familiar-looking language and add more cutting-edge and academic features that help with software correctness.<p>I wrote about some of this here, though not the formal methods parts: <a href="https:&#x2F;&#x2F;zena-lang.dev&#x2F;blog&#x2F;2026&#x2F;09&#x2F;languages-for-the-ai-era&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zena-lang.dev&#x2F;blog&#x2F;2026&#x2F;09&#x2F;languages-for-the-ai-era&#x2F;</a>
    • equinumerous2 hours ago
      This looks interesting, I&#x27;ve been wanting a TypeScript-like language which compiles to native without all the baggage of JavaScript. Does it also support generating native binaries, or only WASM?<p>edit: I looked at the features on the website, I don&#x27;t see anything about multi-threading, is it supported? And how about interoperability with native libraries like SQLite&#x2F;QT&#x2F;etc?
    • BoingBoomTschak21 minutes ago
      Claude: 1,262 commits, 941,484 ++&#x2F;598,077 --
      • Izmaki17 minutes ago
        Your comment seems to imply something specific, but I guess you didn&#x27;t mean to say &quot;I have worked so little with AI that I think it&#x27;s still as bad as it was back in 2022&quot; which is what I understood from it.
    • latexr56 minutes ago
      &gt; Parsing, IR lowering, and scope resolution are all embarrassingly parallel<p><i>Embarrassingly</i> parallel?
      • blargg54 minutes ago
        <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Embarrassingly_parallel" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Embarrassingly_parallel</a>
  • porcoda11 hours ago
    Dafny, SPARK Ada, Why3, Verus, Frama-C, TLA+, etc. are all sort of in this direction for different languages and styles of verification. It is nice to see them getting attention now that LLMs make them digestible for a broader set of programmers. I&#x27;m not sure one can start with a goal of creating a &quot;mainstream&quot; language that is verification-oriented. Mainstreamness comes from adoption. I&#x27;d look at those past languages (like the ones I listed), and ask &quot;why did these not go mainstream&quot; or &quot;why did they not see broad adoption&quot;, and try some new ideas to address their gaps to see if a new one will catch on. But the &quot;mainstream&quot; part seems backwards as the goal - if it’s verifiable, ergonomic, flexible, and accessible, maybe it will go mainstream.
    • rramadass6 hours ago
      Lean 4 itself is a general purpose functional programming language with dependent types in addition to being a interactive theorem prover. Only the latter has been made famous&#x2F;popular by the mathematicians.<p>Idris, Agda are (like Lean4) functional languages and proof assistants. Dafny, Ada SPARK are imperative and automated solver languages.<p>Languages like C&#x2F;C++ which do not have powerful type systems nor are verification aware have tools like Frama-C, CBMC etc. to help with their formal verification. Rust also has some external formal verification tools.<p>With growing awareness of formal verification due to LLMs one (or more) of them is sure to become &quot;mainstream&quot;.
  • Buttons8405 hours ago
    The author has another blog post about Flow Effects[0]. They propose an open-ended set of effects you could attach to functions, and then verify, at compile time, that certain functions either do or do not invoke certain effects.<p>So if I had some functions like:<p><pre><code> foo_1 (must NOT access the HDD) foo_2 foo_3 foo_4 (does access the HDD) </code></pre> Only 2 of them are annotated with effects related to HDD access, but we can verify at compile time that foo_1 does NOT invoke foo_4, either directly or indirectly (we can verify this recursively).<p>Perhaps foo_3 calls foo_4, but we forgot to annotate foo_3 with the proper effect. No matter, because foo_3 would automatically inherit the effects of foo_4 by virtue of calling it.<p>This is just one of the feature the blog advocates for, and I think this feature alone would be quite simple and helpful in wrangling LLM code.<p>A nice thing about this is that it&#x27;s optional. You can annotate the effects gradually into existing systems.<p>[0]: <a href="https:&#x2F;&#x2F;blainehansen.me&#x2F;post&#x2F;flow-effects&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blainehansen.me&#x2F;post&#x2F;flow-effects&#x2F;</a>
    • blainehansen1 hour ago
      Yep. Original author here, it seems everyone completely missed the broader point I was making. Thank you for actually reading the post ha.
  • aenis11 hours ago
    30 years ago, my then boss, a PhD in industrial automation theory, told me formal verification of even simple systems is impossible due to the practically infinite number of states systems can occupy. I have been thinking about this a lot over the years, and I still think this is the case, even more so than before with the bloat that introduces insanely fuzzy edges to any state graph. I wonder if there is really any chance of this becoming a viable concept for systems more complex than a tic-tac-toe game.
    • yubblegum5 hours ago
      I&#x27;m surprised about this bit of wisdom imparted to you. Componentization addresses the &#x27;whole system state space&#x27; issue, does it not? In our modern societies, we routinely use insanely complex <i>mechanisms</i> built by very average workers. The key seems to be discreet parts. The state space of individual parts is not huge and its seems to me (disclaimer: not a PhD &#x2F;g) hierarchical systems can afford manageable state space complexity at each layer of the hierarchical system.
    • gf00010 hours ago
      I mean in most cases a mathematician is not going around and checking each and every case, why would software do that?<p>Formal verification a la cocq&#x2F;Agda&#x2F;lean works by constructive logic. (Disregard the middle paragraphs, I&#x27;m sure I&#x27;m not telling you anything new)<p>The type system is strong enough to encode various statements, even about variables (dependent type system, this is a valid <i>type</i>: a + b == b + a)<p>The only way to create an instance for this type is by proving the statement. The == <i>type</i> can only be created by trivially equal expressions, so it will accept a == a. So in the definition of the above you will go step by step, each step itself being accepted by the compiler, and at the end you get a proof and a compiling program, a bit similarly to how you would do it on paper.<p>So I guess it boils down to. Could a mathematician figure out some elegant proof for the system that somehow makes &quot;checking each state&quot; reduced to an easier statement? If yes, then formal verification can also do so. If no, then LLMs <i>may</i> be able to scale up what is feasibly provable, but there is no real alternative. Real world testing is just scratching the surface of the state space.<p>All in all, that&#x27;s why it&#x27;s paramount that systems are designed with complexity in mind. We can compose simple function into a simple function and have it explode in complexity, but it&#x27;s also possible to choose good primitives that are easy to &quot;mock out&quot; (often both in practice and theory) and not significantly increase the whole system&#x27;s complexity.
    • alexey-salmin10 hours ago
      It&#x27;s impossible to prove by brute-forcing the states of an arbitrary program, but it&#x27;s possible on practice for programs that were built with verification in mind: pure functions wherever applicable, state invariants defined and verified for every stateful part. If you aren&#x27;t able to prove a specific invariant at compile-time, you leave it as assertion which means you can still prove that either you get the correct output or an error, but never the wrong output or crash&#x2F;vulnerability.<p>I think today it&#x27;s actually more possible than ever. Writing programs in this way is hard and tedious but LLM can excel at that. I also think that a hybrid of Z3+LLM is orders of magnitude stronger than pure Z3. LLMs generated a formal proof of GRH, surely than can prove banking app correct.<p>The most vulnerable part that will remain will be the formalization of requirements. That&#x27;s impossible to solve fully because you never know what the human had in mind exactly when he ordered the program to be written.
      • dgrunwald5 hours ago
        &gt; The most vulnerable part that will remain will be the formalization of requirements. That&#x27;s impossible to solve fully because you never know what the human had in mind exactly when he ordered the program to be written.<p>I don&#x27;t think it necessarily needs to be solved. You can combine formal verification with tests! Use tests to show that the program occasionally does what you want. Use verification to show that the program never does what you don&#x27;t want (e.g. crash). The formal requirements can be quite weak this way, yet you still get a high level of assurance overall.<p>And you&#x27;ll be surprised how many invariants you&#x27;ll actually need for the simple &quot;don&#x27;t crash&quot; requirement -- to prove anything at all in a complex program, underlying components need to be correct, or it becomes hard&#x2F;impossible to prove anything at all about the code using those components.<p>So (admittedly without any personal experience other than studying this area an university more than decade ago) I expect even a simple &quot;don&#x27;t crash&quot; requirement gets you the majority of the formal verification benefits. (as long as you have some tests to ensure the implementation isn&#x27;t just returning a constant)
        • alexey-salmin2 hours ago
          Depends on the goal. If you just want software to be generally safer, with less bugs and higher quality then this is sufficient, yes.<p>If you want actual guarantees that e.g. money won&#x27;t disappear from your account some day or your messages won&#x27;t be read by a third-party, then formal verification alone doesn&#x27;t grant that.<p>Consider that Wifi WPA2 encryption was formally verified and yet broken. In simple terms the bug was in the protocol specification [1]. The &quot;code is the law&quot; crypto folks have even more fun stories to share.<p>[1] <a href="https:&#x2F;&#x2F;www.galois.com&#x2F;articles&#x2F;formal-methods-krack-vulnerability" rel="nofollow">https:&#x2F;&#x2F;www.galois.com&#x2F;articles&#x2F;formal-methods-krack-vulnera...</a>
        • black_knight3 hours ago
          Tests still encode requirements. The problem is exactly the same there. You can’t write tests if you don’t know the intended behaviour.
      • LtWorf9 hours ago
        Can these programs do anything useful?
        • nylonstrung6 hours ago
          Z3 was reportedly responsible for ~40% of pre-launch bugs caught for Windows 7
        • zappb49 minutes ago
          I’ve used Z3 to help with proving type system soundness in a DSL for RPCs. It’s pretty nifty.
        • Joker_vD9 hours ago
          Well, seL4 arguably <i>can</i> do something useful, so... yes, they can?
    • btilly10 hours ago
      We&#x27;re now able to do things like try to prove that no fuzz test with less than 32 MB of input will crash this program.<p>Formal verification of full behavior is impossible. But formal verification of important properties is within the reach of AI.
    • rienbdj7 hours ago
      Lots of those states will be numbers that can reasoned about using ranges, which helps somewhat.
    • Retr0id11 hours ago
      It&#x27;s possible to design with verifiability in mind (e.g. something like seL4)
    • mahboi10 hours ago
      Reminds me of pure functional languages. Sounds so nice, no icky state or side effects. Doesn&#x27;t actually help for real problems.
      • nylonstrung6 hours ago
        So none of the problems Nix solves are &quot;real&quot;?<p>Do you really think all the math proofs being done with Lean could work at all if it was imperative as opposed to a purely functional, dependentally typed language
      • mrkeen8 hours ago
        Tell me about a real problem you have.
        • mahboi51 minutes ago
          My job had me working on a custom version of ejabberd across like 2 years. For those unfamiliar, that&#x27;s in Erlang, which is probably one of the more convenient to use pure functional languages. It worked, but it was so cumbersome. BEAM is cool though, that&#x27;s why Elixir is popular.<p>Or like, make any web backend.
      • gf0009 hours ago
        How on earth they not help with real problems? Also, their very point is that <i>most</i> of the program is pure, but they most definitely have IO and other kind of side effects, it just lives at the very edge of the system.<p>Haskell has interesting uses in industry, but in general in the last decade or so the functional paradigm has become retrofitted to basically each mainstream language. Like java&#x27;s streams&#x2F;lambdas, algebraic data types in basically every modern language (rust), immutable by default, etc.
        • logicchains8 hours ago
          You&#x27;ve got to remember that the average developer is a Javascript or Python coder who lacks the mathematical ability to do even the most rudimentary abstract alegbra, and so cannot write or understand a production Haskell program, let alone understand how abstractions can eliminate whole classes of bugs.
          • nylonstrung6 hours ago
            This is the problem that excites me the most about agentic coding<p>I think software development and the tools underlying it could be wildly more powerful and exploit the underlying computer algebra more directly if dev tools didn&#x27;t have to cater to the lowest common denominator imperative language dev<p>LLMs are valuable to me not because they can replace the types of coding these devs do, but because they have a far more deeper &#x27;understanding&#x27; of the foundational math and algebra than could ever be expected of the average dev<p>There&#x27;s ways software engineering could engage much more directly with these concepts to produce more sound and expressive results if the &quot;user&quot; could be safely assumed to be an IMO level mathematician like a sufficiently powerful LLM is
            • rramadass5 hours ago
              &gt; LLMs are valuable to me not because they can replace the types of coding these devs do, but because they have a far more deeper &#x27;understanding&#x27; of the foundational math and algebra than could ever be expected of the average dev<p>This is the correct way to look at using LLMs for coding using their &quot;jagged intelligence&quot;. The key here is that the developer has to know enough of the formal methods mathematics to guide the LLM within proper guardrails such that it cuts down on the non-determinism. You don&#x27;t have to be a master mathematician who knows every single detail but just have enough conceptual understanding of the domain that you can create modular components and link them together using pre&#x2F;post&#x2F;invariants&#x2F;assertions and type-driven design. You keep overall control while leaving the drudgery to the LLM.<p>Here is one process methodology that i wrote up - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50319347">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50319347</a>
              • nylonstrung4 hours ago
                I like your post, it&#x27;s interesting that it centered on UML which is similar in shape to some formal concepts modelled in Lean: particularly Arrows, Quivers, String Diagrams and Petri Nets
          • gf0006 hours ago
            Java has sum and product types with exhaustive pattern matching, lambdas and streams, and is the next more widespread language just after python and js.<p>JS devs are doing monadic development (async is just that), and plenty of lambda passings, with the predominant frontend framework model being one where the view is a pure function of state, driven by reactive changes of the state.<p>Functional won vast areas in <i>mainstream</i> programming. What you are saying may have been true 15 years ago, but not anymore.
            • mahboi42 minutes ago
              Yes, what prevailed is doing a reasonable mix of paradigms instead of going all-in on something. Pure functional was never popular, but pure OOP was, and it sucked.
          • mahboi46 minutes ago
            I&#x27;m not the average developer. And by the way, I&#x27;ve heard that rant before, always from that one SWE on the team who&#x27;s going to be the hardest person to work with by focusing on all the wrong tiny details.
          • whattheheckheck8 hours ago
            Who is credentializing these devs, hiring them, and how are they getting by?
            • childintime7 hours ago
              AI has made them into 10x devs now. 10x the output, of putting together simple solutions to known problems with a few components. Basically following a recipy, like a suit is customized for each customer.
            • mrkeen7 hours ago
              It&#x27;s a simple majority issue.<p>If the majority say &quot;you don&#x27;t need a degree&quot; then you don&#x27;t need a degree.<p>If the majority believes in &quot;move fast and break things&quot; then things stay broken.
      • pluralmonad6 hours ago
        You run your program in a host that does all the icky side effect things.
    • anon-39889 hours ago
      Haha no. I am sorry but we still have issues with null pointers. So lets not get ahead of ourselves and try to model the real world. People thinking &quot;woe is me the world is so complicated lets keep using C&quot; is bizarre.
    • rramadass8 hours ago
      Your boss was not quite right.<p>There is a &quot;Correctness-by-Construction&quot; approach to programming which allows one to severely restrict the state space of a program from the beginning such that every statement&#x2F;block&#x2F;function only operates on a much smaller &quot;valid&quot; set of program sub-states. This is using classical logic via predicates as explained by Hoare Triples, Dijkstra&#x27;s wp-calculus, Morgan&#x27;s refinement calculus and later Meyer&#x27;s Design-by-Contract.<p>To do deductive verification statically, the basic idea is to group all computation paths (i.e. sequence of state transitions) over the entire program state space into a much smaller set of logical constraints (aka verification conditions) which is then handed off to a SAT&#x2F;SMT solver to be proved&#x2F;disproved.<p>An alternative is constructive logic using types and lambda calculus as pointed out by a sibling commentator.<p>There have been lots of systems which have been formally proved&#x2F;verified to various extents&#x2F;levels as can be seen in <i>Industrial-Strength Formal Methods in Practice</i> by Hinchey&#x2F;Bowen and many other similar books.
      • aenis5 hours ago
        I think what he likely meant was: its impossible to do formal verification of programs the way they are written and deployed.<p>- ignoring how programs are written, they are usually compiled and linked, which introduces states unknown to the original programmer,<p>- ignoring how they are compiled, they are executed in environments with variability, including temporal; I remember tracing a problem related to a longer trace on one of the paths of the PCB, and materially different outcomes depending on which trace the signal happen to travel on (it was a high-frequency P-I-D controller, but for whatever reason the microcontroller could transmit the same signal on one or the other path). The particular bug was traced with a oscilloscope, by a graybeard, not algebra.<p>The way I see it, in order to get verifiability to actual programs, one would need to cover the state space of the entire system - algo, compiled binaries, operating system, hardware, and the weather on the other side of the planet for a good measure.<p>I am not an expert in the area, in any way - just a regular software dude. Appreciate all the responses in this thread!
        • rramadass5 hours ago
          See my comment here - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50666297">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50666297</a><p>It depends upon what all parts of a &quot;system&quot; you want to encompass under &quot;formal verification&quot;. There is nothing preventing you from verifying everything from hardware all the way to user-facing software or only certain layers in the chain.<p>As an analogy, the FIPS&#x2F;Common Criteria security standards have multiple levels of certification going from simple signed binary blob to a complete hardware and software lockdown system.<p>You can do the exact same thing with formal verification of your system if needed. LLMs have made this possible if driven properly.
      • drutaTushar7 hours ago
        I don&#x27;t think only verification is enough for safe programs. How program behaves when error happens is probably more important than happy path logic. Programming is layers of abstraction on top several more - unless all of them are formally verified - program can be never be truly verified. Think of different hardware, software, time, timezone, os&#x2F;drivers&#x2F;shell&#x2F;vm&#x2F;container&#x2F;language runtime versions etc.
        • viraptor5 hours ago
          &gt; Think of different hardware, software, time, timezone, os&#x2F;drivers&#x2F;shell&#x2F;vm&#x2F;container&#x2F;language runtime versions etc.<p>The original comment was about industrial automation and in that environment a lot of those issues are not that relevant. Unless we&#x27;re talking really big systems, a lot of it is very well specified controllers which run without shell&#x2F;VM&#x2F;container&#x2F;runtime. They just talk to some fancy general GUI on a different chip&#x2F;board to load the data&#x2F;config. But the state space of a lot of actual practical hardware doing the work is not that complex. Bare metal, careful io timing, state transitions and some control loops gets you very very far.<p>To be clear, there are bigger, complicated systems, but simpler devices with a clock, PID loop and I2C outnumber them by likely a few orders of magnitude - we can start there.
          • drutaTushar3 hours ago
            It can definitely help if scope&#x2F;runtime is limited. I myself have played with something similar : <a href="https:&#x2F;&#x2F;github.com&#x2F;statelyai&#x2F;xstate" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;statelyai&#x2F;xstate</a> Modelling entire interaction as state machine so program always remains&#x2F;lands in known states. IMO FSMs probably better suited as it has error modelling and handling inbuilt.
        • rramadass5 hours ago
          That is the wrong way to think about Formal Methods&#x2F;Specification&#x2F;Verification.<p>Verification is not about &quot;happy path logic&quot; but all computation paths (happy, error, cross-layer etc.) over the entire state space of a &quot;system&quot;.<p>The system can include everything from hardware circuits all the way to distributed applications if needed. Across layers&#x2F;components it works by composition of contracts where a higher-layer <i>guarantees</i> based on its lower layer&#x27;s <i>contract guarantees</i>. The book i listed gives examples.<p>See also my comment here - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50664740">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50664740</a>
          • drutaTushar3 hours ago
            Partially I agree. But when it comes to errors&#x2F;not-happy path - I am talking about pesky issues, driver&#x2F;hardware errors which can never be mapped to any &quot;Type&quot;. There is a reason every statically-typed programming language has Root Error type. For eg. Java has `Throwable` with two subtypes - `Error` and `Exception`. A `RuntimeException` is type that does give handle to programmers and JVM guarantees that it will be thrown. But sometimes one has to catch root &quot;Throwable&quot; or &quot;Error&quot; types in order to prevent JVM crash. It will be tedius to have formal verification theorems referring to &quot;Throwable&quot; in order to be formally verifiable. I guess It can be done - only if languages like Lean are expressive enough - but only using LLMS, for humans it will be quite complex. IMO - not worth. It will be repeat of &quot;elegant&quot; functional programming languages failing to go mainstream.
            • rramadass1 hour ago
              My previous comments already pointed to Meyer&#x27;s &quot;Applying Design by Contract&quot; paper which shows how to integrate exception handling with DbC. Here it is directly - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=48358691">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=48358691</a><p>Basically, you have to keep your module internals &quot;pure&quot;, distinguish between domain exceptions (i.e. checked) vs. environmental runtime exceptions (i.e. unchecked) and push all &quot;impure&quot; operations to the boundary of the module.<p>Also see the following paper which shows how to formally model hardware faults;<p><i>Faulty Logic: Reasoning about Fault Tolerant Programs</i> - <a href="http:&#x2F;&#x2F;www.cs.princeton.edu&#x2F;~dpw&#x2F;papers&#x2F;faultylogic_esop2010.pdf" rel="nofollow">http:&#x2F;&#x2F;www.cs.princeton.edu&#x2F;~dpw&#x2F;papers&#x2F;faultylogic_esop2010...</a>
    • lou13064 hours ago
      A lot has changed in 30 years. Symbolic model checking was just in its academic infancy (early &#x27;90s), and abstraction techniques, especially counterexample-guided abstraction refinement (CEGAR, early &#x27;00s) were significant breakthrough. All these ideas converged into e.g., SLAM which is what Microsoft pushed for Windows driver verification, which I believe should fit your &quot;more complex than a tic-tac-toe game&quot; goalpost.<p>And this was 25 years ago! We now have advanced formal techniques for inductive reasoning like IC3 that run on top of SMT solvers, enabling verification of (some) bona-fide infinite state systems. Of course the problem itself is undecidable in the general case, but in practice these tools do get the job done. We have formally verified OS kernels, Lean kernels, SAT solvers out there :)
    • TacticalCoder2 hours ago
      [dead]
  • hresvelgr12 hours ago
    &quot;Beware of bugs in the above code; I have only proved it correct, not tried it.&quot; — Donald Knuth<p>Formal correctness does not guarantee desired function. People have written TLA+ specs for their software[1] and not have it materially improve the quality or reliability. You cannot just throw formal verification at a problem.<p>I am very much of the opinion that crap code is an issue of organisation and aesthetics, and that <i>can</i> be automated. This is something that is enforced by frameworks, and despite the popular consensus that LLMs are good at frameworks because of training data, I make another argument that LLMs are good at them because frameworks massively restrict the possibility space of code that can exist and enforce a consistent organisation and aesthetic. The solution as I see it is to make more restrictive frameworks that have a higher chance of producing desired functionality, then afterward we can worry about correctness.<p>[1] <a href="https:&#x2F;&#x2F;jepsen.io&#x2F;analyses&#x2F;particledb-1.1.4" rel="nofollow">https:&#x2F;&#x2F;jepsen.io&#x2F;analyses&#x2F;particledb-1.1.4</a>
    • FridgeSeal11 hours ago
      &gt; People have written TLA+ specs for their software[1] and not have it materially improve the quality or reliability<p>Given how vibe coded the rest of that whole DB appears to be, and the number of holes the Jepsen test found, I’m not terribly sure I’d trust, or use it as an example of “used formal methods”.<p>A better example would be the AWS S3 team who used TLA+ to formally verify their permissions model, especially around whether something was publicly accessible.
      • fmbb10 hours ago
        You don’t need an example of “used formal methods” to push back on the text in OP.<p>The first paragraph is<p>&gt; To save software engineering from LLMs, we need a mainstream verifiable language<p>Formal verification will not save us from LLMs, whatever it is we want to try and save (human civilization or programmers or users).
        • Loquebantur6 hours ago
          The author&#x27;s text is actually about <i>saving us from our misconceptions about LLMs</i>.<p>Formal verification is one <i>necessary</i> building block, not the whole structure needed. You want to do Verification <i>and</i> Validation.<p>Currently, people have dollar signs over their eyes and don&#x27;t see the perils their greed is leading them into.<p>You cannot substitute human expertise with LLMs. That&#x27;s like believing your rational brain was superfluous and you&#x27;d be better off without it, relying on &quot;others&quot; (LLMs) instead.<p>Nobody in the public sphere has thought that through really. Apparently, they&#x27;ve become so accustomed to other people solving their problems when paid, they just assume it would be the same or better with &quot;non-people&quot;, who don&#x27;t even get paid.
      • ForHackernews7 hours ago
        This AWS S3?<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=JUM77vJzM54" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=JUM77vJzM54</a><p><a href="https:&#x2F;&#x2F;www.fogsecurity.io&#x2F;blog&#x2F;mistrusted-advisor-public-s3-buckets" rel="nofollow">https:&#x2F;&#x2F;www.fogsecurity.io&#x2F;blog&#x2F;mistrusted-advisor-public-s3...</a>
    • raincole9 hours ago
      &gt; Formal correctness does not guarantee desired function<p>Rust doesn&#x27;t guarantee desired function either. It doesn&#x27;t mean that average rust program has the same probability to have segfault at runtime as a similar program written in C.
    • lenkite8 hours ago
      &gt; People have written TLA+ specs for their software[1] and not have it materially improve the quality or reliability<p>That particleDB link is VERY unconvincing. All the folks I know who wrote a TLA+ spec have said that it helped them discover bugs. Just that it was a massive pain to keep maintaining code and spec independently.<p>However, I am confused on why new PL is needed. Why not just improve lean and its libraries so that it becomes a standard big-software language like Go&#x2F;Java&#x2F;Rust ?
      • viraptor5 hours ago
        There&#x27;s another alternative - let most of the spec be derived from the code. Verus for example allows you to wrap your code in a verus!() macro and get a lot of the work for free and guaranteed to be in sync with the code. Even without any custom proofs, just that part provides a no-crash guarantee. (You still need to do some work though - it&#x27;s not free)
        • AnimalMuppet2 hours ago
          The normal pattern is that the spec is shorter than the code, and therefore easier to get correct. That&#x27;s why it&#x27;s useful. Deriving the spec from the code therefore seems like going the less-useful direction.
      • zappb2 hours ago
        Languages like TLA+ lay at the opposite end of the spectrum of how programs can be optimized. The more space you leave for optimization, the larger the search space becomes in evaluating the TLA models. The smaller the space you use for the models, the more constrained your optimizations become. It seems as though the two can’t be combined without finding an appropriate balance point at which point you’d probably have something very similar to existing languages.
      • logicchains8 hours ago
        &gt;Why not just improve lean and its libraries so that it becomes a standard big-software language like Go&#x2F;Java&#x2F;Rust ?<p>Lean wouldn&#x27;t be able to match Rust in performance without a fundamental restructure of its core calculus.
        • thesz2 hours ago
          <p><pre><code> &gt; Lean wouldn&#x27;t be able to match Rust in performance without a fundamental restructure of its core calculus. </code></pre> Why so?
          • nextaccountic1 hour ago
            Two things<p>Lean is garbage collected and you don&#x27;t control the layout of types in memory (and everything is boxed)
    • kubb10 hours ago
      I don&#x27;t get this broken logic. A software engineer should have elementary reasoning skills.<p>&quot;Formal correctness doesn&#x27;t guarantee desired function, therefore we don&#x27;t need it.&quot;<p>But in reality it will actually catch bugs, in addition to other verification methods, and give more confidence in software.
      • onion2k9 hours ago
        The flaw in people&#x27;s thinking is &quot;Formal verification means bug-free, and bug-free means it works correctly.&quot; ignoring the fact that most things that people call bugs are actually the code working correctly <i>as it was written</i> but it was written to do something that&#x27;s either not what the requirement says or that the requirement doesn&#x27;t actually say what the application should really do.<p>Requirements, code, verification, etc are a process to turn a human mental model of something into an process a computer can do. You can verify the computer&#x27;s side of that all day long but if the human side is wrong no amount of verification is going to make your software do what you wanted it to do.
        • neilwilson6 hours ago
          We don&#x27;t really have a verification crisis, we have a validation crisis.<p>Ever more cycles spent checking we&#x27;re building the thing right doesn&#x27;t address the issue of whether we&#x27;re building the right thing.<p>The debate has always been whether running cycles on &quot;compile&quot; which is checking against a largely fixed set of rules is better than &quot;testing&quot; which is checking against a largely dynamic set of rules. &quot;Testing&quot; tends to be able to do validation better than &quot;compile&quot;.<p>That&#x27;s been the running debate between dynamic typed and static typed computer languages for the last half century or so. It swings backwards and forwards.<p>Like centralised vs distributed I don&#x27;t see there being &quot;a&quot; answer other than &quot;it depends&quot;.
          • Buttons8405 hours ago
            &gt; the running debate between dynamic typed and static typed computer languages<p>Actually, I haven&#x27;t seen a good dynamic vs static types debate for a long long time. Some of these fundamental debates have become tired and people don&#x27;t debate them anymore, which is understandable.<p>But, in the age of LLMs, maybe it&#x27;s time to have that debate again.<p>The major disadvantage of typed languages is they&#x27;re harder to write at times, the type checker gets in your hair. But if LLMs write the code, what argument remains against static types?
            • matltc2 hours ago
              Ruby and python were my introductions to programming. I picked up C and found the type system to just be annoying. Then I picked up a TS Node project that used Zod and it changed my perspective.<p>One of the primary structures that the project concerned itself with was written as a big fat z.object with all optional keys. In the logic, there were all kinds of runtime checks as nested if&#x2F;else ifs looking for the presence of the keys and branching on their value if they existed. I discovered z.discriminatedUnions and realized that this could be checked once at compile time by defining the possible states of this structure, which progressed monotonically from one state to the next, never backwards<p>The logic then became a single comprehensive switch statement with an assert never default. Vastly simplified the rest of the application and obviated the nullish guards that were interspersed throughout the front- and backend logic. Life changing.<p>Now, I only use dynamic languages for trivial scripting or where the type system would be unneeded overhead. I am finding this to be rarer as my ambitions grow.<p>Also, the benefits of a good LSP provided by strongly typed languages with a robust ecosystem are huge. Makes reasoning about code so much simpler for me when I can peek any object&#x27;s type in my IDE and go to definition. Ruby LSP is awful at this, you can&#x27;t rename a variable globally nor can you go to a function&#x27;s implementation if it cannot be determined. Not so with out-of-the-box tooling in strongly typed languages.
            • win311fwg4 hours ago
              <i>&gt; But if LLMs write the code, what argument remains against static types?</i><p>If by static types you mean where the verification language and the implementation language are intertwined, one has to ask: If LLMs write the code, what advantage is there to that intertwinement? That was a convenience function for human authors. LLMs don&#x27;t care and can just as easily keep track of them as separate concerns.
              • onion2k3 hours ago
                <i>LLMs don&#x27;t care and can just as easily keep track of them as separate concerns.</i><p>Only if they have the context of every part of the code though. If you put type hints in your code then the LLM can understand the shape of what some code is supposed to send&#x2F;receive without having to trace back through the code to the source of that data. That means a model with a <i>much</i> context window can successfully change it. That&#x27;s both cheaper and faster.<p>Also, we can still do things without LLMs. You can compile and test code as a part of CICD, and having something doing a static type check is a good quality gate.<p>Maybe in a future where we run models locally that&#x27;s not an issue, but if Anthropic 100x their prices tomorrow I&#x27;ll be glad I left <i>some</i> aspects of development working without LLM input.
                • win311fwg3 hours ago
                  <i>&gt; Only if they have the context of every part of the code though.</i><p>Why?<p><i>&gt; You can compile and test code as a part of CICD, and having something doing a static type check is a good quality gate.</i><p>Nothing about separating concerns precludes that, of course. Most serious validation languages already avoid the intertwinement. It&#x27;s not exactly a new concept. The trouble is that humans often find it hard to keep track of both at the same time, so we trick them into thinking it is one language to get around that (typically at the cost of lesser validation). But LLMs do not have the same trouble.
                  • onion2k1 hour ago
                    <i>Why?</i><p>A type hint says &quot;only accept things that look like this&quot; and a compiling or a type checker can statically analyse the code to make sure that&#x27;s valid everywhere. If you don&#x27;t have that then the LLM would need to track back through the call tree to the originating point that defines the shape of the thing being passed to understand if it&#x27;s valid all the way through the app in order to know that the data is correct. As it can&#x27;t know where the originating call starts, it needs context of everything. It might only read the code it needs to read, and that can be done easily with an agent driving a small model, but it still needs complete access to every part of the app in order to trace what it needs to. With type hints it can just run the type checker to validate the code is OK and then trust the type hints.
                    • win311fwg1 hour ago
                      <i>&gt; If you don&#x27;t have that</i><p>Why wouldn&#x27;t you have that? It is looking more and more likely that you accidentally replied to the wrong thread.
                  • AnimalMuppet1 hour ago
                    LLMs have a limited context window. They also have trouble keeping track of what&#x27;s going on &quot;elsewhere&quot;, at least if there&#x27;s enough of it.
              • jwilliams3 hours ago
                &gt; LLMs don&#x27;t care and can just as easily keep track of them as separate concerns.<p>I agree. In fact I&#x27;d argue adding more representations (esp generative ones) just increase the chance of drift[^1].<p>Where types are useful is cross-cutting concerns. That is, interfaces between components&#x2F;systems&#x2F;whatever. I suspect the size of that boundary will grow with the capability of AI though.<p>1: <a href="https:&#x2F;&#x2F;jonathannen.com&#x2F;views-of-the-same-thing&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jonathannen.com&#x2F;views-of-the-same-thing&#x2F;</a>
    • thesz2 hours ago
      TLA+ proofs are detached from actual implementation.<p>If you have proofs attached to an actual implementation, things get much, much better.<p>For example, you can have type-checked distributed APIs (you can&#x27;t omit a parameter for an HTTP request), you can have adherence to protocols checked at compile time (API calls sequences, etc), you can have many other things to be checked before any program run.
    • latentsea11 hours ago
      Quite ironically I see formal methods being extremely key to your central argument. That is, the design should be started by modelling with some formal language that then gets expanded into an implementation. I fully agree about massively restricting the possibility space of code as being why they work. I&#x27;ve found that to basically be the only thing that produces consistently good results in the face of all the non-determinism. The entire codebase doesn&#x27;t fit into the context window though, but formal models of it can act as some form of lossy compression that helps it fit into the context window better. I think formal methods definitely have a role to play, as to do anything that restricts what the valid moves are like frameworks and fitness functions etc.
      • kbr-10 hours ago
        This is exactly what I do in $dayjob. I call it Property Driven Development.<p>I start with prose requirements, then use Elenxis (<a href="https:&#x2F;&#x2F;github.com&#x2F;kbr-&#x2F;elenxis" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kbr-&#x2F;elenxis</a>) to translate into formal Lean model.<p>Then I state signatures and conjectures that the spec must have. Properties that the future implementation must hold. No implementation yet.<p>Only once all conjectures are there, we are ready to roll.<p>If I write in Lean, I can now fill in the signatures&#x27; implementations. Then prove theorems. Proof doesn&#x27;t go through =&gt; bug. Fix, retry, repeat.<p>If I write in an inferior language, there is extra Intermediate step: translating the conjectures into property test in the language. Only once these are ready, I can write implementation.<p>You must not write implementation before having all conjectures stated -- otherwise the implementation will bias your thinking, and you will try to prove properties of your implementation instead of what you needed.<p>All of the above applies equally to AI agents.
        • nextaccountic56 minutes ago
          But then, is the application itself written in Lean?<p>One could maybe combine this with Rust code verified by Aenas (which runs Lean proofs)
        • latentsea9 hours ago
          Interesting. I work in bog standard LOB SaaS type businesses my whole career, so zero practical experience with formal methods, but a growing interest in them due to how I see the industry trending towards them. Can I ask... in your case, what is $dayjob related to that you find yourself operating this way already? Finance? Aerospace? Just curious...<p>&gt; You must not write implementation before having all conjectures stated -- otherwise the implementation will bias your thinking, and you will try to prove properties of your implementation instead of what you needed.<p>Most software engineers don&#x27;t really have a background in it, and tbh I kinda don&#x27;t know where to start, and have heard that right now if you&#x27;re already experienced with formal methods then you can get great results out of approaches like this with LLMs, but if you just vibecode up the Lean or TLA+ etc then you&#x27;re not going to get out of it what you were expecting. I suspect your statement here is exactly the kind of thing that makes all the difference, but I don&#x27;t know how to know what the other things that make the difference are. Any other pointers?
          • hackermailman6 hours ago
            You can use &#x27;lightweight&#x27; formal methods too like Alloy or Forge <a href="https:&#x2F;&#x2F;forge-fm.github.io&#x2F;book&#x2F;2026&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;forge-fm.github.io&#x2F;book&#x2F;2026&#x2F;index.html</a>
          • kbr-5 hours ago
            &gt; Can I ask... in your case, what is $dayjob related to that you find yourself operating this way already? Finance? Aerospace? Just curious...<p>Nothing so critical.<p>My first serious full-time job was at ScyllaDB, where I worked on distributed database system core. My main area of interest (carried over from University) were distributed algorithms. There, formal methods are basically necessary; if you design a distributed algorithm and don&#x27;t use formal methods, you *will* fuck up. In ScyllaDB I used TLA+.<p>Today I have a different job but my passion for formal methods didn&#x27;t go away.<p>I updated my HN profile with link to my website, you can look me up.
            • latentsea1 hour ago
              Oooh that makes sense. Databases are one area I have definitely heard such methods being used. I remember seeing a talk on TLA+ by the CosmosDB people and thinking it was really cool.
              • kbr-1 hour ago
                Yes. But formal methods, especially right now with agentic AI, are, I believe, a fucking superpower, no matter what you&#x27;re doing. Even if I wrote a simple CRUD web app, I would start with a formal Lean contract. (And producing such a contract with my Elenxis tool + frontier model is trivial.)<p>Imagine all software you build is bug-free from the start. No technical debt, ever.
                • kbr-1 hour ago
                  I even made <a href="https:&#x2F;&#x2F;github.com&#x2F;kbr-&#x2F;kotlean" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kbr-&#x2F;kotlean</a> so I could make Android apps in Lean.
                • latentsea40 minutes ago
                  I&#x27;m onboard with this vision, and fully in agreement.
          • rramadass8 hours ago
            You might find some of my previous comments useful.<p>On <i>Formal Methods Thinking&#x2F;Levels</i> and <i>(In)Formal Methods</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50478624">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50478624</a><p>On <i>Design By Contract</i> (DbC) - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50108540">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50108540</a><p>On <i>Combining Tests and Proofs with Contracts</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50108206">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50108206</a><p>On <i>Correctness-by-Construction</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49613696">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49613696</a><p>Note that the above is based on using classical logic predicates to &quot;steer&quot; the program through its &quot;state space&quot;. This is the more fundamental and &quot;simpler&quot; approach since it uses only First-Order Logic.<p>Another way is to use the Type System (constructive logic, dependent types in Lean4 etc.) to embed the above directly into the program types. This is harder since you need Typed Lambda Calculus, Higher-Order Logic and need to think quite differently. For this you can read <i>Types and Programming Languages</i> by Benjamin Pierce and&#x2F;or any number of lambda calculus books. The Curry-Howard Correspondence helps you understand this if you have some idea of the above state space approach.<p>Finally, if you want to <i>know&#x2F;study</i> the whole of above you need to read <i>Understanding Formal Methods</i> by Jean-Francois Monin - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50506655">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=50506655</a><p>It is all overwhelming at first if you are completely new to it so use it as a roadmap. Survey all of the above to get a grip on the jargon, notation and application and then choose your approach&#x2F;logic&#x2F;tool based on your interests&#x2F;needs.
            • kbr-1 hour ago
              I studied from this during my University days: <a href="https:&#x2F;&#x2F;www.cs.cmu.edu&#x2F;~rwh&#x2F;courses&#x2F;clogic&#x2F;www&#x2F;handouts&#x2F;curry-howard.pdf" rel="nofollow">https:&#x2F;&#x2F;www.cs.cmu.edu&#x2F;~rwh&#x2F;courses&#x2F;clogic&#x2F;www&#x2F;handouts&#x2F;curr...</a>
            • latentsea1 hour ago
              Thanks, appreciate this!
        • bloopernova9 hours ago
          Thank you for an interesting comment! Do you have any recommendations on web articles or other examples similar to what you do?
        • whattheheckheck8 hours ago
          Can you not do this with normal tests?
          • kbr-5 hours ago
            Define &quot;normal test&quot;.<p>Property test can state general properties about the signature being tested. E.g. let&#x27;s say you&#x27;re proving correctness of addition in an abelian group. You can state Associativity, Commutativity, Identity Element (0), Additive Inverse, Closure, Cancellation Property, as properties of the signature, in the Property Testing framework you&#x27;re using (Haskell: QuickCheck, Python: Hypothesis, and so on). The framework will generate test cases using a specially-crafted random distribution (one crafted to maximize the chance of catching a bug), then if it finds a failing case, it will shrink it, so your counterexample is minimal.<p>It is a &quot;normal test&quot; except that you use a powerful framework to give you these mechanisms.<p>It still depends on randomness, so it&#x27;s still inferior to a theorem, which gives you 100% correctness.
      • hresvelgr11 hours ago
        &gt; Quite ironically I see formal methods being extremely key to your central argument.<p>Formal verification is a useful tool, but I don&#x27;t think it meaningfully combats &quot;slop,&quot; which I argue is primarily disorganised, voluminous, and lacking in aesthetics.<p>&gt; That is, the design should be started by modelling with some formal language<p>I would make sure what I am developing demonstrably works before formally verifying the characteristics of the system.
        • weinzierl10 hours ago
          The question is, why do we care about slop in the first place? If we ignore the ideological and emotional reasons, I think it boils down to three things:<p>1. The slop is incorrect<p>2. The slop is bloated<p>3. The slop is not human readable<p>Formal verification together with human validation is the answer to point 1. The second point needs additional measures to keep the artificial author in check which is in my experience quite easy to accomplish.<p>If these two are in place I found that human readability falls out mostly for free.<p>So, to summarize, in my opinion formal verification together with measures to keep the code minimal and concise <i>is</i> our best way to tackle slop.
          • Terr_8 hours ago
            Assuming a narrow definition of &quot;incorrect&quot;, I would add:<p>4a. The slop has been generated with rules and processes, ones that needed actual decisions and approval which never happened.<p>4b. Nobody reading the slop can distinguish between deliberate things that were chosen and approved, versus accidental things which were blindly generated and kept.
            • weinzierl1 hour ago
              This is all covered by 2. If you keep your source minimal you have no problem. Doing it is not trivial, but it is doable.
            • latentsea1 hour ago
              4b is a real bitch even on very short timescales, let along medium and long ones. It compounds so fast.
          • latentsea9 hours ago
            Personally, I think the slop is very dangerous to a codebase both when humans produce (and they do!!!) and when AI produces it because the uncontrolled growth of entropy in a codebase has this funny way of just completely trashing your ability to get anything done in it. Like, now there&#x27;s two ways to do the same thing, so.. which one do you pick? Pick at random, now there&#x27;s 30% this way and 70% that way, so probably the 70% one will get picked, but there&#x27;s this non-zero chance that now a third way is invented! When you think about next-token prediction, it&#x27;s so heavily conditioned on the context, that crappy context equals crappy results, and uncontrolled growth of entropy results in crappy context.<p>TL;DR it impacts the trajectory of the LLM negatively in a massive way IMHO.
    • vikramkr11 hours ago
      The same limitation is true of every other method of verifying and validating software too. You can have 100% unit test coverage and still have nothing work. It&#x27;s another tool in the toolkit and a pretty powerful one
      • alphanumeric011 hours ago
        The &quot;it&#x27;s not a silver bullet, thus not worth mentioning ever again&quot; argument is getting tiresome.
        • vikramkr2 hours ago
          I think the problem is that rn a lot of people with experience with formal verification are theoreticians who aren&#x27;t familiar with engineering pragmatism. Yes it&#x27;s true that because something is formally verified that doesn&#x27;t mean it&#x27;s secure. The way we deal with that is, there are swarms of AI agents trying to hack everything of they succeed well there&#x27;s your peer review. And in theory is is possible it&#x27;s so subtly wrong that no AI at current capability levels can figure out the flaw and the system seems secure? Well in that case, mission accomplished it&#x27;s not hacked. But what about if there&#x27;s more powerful AI down the line? That&#x27;s why we have to make sure to get the smarter AI first
    • remywang11 hours ago
      &gt; ParticleDB’s home page advertised that ParticleDB was “formally proven” with a TLA+ proof. However, during our collaboration no TLA+ specification was available. It is unclear what properties might be proven, or whether they described ParticleDB as built.<p>That link is a pretty weak strawman. Also TLA+ is special in that it (usually) does not directly verify the implementation but a model of it.
      • latentsea10 hours ago
        You can instrument the code to capture production traces and then verify them against the TLA+ model though. I think a programming language with that baked in as a first class citizen would be compelling. That&#x27;s sort of the direction this stuff is heading it feels like anyway. Model in a smaller language that&#x27;s more precise, fits in the context window better, and can explore the state space much more quickly than reasoning token by token, then build the thing based off the model, then validate that the implementation conforms to the model.
      • phillc7311 hours ago
        [dead]
    • ggm11 hours ago
      Our first year CS Pascal lecturer in &#x27;79 used to quip &quot;I&#x27;ve compiled this but not run it&quot; and I used to think this was savage but I now see he was simply repeating the mantra. The Fortran I did on cards in &#x27;76 they insisted we run, and learn the cost of sloppy code in the debug cycle through batch processing cycle costs.
    • cowlevel4 hours ago
      Linked article says they only said they had a TLA+ proof but none was actually provided and the rest of the article makes it clear that ParticleDB is pure vibeslop. I wonder who paid them to test it.<p>Favourite line:<p>&gt; Under normal operation, ParticleDB was slow, deadlocked, and crashed without warning.
    • ilumanty6 hours ago
      Thank you. It&#x27;s ridiculous how some people giddily reach for anything that remotely smells like a solution while unaware that they complicate things even more.<p>Loosely related: the German TÜV now wants to certify AI systems <a href="https:&#x2F;&#x2F;www.tuev-verband.de&#x2F;pressemitteilungen&#x2F;tuev-organisationen-bringen-ki-zertifizierung-in-den-regelbetrieb" rel="nofollow">https:&#x2F;&#x2F;www.tuev-verband.de&#x2F;pressemitteilungen&#x2F;tuev-organisa...</a> (original in German, use your favorite translation tool)<p>I wonder whether such a certificate will be a future requirement for selling or running certain hosted software. It would be hilariously German when the certificate then mandates using formally verifiable programming languages.
    • ordu5 hours ago
      <i>&gt; People have written TLA+ specs for their software[1] and not have it materially improve the quality or reliability.</i><p>They have <i>said</i> they wrote them, but I doubt it. The quote from the report:<p><i>&quot;We found several incompatibilities or bugs involving static or dynamic type safety, or behaviors that would normally have been caught by static analysis of a query, such as referring to a nonexistent column. These issues occurred with a single server, single client, and no faults.</i><p>They failed to catch references to a nonexistent column with a formal proof? I doubt it, the more likely explanation they hadn&#x27;t proven their code, they probably did something that allowed them to claim that they wrote TLA+ specs, and stopped at that.<p>Formal proof is a static analysis on steroids, if it can&#x27;t catch bugs that can be caught by a static analysis then what the point of it?<p>The report doesn&#x27;t answer how it happened (I presume) because of: <i>&quot;during our collaboration no TLA+ specification was available. It is unclear what properties might be proven, or whether they described ParticleDB as built.</i>
    • ransom15382 hours ago
      &quot;You cannot just throw formal verification at a problem.&quot;<p>Oh. Look external stripe calls are hanging. (HALT problem)
    • globular-toast11 hours ago
      Frameworks often lead to crap code because people don&#x27;t recognise when they&#x27;re doing something the framework isn&#x27;t good at. Do we expect LLMs to be better? So far they&#x27;re a lot worse and will happily churn out reams of code that would make even the worst programmer stop in their tracks questioning whether this is right.
    • behnamoh11 hours ago
      &gt; Formal correctness does not guarantee desired function. People have written TLA+ specs for their software[1] and not have it materially improve the quality or reliability.<p>Boris said they heavily use TLA+ for Claude Code and they&#x27;ve noticed an improvement. Comparing CC with 6 months ago, it has indeed improved in terms of reliability and screen flicker, etc.
    • leecommamichael10 hours ago
      As a “creative programmer” I resonate with this strongly. While I think things like Lean and Rust are valuable tools which should exist, they only represent added friction TO ME.
  • jupake10 hours ago
    Isnt this exactly what Ada language was created for? Hence, the use by the military for avionics and critical systems.<p><i>&quot;It also includes facilities to help program verification. For these reasons, Ada is sometimes used in critical systems, where any anomaly might lead to very serious consequences, e.g., accidental death, injury or severe financial loss. Examples of systems where Ada is used include avionics, air traffic control, railways, banking, military and space technology.&quot;</i><p>All that was once old, is new again.
    • mastermage9 hours ago
      Ada&#x27;s decline was not due to Ada&#x27;s design, which IMO is one of the best Language designs out there. However in my opinion the decline of ada is due to its closed source compilers that are mainly used. Additionaly also just a lot of security critical code thats not open source.
      • ovenpasta9 hours ago
        Maybe, but now the situation is much different and we have full opensource Ada compiler in GCC as 1st tier language on par with c and c++. And you can use The open source tool SPARK to formally prove a subset of Ada. Any new program I write is now in Ada and no longer c or c++. No regrets!
        • markhermeling4 hours ago
          Agreed. The GNAT Compiler has the largest market share of any Ada compiler in the space and is fully open source.<p>And the ecosystem is following! There are a lot more new middleware layers, frameworks, operating systems and such being released in Ada over the past few years.<p>See <a href="https:&#x2F;&#x2F;forum.ada-lang.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;forum.ada-lang.io&#x2F;</a> for discussion and pop into the live Community Office Hours that AdaCore hosts (<a href="https:&#x2F;&#x2F;www.adacore.com&#x2F;ada-spark-office-hours" rel="nofollow">https:&#x2F;&#x2F;www.adacore.com&#x2F;ada-spark-office-hours</a>) to see what is going on in the space.
          • markhermeling3 hours ago
            And if you&#x27;d like to try to run some easy proofs, here are instructions on how to get started with AI and FM in minutes:<p><a href="https:&#x2F;&#x2F;substack.com&#x2F;home&#x2F;post&#x2F;p-226407436" rel="nofollow">https:&#x2F;&#x2F;substack.com&#x2F;home&#x2F;post&#x2F;p-226407436</a>
      • pjmlp9 hours ago
        Those closed source compilers keep 7 compiler vendors in business, most folks hardly pay for anything today, unless we place a Internal wall, or digital app store, in between.
      • lgas8 hours ago
        Time to vibe code an open source Ada compiler!
  • thomasahle7 hours ago
    Rather than migrating all code to some new program language, I&#x27;ve been building ProgLib: <a href="https:&#x2F;&#x2F;github.com&#x2F;thomasnormal&#x2F;proglib" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;thomasnormal&#x2F;proglib</a> which is like &quot;MathLib for Programming&quot;.<p>It allows you to import code from any programming language (So far, Python, C++, Rust, and SystemVerilog are partially supported,) and prove stuff about it in Lean.<p>You don&#x27;t need a &quot;verifiable programming language&quot;. All you need is formalized semantics for the programming language you are already using.
    • le-mark4 hours ago
      &gt; All you need is formalized semantics for the programming language you are already using.<p>Iirc that in itself is a large hurdle to clear for most programming languages. I guess llms make that easier too?
      • thomasahle2 hours ago
        Right, it&#x27;s definitely a hurdle. But I don&#x27;t think it&#x27;s much harder for &quot;mainstream&quot; programming languages than for &quot;verifiable&quot; ones.<p>Of course, some languages like Python don&#x27;t have a formal spec beyond the interpreter itself. That doesn&#x27;t mean you can&#x27;t write one; it just means you have to update it when the language changes.<p>Indeed, after formalizing C&#x2F;C++, you can use that to check that the Python interpreter correctly implements the Python spec you wrote. Or catch the parts where it does not.<p>Of course it&#x27;s a lot of work, as you say, which is why I hope to attract more contributors (and their llms) to my project :-)<p>Once all the languages are formalized, the next step is to formalize the main software libraries people use. If you are using pytorch, you don&#x27;t want to formalize all its classes and functions everytime you want to prove something about a small program you made. You want to just import that stuff.
  • hedonhermdev11 hours ago
    <a href="https:&#x2F;&#x2F;github.com&#x2F;verus-lang&#x2F;verus" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;verus-lang&#x2F;verus</a><p>The lab I worked with for my thesis used Verus for our formally verified Operating System written in Rust. <a href="https:&#x2F;&#x2F;mars-research.github.io&#x2F;doc&#x2F;2023-kisv-atmo.pdf" rel="nofollow">https:&#x2F;&#x2F;mars-research.github.io&#x2F;doc&#x2F;2023-kisv-atmo.pdf</a>
    • freakynit11 hours ago
      So, we write formal &quot;code&quot; to verify target &quot;code&quot;? How does this help?
      • DangIsATyrant11 hours ago
        I know nothing about the above project, and am not speaking on it, but you could probably walk into a room full of schizd out AI addicted VCs and say &quot;Rust, verified, operating system and programming language&quot; and walk out with $20 million.
        • techpression10 hours ago
          Add AI before operating system and you’re looking at $2B
  • JacobAsmuth12 hours ago
    Sounds like you&#x27;d be interested in Qed! The web framework I&#x27;m building which compiles lean to native js for the frontend and rust for backend, using prorobuf for communication between the two.<p>I reimplemented the entirety of the css grammar and fully verified the data model, hydration&#x2F;dehydration pipeline, and can even formally prove accessibility properties at compile time (e.g. contrast &gt; 4.5).<p>I&#x27;m currently working on reimplementing the full sql grammar to allow you to formally verify your queries (and even row level security policies!) at compile time.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;JacobAsmuth&#x2F;qed" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;JacobAsmuth&#x2F;qed</a>
    • robin_reala11 hours ago
      I’d be wary of saying “formally prove accessibility”. Leaving aside the problems of computing contrast over differing surfaces (e.g. a gradient, an image, or an animated surface) on a responsive site at build time, accessibility is a vastly bigger subject than just colour contrast and focusing purely on compliance to a set of rules isn’t going to get you very far.<p>Or rather, zero problem with accessibility linting, but don’t oversell it.
  • microflash10 hours ago
    I’ve been playing with Quint [1]. Compared to TLA+, it has been a lot more approachable and even enjoyable at times. With their Studio, even non-technical people have been able to try it out with agents.<p>[1]: <a href="https:&#x2F;&#x2F;quint.sh" rel="nofollow">https:&#x2F;&#x2F;quint.sh</a>
    • pandemic_region10 hours ago
      At least its syntax looks more human readable than the seemingly Brainf-ck inspired TLA+.
      • whattheheckheck8 hours ago
        Tla+ is inspired by tried and true mathematical notation.
  • pianopatrick11 hours ago
    If you want a language that is mainstream and applies formal verification and works everywhere you could use Frama-C. It formally verifies C code. C is as mainstream as things get. You can run C code in the browser via web assembly and C works everywhere else as well.
  • magoghm11 hours ago
    Maybe Bend? <a href="https:&#x2F;&#x2F;bend-lang.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bend-lang.com&#x2F;</a>
  • K0IN4 hours ago
    Totally agree, I recently used gobra, and found it a plesent experience (with ai on my side, the documentation is a bit hard to find for me), and it slots right into your go files. Only issue I found it adds alot of comments and waters the code a bit too much (would love to have a header file like system for this).<p>Also your intuition for wasm is the the thing that cam to my mind when reading the headline.<p>I also think that go is a great language to be formally verifiable (idk about multi threading), due to its very clear and verbose syntax.
  • j0h0643 hours ago
    I&#x27;m experimenting with LLVM IR to Lean conversion and checking propositions on C-code based on that in <a href="https:&#x2F;&#x2F;github.com&#x2F;jfhg&#x2F;c2lean" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jfhg&#x2F;c2lean</a>. It shows the possibilities but mostly limitations of such an approach.
  • coldblues5 hours ago
    Urbit is tackling this problem, and Nock has been formally verified using Lean 4. [1]<p>[1]: <a href="https:&#x2F;&#x2F;nock.is&#x2F;content&#x2F;specification&#x2F;verification&#x2F;" rel="nofollow">https:&#x2F;&#x2F;nock.is&#x2F;content&#x2F;specification&#x2F;verification&#x2F;</a>
    • sroerick4 hours ago
      I just found this out yesterday, Urbit was way, way ahead of its time on this
  • sarreph4 hours ago
    I think this is too long of a game (a new language). Unless something changes considerably about the way LLMs code I think we need to come up with a solution that is compatible with the existing languages. There is just too much infrastructure and training data supporting the status quo.<p>That’s what I’m betting on anyway. I’m building a tool to write proofs for TypeScript in Lean (instead of or alongside tests) with familiar syntax. It’s called Pud (<a href="https:&#x2F;&#x2F;pud.dev" rel="nofollow">https:&#x2F;&#x2F;pud.dev</a>). Very keen to see what others come up with in this space though!
  • d_tr9 hours ago
    I have started my own PL project after going through Crafting Interpreters.<p>I know there is a ton of stuff I need and want to learn but no language has all the features I&#x27;d like.<p>Namely systems language &quot;zero overhead&quot; performance, modern ergonomics and compile-time guarantees like Rust, dependent types (I don&#x27;t know much about type systems so maybe there is - and probably there is - some good alternative I am missing), powerful generics (the shit people do with C++ templates often leave me admiring the creativity and also wondering why it has to be so unreadable), reflection, and more stuff I currently have as ideas but not in a very solid form admittedly. And all those working synergistically and coherently.<p>I do have a good foundation in abstract math but there is lots to study for sure. And it has to be something that really offers some great combination of features otherwise it&#x27;s not worth it for anything else than me learning how to write a proper compiler. There are too many languages already, but I am not sure whether this is because it is too hard of a problem or because of choices people made. I guess I am going to find out.<p>At least my motivation is in a relatively sufferable shape despite it having tendencies of going down the shitter with all this vibe-coding crap going on.
    • pjmlp9 hours ago
      &gt; wondering why it has to be so unreadable<p>People pushing it beyond what it was originally designed for in C++98.<p>Most of the template meta-programming tricks are hardly needed since C++20, and improved yet again in C++23, with C++26 static reflection making them completly not worthwhile pursuing, assuming they sort out the whole ratification drama.
      • d_tr9 hours ago
        Yes, I am aware of those points. I follow the new C++ standards (haven&#x27;t touched reflection though). The transformation of C++ since C++11 has been amazing and I think there is still no competitor for, say, numeric computation frameworks. But some stuff is still awkward to write and of course other features probably just can&#x27;t make it to the language.
        • pjmlp8 hours ago
          You can play with reflection with the latest GCC on compiler explorer.<p>The usual enum to string example, <a href="https:&#x2F;&#x2F;godbolt.org&#x2F;z&#x2F;aKc8Ebza4" rel="nofollow">https:&#x2F;&#x2F;godbolt.org&#x2F;z&#x2F;aKc8Ebza4</a>
          • kvemkon2 hours ago
            &quot;template for&quot; where one expects to see something with &quot;switch&#x2F;case&quot; doesn&#x27;t look obvious.<p>And how to enable output of, so to say, &quot;C-preprocessed&quot; source?
  • FullGarden_S11 hours ago
    We do not need a full-on theorem prover for achieving this.<p>Something like ZFC axioms is good enough. External formal verification tools are not ideal either. Its better if the type system of the host language&#x27;s got these essentials included, like having a model checker for its abstract machine or something. However, model checker for enforcing correctness(especially of the intent) will be much harder to implement in languages without a well defined, stable ABI and type system, which typically is the case with almost all mainstream languages. Even though operational semantics is the semantics of the hardware, most languages do not strictly adhere to it due to a lot of practical reasons.<p>Mainstream languages that become practical enough to be used by masses will usually be in a spot where it becomes very hard to formally define the language and when that happens, enforcing &quot;correctness&quot; becomes close to impossible. Stuff like this needs to be addressed since the start.<p>Selling to the entire industry the idea that &quot;memory safety&quot; is the only thing essential security requirement, while all else is a low priority, simply means that anyone who bought that ad either had surplus resources or was operating with inadequate requirements to justify doing so. Computer programming is about deductive reasoning of the programs and that means its much more than just writing code and handling resources properly.
    • Dashadower9 hours ago
      I agree with most of your comment but I&#x27;m not sure what you mean by &quot;ZFC is enough&quot;
      • FullGarden_S9 hours ago
        &quot;Something like ZFC axioms is good enough&quot;.<p>And by that I do not mean the exact, whole theory of ZFC itself but a trimmed down or a bloated version instead. The point is to have the appropriate and intuitive axiomatic semantics that cover the core constructs of the language, at least.
    • 0815beck11 hours ago
      this doesnt even make sense.... what do you mean
      • FullGarden_S11 hours ago
        I updated my reply to be more explicit.
    • mrkeen10 hours ago
      &gt; Something like ZFC axioms is good enough.<p><pre><code> Axiom of Infinity - There exists an infinite set. Axiom of Replacement - If a function is defined, then for any set, there exists a set of images under that function. </code></pre> Why would these help me?
      • FullGarden_S10 hours ago
        Noice nitpick!<p>Take what you need and leave what you don&#x27;t, however you see fit for your requirement(s). One might not need all of the axioms.
        • mrkeen9 hours ago
          Since you called me out for nitpicking, go ahead and read the ZFC axioms as charitably as you like, and explain how they would be all you need to formally prove your code.
          • FullGarden_S9 hours ago
            By &quot;Something like ZFC axoims is good enough&quot;, I did not mean the entirety of ZFC to the brim.
  • Snibz11 hours ago
    I don&#x27;t really understand this sudden obsession in the industry with formal verification
    • lz40011 hours ago
      I think it&#x27;s simple to understand. Most code is now written by LLMs and the bottleneck is verification. If with a few more tokens thrown at TLA+, Lean, etc. we can achieve _guaranteed_ correctness, it&#x27;s an amazing deal. I&#x27;m not saying it&#x27;s possible or even that it works that way, but that&#x27;s the dream.
      • pbhjpbhj10 hours ago
        I agree mostly, but not that verification being a bottleneck is the principal part. Isn&#x27;t it rather that as we push ourselves to working at higher levels of abstraction, managing agents, we want to be sure we&#x27;re not just letting them go off and do whatever, but keeping some reins on them? We might no longer be able to do what they do - I&#x27;m thinking RH in Lean - but if it&#x27;s formally verifiable we can at least say a model output complies with a specification (unless the agent hacked the formal verification stage).<p>We want to be confident we&#x27;re not being duped.<p>It&#x27;s like we skipped over the Laws of Robotics, but we&#x27;re writing some sort of Mosaic &#x27;moral&#x27; code for generative models.
      • jazzyjackson8 hours ago
        guaranteed correctness of what?<p>verification against whose spec?
      • DangIsATyrant11 hours ago
        Engineers would rather make their own jobs obsolete than have to code review AI code it seems.
        • necovek9 hours ago
          Obviously! That&#x27;s what being a good engineer has always been about — automate away the mundane of your job, and think through what else could be automated next!<p>As for reviewing AI code, have you seen some of it? Nobody wants to review <i>that</i>!
      • drdrey10 hours ago
        except that no one wants to formally specify actual correctness properties
    • markhermeling3 hours ago
      The way I see it is that there are 2 places where formal methods help: - Proof the absence of runtime-errors&#x2F;panics - Proof functional correctness<p>The sweet spot for many users is the first. Make sure that the application cannot crash. No array-out-of-bounds read&#x2F;write, no memory issue on ANY input, formally proven at compile time.<p>This requires additional work in the program to annotate (in SPARK at leasts) and knowledge from the programmer, which meant that there was a barrier to entry.<p>Well, LLMs COMPLETELY remove this barrier to entry. You can write the logic and have the LLM add the contracts to get to the proof. This works in most cases.<p>And then, for truly critical code, you can look at functional correctness as a cherry on top of your cheesecake.
    • js83 hours ago
      For me, it&#x27;s driven by two things:<p>(1) security - If we want secure systems they have to be watertight. And AIs are good at hacking.<p>(2) reasoning ownership - The AI models not being open weight and their thinking not being published means you don&#x27;t own the reasoning process. Formal modelling (of requirements and specification) and proving is a way to partially retake that ownership.
    • lioeters11 hours ago
      Au contraire, it&#x27;s both horrifying and impressive that so much of the software industry has grown for decades <i>without</i> formal verification. With the accelerated production (&quot;productivity&quot;) of machine-generated code, we&#x27;re at a threshold where it will become impossible to manage the complexity unless we change our ways.
    • jazzyjackson8 hours ago
      they think it means you don&#x27;t get bugs
    • protocolture11 hours ago
      1. It sounds cool.<p>2. ????<p>3. Post Human Singularity or something
  • mirekrusin9 hours ago
    Why not use&#x2F;contribute to MoonBit [0]?<p>It already checks boxes listed in the article:<p>- wasm(-gc) target<p>- uses gc<p>- rust type system, without borrow checker difficulties<p>- formal verification<p>- ...and has few more like fast compile times, which is a must&#x2F;underappriciated in agentic development (see below) etc.<p>As an example I attempted to rewrite MSSQL 3 times:<p>1. TS based on SQLite [1]<p>2. Rust based on DuckDB [2]<p>3. MoonBit [3]<p>MoonBit version materialized more than order of magnitude faster compared to Rust version, tasks that were taking weeks in Rust took hours in MoonBit (!) – not only that, instead of using multiple build machines including maxed 128 GB RAM Ryzen box eating hundreds of gigabytes of SSD to support Rust worktrees &#x2F; parallel compilation, MoonBit was run on MacMini M1 with 16GB RAM and limited disk space – still destroying Rust version in terms of development speed going more than 10x faster.<p>Formal proofs is early stage support, you can see some of it here [4] if you&#x27;re interested.<p>If you find it somehow interesting, feel free to have a look at bitSQL repo&#x2F;website [3] (it&#x27;s public domain like all my recent projects), especially the final artifact which is a marvel – ~30 MB (!) of hardened container image, drop it replacement for MSSQL container – tiny, performant (wins all benchmarks against MSSQL), passes 25k tests, low resource usage (MBs instead of GBs of RAM needed) – what a beauty. Great for ie. running CI tests on projects using MSSQL.<p>[0] <a href="https:&#x2F;&#x2F;www.moonbitlang.com" rel="nofollow">https:&#x2F;&#x2F;www.moonbitlang.com</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;mirek&#x2F;mssqlite" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mirek&#x2F;mssqlite</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;mirek&#x2F;msduck" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mirek&#x2F;msduck</a><p>[3] <a href="https:&#x2F;&#x2F;github.com&#x2F;mirek&#x2F;bitsql" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mirek&#x2F;bitsql</a><p>[4] <a href="https:&#x2F;&#x2F;github.com&#x2F;mirek&#x2F;bitsql&#x2F;blob&#x2F;main&#x2F;docs&#x2F;design&#x2F;verification.md#formal-proofs-moon-prove" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mirek&#x2F;bitsql&#x2F;blob&#x2F;main&#x2F;docs&#x2F;design&#x2F;verifi...</a>
  • agnishom11 hours ago
    How will having a formally verifiable mainstream language save us?
    • m00dy11 hours ago
      probably won&#x27;t. But, it will keep some people busy for sometime.
  • danabramov4 hours ago
    I’m working on verifying JavaScript code by having LLM transcribe it to Lean, model the environment, do differential testing, and then proving things about the Lean code. You’ll be surprised how far this can take you.
  • jb_briant10 hours ago
    Formal correctness is mostly useless for mainstream software. Models are strong enough that their bottom 10% of code is acceptable garbage, like in any human codebase. Top 10% is excellent.<p>From my experience on vibed complex algorithms (like voxel terrain generation within 200km radius at sub second generation), formal software was usefull, if not necessary, prior to opus 5.5<p>Now it&#x27;s plain useless unless you need an absolute guarantee of correctness. But that&#x27;s niche, not mainstream.<p>So we don&#x27;t need a mainstream programming language, we already have good options that are sufficient.
    • nylonstrung6 hours ago
      &gt; Now it&#x27;s plain useless unless you need an absolute guarantee of correctness. But that&#x27;s niche, not mainstream.<p>I don&#x27;t think this is a niche problem when major security breaches and downtime are a weekly occurrence at this point<p>The world would be tangibly different in positive ways if &quot;everyday&quot; software and core deps had the level of proven correctness and fault-tolerance that currently is relegated to niche fields like avionics where verification is the norm
      • boxed5 hours ago
        Most of those things are just C code that wouldn&#x27;t compile in Rust.
    • Kinrany8 hours ago
      Why do you think that technology no longer needs to progress now that LLMs exist? They&#x27;re not magic.
  • gravypod3 hours ago
    Does anyone have practical experience with using LLMs + formal methods to verify software they ship that is not a research &#x2F; prototype?
    • medler3 hours ago
      Yes, I have been using Specular (<a href="https:&#x2F;&#x2F;github.com&#x2F;specular-org&#x2F;Specular" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;specular-org&#x2F;Specular</a>) and it has helped me find a zillion subtle bugs in my existing production codebase. The caveat is that even though formal methods are involved, I’m just finding bugs, not proving correctness.<p>I see specular has been submitted to HN a few times but has gotten zero discussion, which is a shame. (For the record I am not affiliated with specular at all, not even as a contributor. Just a happy user).<p>TFA opens by saying that LLMs are causing software quality to decline, but using Specular has convinced me the opposite is going to be true. If you use these tools properly your risk of shipping buggy code drops precipitously
      • gravypod53 minutes ago
        Yea, this is an area that I have experimented in a bit. I wonder if people have done total correctness.
      • jkahrs5952 hours ago
        This looks great but running it on my code immediately triggered (my first) openAI &quot;cybersecurity risk&quot; response and REFUSED to do anything no matter how much I told it I&#x27;d switch to claude :)<p>Can&#x27;t really express in words how much that just pissed me off. I cannot wait for these fucking companies to get ruined by open models.
        • medler2 hours ago
          Haven’t used OpenAI models myself, but when I’ve run into that with Claude in the past (not with specular) I was able to steer it by reminding it that we’re just looking for behavioral bugs, not doing cybersecurity work
          • jkahrs5952 hours ago
            thanks for the tip, that seems to have got it going!
            • jkahrs5951 hour ago
              nvm it died again, bullshit
  • kbr-10 hours ago
    For the barrier between natural and formal language, see Elenxis. <a href="https:&#x2F;&#x2F;github.com&#x2F;kbr-&#x2F;elenxis" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kbr-&#x2F;elenxis</a><p>It still plugs in LLM as a module, and LLM can be misaligned, so there is no guarantee that the spec will be 100% reflecting the user&#x27;s intent. (I do know how to solve this, and I will in the future.)<p>But even right now in practice, with Opus 5.5 or GPT 6.2 Sol (medium reasoning both) it works fantastic. I use daily at $dayjob and in personal projects.
    • whattheheckheck8 hours ago
      Can you do a demo video and get on a podcast like Ryan peterman or something to show the dev flow
  • childintime7 hours ago
    Code itself should be safe. Any product definition must be able to converge on the desired outcome, iteratively, so it is accepted code must be reformulated from time to time. Those are the two requirements. The absence of state and a single source of truth help a lot.
  • skybrian11 hours ago
    Perhaps Zena is worth looking at since it also targets WebAssembly GC?<p><a href="https:&#x2F;&#x2F;zena-lang.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zena-lang.dev&#x2F;</a>
  • acje10 hours ago
    Following some of the same sentiment, let me offer my own thoughts on how hardware&#x2F;software co-design also should change to enable both digital sovereignty and inherent defensibility. <a href="https:&#x2F;&#x2F;acje.github.io&#x2F;systems&#x2F;new_stack&#x2F;" rel="nofollow">https:&#x2F;&#x2F;acje.github.io&#x2F;systems&#x2F;new_stack&#x2F;</a>
  • grohan11 hours ago
    Formal verification is not a silver bullet! I am afraid AI has positioned it as the ultimate red herring (and nerd-snipe).<p>I recommend reading Cantwell Smith&#x27;s &quot;The Limits of Correctness&quot; <a href="https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;pdf&#x2F;10.1145&#x2F;379486.379512" rel="nofollow">https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;pdf&#x2F;10.1145&#x2F;379486.379512</a><p>The TL;DR is that proofs only show that the program matches a spec, not that the spec matches the world. The gap between &quot;what you can model&quot; and &quot;the real world&quot; is generally too large for formal methods to be useful (outside of narrow domains, where they are highly useful).<p>In other words, computing is closer to an empirical science than a formal one.
    • nr3783 hours ago
      The program matching the spec matters a great deal for security purposes. If we achieve nothing other than that, we’re in a much better position than we are today with C and PHP.
    • gf0009 hours ago
      Proofs <i>are</i> programs themselves. So if you generate the very program from your proof (like with lean), that mismatch should not really happen.<p>Of course you may have still written incorrect spec, and once you have IO you probably won&#x27;t model the whole Linux kernel in the proof.
    • mirekrusin7 hours ago
      You can say the same about tests, yet they&#x27;re useful and everybody is using them.
    • Dashadower9 hours ago
      &quot;If civil engineers built bridges like how software engineers write software there would be no bridges left today&quot;
  • ChicagoDave11 hours ago
    Again the OP makes the provably incorrect assumption that the current state of code generation and validation cannot meet quality standards.<p>I’ve been doing it with a custom engineering harness on top of Claude Code for a year.<p>I certainly see the desire for a validation framework in code generation, but until we invent that and migrate the entire world to it, let’s focus on discipline.<p>The reality the OP sees isn’t wrong. Most of what I see publicly is trash. Undisciplined vibe coders are in a death spiral of agentic madness.<p>But if you bring discipline to software construction, you can extract high-quality results.<p>We still need requirements. We still need invariants. We still need wireframes. We still need user experience design.<p>Then we reach into history and bring back Functional Design Specifications.<p>Add TDD, DDD, behavior testing, mutation verification. And finally people need to use it for the final validation.<p>Now you have a disciplined approach that works today.
    • gf0009 hours ago
      &gt; cannot meet quality standards<p>I think it&#x27;s more that many may argue we never really reached high enough quality standards, irrespective of vibe coding. I also think that with good usage, LLMs can produce good code, but if we could also raise the bar while we are at it, why not?
      • ChicagoDave6 hours ago
        This is true and all of the “weird” system failures recently are examples of decades of tech debt exposed by the latest LLMs.<p>It’s a huge vindication of all the architects and engineers that expressed dismay at management for not providing time to address that tech debt in real-time.<p>Even better. Management can never ignore tech debt ever again!<p>But at the same time we (architects and engineers) will be responsible for hardening our deployed systems.<p>I’m cool with that. That’s what I’ve been begging for my entire career.<p>But the problem isn’t having a fancy DSL. It’s just old school, boring, engineering discipline.
    • bonesss10 hours ago
      I feel many, if not most, of these arguments basically reduce to some variant of “<i>use Haskell&#x2F;OCaml with spec-style tests</i>”.<p>Exhaustiveness guarantees, compiler verification and feedback, powerful language features to create high-level domain syntax and languages, pure functions commonly used, and specifications&#x2F;tests that can be read aloud in English and understood by domain experts… they’re even token efficient.
      • ChicagoDave5 hours ago
        Having just designed and built a new modeling DSL for interactive fiction I can tell you that the ‘exhaustive’ part is infinite recursion.<p>There will always be another use case.<p>Maybe something like Lean can be achieved, but constructing software in relation to a business model is vastly more complex than math.<p>We wouldn’t have Lean. We’d have Lean for every domain with variations for every business.
  • nylonstrung6 hours ago
    I firmly believe that Lean is already the language OP wants<p>There&#x27;s lots of progress being made towards compilation to WASM and LLVM, as well as interop with Rust and other languages
  • peter_retief9 hours ago
    This is a new frontier, we do not need to be able to read the code so why do we even need a code editor, we need a completely new language that might use symbols, context, location, images and human langauge.
    • Kinrany8 hours ago
      We may not always write the code but we always need to be able to read the code.
  • lioeters11 hours ago
    Related project I saw recently:<p>&gt; TScert: a sound core for TypeScript. An independent checker, whose soundness is proved in Lean<p><a href="https:&#x2F;&#x2F;github.com&#x2F;cristianoc&#x2F;TScert" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cristianoc&#x2F;TScert</a>
  • bigstrat20031 hour ago
    We don&#x27;t need formal verification, we need people to wake up to the reality that LLMs are not good at programming. Stop using them to write your code and you will have software which works better.
  • singularity200110 hours ago
    Bend is working on it and <a href="https:&#x2F;&#x2F;github.com&#x2F;pannous&#x2F;wap&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pannous&#x2F;wap&#x2F;</a>
  • adsharma1 hour ago
    This is not a technical problem. People need to stop inventing new programming languages and bring these techniques to the ones they already use.<p>For various historical and self preservation reasons, some of these language ecosystems create social and technical taboos.
  • austin-cheney9 hours ago
    Frustrating. The repeated failure of developers trying to fix broken human behavior with a software solution.<p>LLMs are not the problem. Quality will degrade anyways because there is no reason why it shouldn’t degrade. There is no magic to any of this. It’s just economics. Quality will remain high provided there is an incentive to keep it high, but once other factors achieve a greater desired value those incentives collapse.<p>This is not a new problem and it has been solved countless times outside software. So long as software people continue to whine about the symptoms while intentionally ignoring the problem we should expect conditions to continue to degrade. A new programming language will not alter the trajectory or acceleration towards failure. Perverse desires always find a way.
    • Kinrany8 hours ago
      Human behavior issues can totally be fixed with technology. Not always perhaps, but it happens all the time, there&#x27;s no reason it wouldn&#x27;t.<p>In this case, economics doesn&#x27;t matter if quality is free. And users do care about quality a little bit at least.
  • Qasaur11 hours ago
    The author’s proposal reminds me of the JavaScript framework craze. Industrial-scale formal verification does not require a new language unless your program involves exotic types and&#x2F;or logic not supported by any of the mainstream languages. There is still lots of work to be done, of course, but projects like Rust’s Verus and Aeneas already provide a clean and modular interface to plug in a formal methods layer, like Lean, without needing to reinvent the wheel.<p>Seamless formal verification requires a native formal specification to verify against. In my view, focusing work on formally modelling existing languages (like Rust), or if intractable at least a fragment with Cartesian closed semantics, is far more encouraging to mainstream adoption of formal methods than trying to convince the industry to adopt a new language.
    • Dashadower9 hours ago
      I also think formalizing existing languages and framework will become more and more valuable. It took over a decade to somewhat come to a consensus on how C&#x27;s pointer provenance model should like, and even then using it to prove compiler transformations is still being worked on.
    • Kushvinthe11 hours ago
      [dead]
  • pjmlp11 hours ago
    This will never take off without the proper incentives to make companies actually care.<p>Management would rather have vibe coding as the next step, following on cheap offshoring, than anything else, and the recent meltdowns aren&#x27;t going to deter them, without liability in place.
    • nylonstrung6 hours ago
      Formal verification is IMO the only way they can have their cake and eat it too<p>How else could industry fully embrace agentic coding more while knowing they aren&#x27;t compromising on reliability and security<p>Vibecoding is notoriously bad at writing test coverage that doesn&#x27;t prevent actual bugs<p>Formal methods can have the same issue but allow for a more concrete burden of proof and a more tangible reward function for post-training
      • xmcqdpt25 hours ago
        &gt; How else could industry fully embrace agentic coding more while knowing they aren&#x27;t compromising on reliability and security<p>Exactly what the parent is saying. They are compromising on reliability and security. It’s a compromise every company is making very willingly.<p>And why wouldn’t they? No one is accountable for bad software anymore anyway.
      • pjmlp5 hours ago
        You have seen on last Microsoft outage how much it matters to management.
  • throstur6 hours ago
    This is why languages like Rebeca exist, but sadly most &quot;Software Engineers&quot; skipped the Master&#x27;s degree and didn&#x27;t get to really get into the weeds of things. <a href="https:&#x2F;&#x2F;rebeca-lang.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;rebeca-lang.org&#x2F;</a>
  • kylestanfield3 hours ago
    The link for the claim &quot;[Software] Quality is nose-diving&quot; being a 404 is some nice irony.
  • supermatt10 hours ago
    I couldn’t read past the first paragraph.<p>What are people doing that they are finding quality is nose diving? That’s completely the opposite of my experience. I’d like to know, but the link is broken<p>But of course software engineering has always had this problem, right? Oh! Another broken link.<p>Maybe we need to start closer to home when it comes to quality.
  • 0815beck11 hours ago
    &quot;i want to formally verify the program&quot; should be met with the same reaction as &quot;i want to prove that this is true&quot;, namely WHAT, what exactly do you want to prove
  • dnautics4 hours ago
    C is formally verifiable if youre Sel4
  • Overdrivr7 hours ago
    Hard disagree, you&#x27;ll only end up with spec errors and the specs will need to become so detailed to be defined that you&#x27;ll end up back to square one.<p>Lean works well for math because there are many orders of magnitude of difference between defining a spec (ex P=NP) and implementing the proof. I don&#x27;t think this applies for conventional software eng
  • nightmunnas10 hours ago
    I would love to contribute to a project like this. What are the existing projects that try to achieve this?
  • stsch9 hours ago
    &quot;Quality is nose-diving&quot; leading to a 404 is funny in this one. ;-)
  • moneybunny10 hours ago
    Are we going to write backend in lean now or who is gonna train ai with a brand new lang?
  • aloisdg11 hours ago
    F*?
  • sylware7 hours ago
    You will proove bugs...
  • globular-toast11 hours ago
    Is it part of the joke that the first two links in the post are 404s?
  • xiaoyu200610 hours ago
    Just make Lean useful?
  • vibebingo6 hours ago
    Did someone say magic bullet? This sounds noble but formal verification doesn&#x27;t take into account if you got the requirements right, human factors and more.
  • Dashadower9 hours ago
    Usability, strong verification guarantees, expressiveness<p>You get to choose 2 out of 3
    • Dashadower9 hours ago
      In my experience theres a huge difference between proving existing code and proving code that was written with ease of reasonin in mind.<p>Maybe if we humans dont bother with proofs at all this will become irrelevant, but my speculation is that programmers familiar with formal verification may become more valuable in the sense they can write verification friendly code better.
    • nylonstrung6 hours ago
      Lean has verification guarantees and I&#x27;d argue is the most expressive language ever made, except perhaps Racket<p>The question then is if it&#x27;s usable, and I&#x27;d argue it isnt any less so than other FPs or systems languages
      • Dashadower3 hours ago
        I&#x27;m not sure if you could say pure lean is expressive, especially if you restrict to portions you can actually verify&#x2F;reason about. Because functions without proof of termination cannot be used in propositions and you&#x27;re forced to define a measure if your recursive function doesn&#x27;t have a syntactically decreasing argument.<p>Unless you&#x27;re talking about reasoning about other languages deeply embedded in Lean, at that point we&#x27;re not talking about Lean itself but about the model of that language stated in Lean.
    • Kinrany8 hours ago
      Whenever a &quot;2 out of 3&quot; dilemma appears, it turns out that you need only 1 out of 3, and the other two can be both relaxed to 99% of the ideal.
  • Arodex8 hours ago
    Very ironic the first link titled &quot;quality is nose-diving&quot; doesn&#x27;t work.
  • wseqyrku9 hours ago
    If you think you ever need anything more than rust, drink bleach. I mean if dealing with borrow checker is a hard pass for you maybe let&#x27;s not talk about formal verification
  • shevy-java9 hours ago
    But if AI is writing code for us now, do people need to learn programming? To me that&#x27;s a chicken-egg dilemma. Some languages struggle getting new people to use them.
  • DeathArrow10 hours ago
    1. When coding was done exclusively by humans we still had lots of bugs, inefficiencies, poorly written and poorly architected software.<p>2. While at start LLM output was not great, models are continuously improving and the quality of coding by frontier models is good. (Even weaker models like Deepseek Flash can output high quality software if driven carefully)<p>3. By analyzing the model output, having lots of gates, having good testing habits and by asking the models to manually test what they did, and constantly changing my workflow to improve the output, I am very happy with the results and probably my workflow using AI is of better quality than if I would do it by hand.<p>4. If the software isn&#x27;t of worse quality than if done by human teams with realistic constrains (time, money etc.), then using AI is a net gain.<p>5. While striving for perfection is great, doing when to do compromises and trade-offs, is even greater.
    • bigstrat20031 hour ago
      &gt; the quality of coding by frontier models is good<p>It most certainly is not. No LLM exists which is capable of reaching, let alone exceeding, a competent human programmer.
  • DeathArrow10 hours ago
    1. When coding was done exclusively by humans we still had lots of bugs, inefficiencies, poorly written and poorly architected software.<p>2. While at start LLM output was not great, models are continuously improving and the quality of coding by frontier models is good. (Even weaker models like Deepseek Flash can output high quality software if driven carefully)<p>3. By analyzing the model output, having lots of gates, having good testing habits and by asking the models to manually test what they did, and constantly changing my workflow to improve the output, I am very happy with the results and probably my workflow using AI is of better quality than if I would do it by hand.<p>4. If the software isn&#x27;t of worse quality than if done by human teams with realistic constrains (time, money etc.), then using AI is a net gain.
  • Nursie10 hours ago
    &gt; The only way forward is to fully embrace formal verification, all the way down to the foundations ... But that&#x27;s easier said than done. Existing formal verification tools suffer from massive usability and understandability problems, and have failed to make any kind of noticeable impact ...<p>This is sort of a counterpart to my own opinion of formal verification, since first learning about it 30 years ago.<p>Firstly, if there&#x27;s no direct link between the written code (or perhaps even the program code post-compilation) and the verification algebra, what are you really verifying? And secondly if we can &#x27;get by&#x27; without it very well for the most part, then justifying the extra effort is very hard.<p>And I would argue in contrast to the author that we have achieved a hell of a lot without using it particularly widely. Much like that late-90s obsession, the semantic web, it illustrates a major disconnect between assumptions in the halls of academia about how the world should work, and real world industry practice.<p>So <i>if</i> there is value in formal verification then the author is right, if must be applicable directly to the program code under verification, and I would argue it must be low friction if it&#x27;s going to get adoption. And I think LLMs can probably help us deliver that last part.
    • nylonstrung6 hours ago
      I think we&#x27;re seeing lots of progress for relating verification and specs with actual code: there are a number of good projects for Rust + Lean<p>I think this problem is functionally a subset of same the issue that FP has with modelling stuff at it&#x27;s boundaries like IO<p>The work around algebraic effects and handlers is some of the more relevant prior art here
    • burcsahinoglu4 hours ago
      I believe that that link already exists in tools like Liquid Haskell, Dafny and Verus: the spec sits on the function itself, and if the code doesn&#x27;t match it, it doesn&#x27;t compile.
  • techpression10 hours ago
    A programming language is more than compilation, which I feel the post misses. I pick language because of its runtime properties and quality of life, I don’t want to reinvent every foundation in every project with a barebones language.
  • light_hue_111 hours ago
    If Haskell would finally give up on the disaster that is laziness (and by extension GHC) and pivot to formal verification, this could be the killer app.<p>Much of what the author wants already exists!
    • filipdobro11 hours ago
      The issue with Haskell and other functional programming languages is that it doesn&#x27;t reflect the hardware paradigm. Reasoning within a functional programming language is obviously simplified due to the statelessness, however you lose the benefits of memory hierarchies and other hardware improvements we have due to spatial and temporal locality. You might be able to fix this with a smart compiler, but then reasoning about the correctness will be another challenge.<p>If a language cannot balance tradeoffs between hardware and software, people will still use the most performant language, especially for resource-intensive tasks, so you end up with what we currently have. We need to rethink how we can design a language that is token-efficient, offers memory safety, is close to the metal, and lastly implements formal verification guarantees. The closest what we have to this is Rust and C++, but it&#x27;s not good enough.
      • slacknatcher1210 hours ago
        &gt; however you lose the benefits of memory hierarchies and other hardware improvements we have due to spatial and temporal locality.<p>This is ironic considering the default GC strategy for GHC&#x27;s RTS is a copying collector that puts values physically close if they are used together plus bump allocation. That has good cache side effects (heh).
    • nylonstrung6 hours ago
      At that point why not just use Lean instead of Haskell? It has opt-in laziness with thunks which is arguably the better approach
    • slacknatcher1210 hours ago
      The haskell community has practically settled on StrictData for years now... Alexis King gave the final blow on. Old complains never die though.
  • baq11 hours ago
    Somebody call Victor Taelin
  • ezekiel6811 hours ago
    Obligatory: &quot;...or else, what?&quot;<p>If it&#x27;s truly needed, it will appear (or has appeared already) in one form or another.
  • JodieBenitez11 hours ago
    Yet another article claiming software quality is &quot;nose-diving&quot; because of AI, while we&#x27;re piling [insert anything]2root exploits based on decades of real human sloppiness. Meanwhile, in-house software keeps getting better.
  • bytepatterns9 hours ago
    [dead]
  • conrs11 hours ago
    [dead]
  • merrowd7 hours ago
    [dead]
  • DarrenEdwards1110 hours ago
    [dead]
  • oxcartctl10 hours ago
    [dead]
  • exa_bit9 hours ago
    [dead]
  • twotwoone10 hours ago
    [dead]
  • protocolture11 hours ago
    &gt; fully embrace formal verification, all the way down to the foundations of our civilizational software stack.<p>I am getting so tired of LLMs being used as leverage for people to basically thrust their random viewpoint and make it all philosophical.<p>&quot;LLMs mean my thing is best and everyone needs to do it or become post-civilizational transhuman paperclips&quot;<p>I almost wish the stupid AI safety sex cult could convince Sanders and Trump to nuke us back to the stone age if only to save us from the onslaught of low-quality bad faith takes.