4 ms·
Hi, I'm the author. HN staff: someone posted before me. Could we change the title to "Bend - a language that blocks AI mistakes via proof and runs on GPUs"?
by LightMachine 17d ago
Hi, I'm the author.
HN staff: someone posted before me. Could we change the title to
"Bend - a language that blocks AI mistakes via proof and runs on GPUs"?
Everyone: feel free to ask any question, but I'd be highly appreciative if you could be a bit civilized and respectful this time. I've worked on this for 1 year, nearly 16h/day, 7 days a week, and I'm giving it for free. You need not to use it. So, I'd be thankful if you could point occasional failures politely rather than throwing me in a lava pit.
Thank you!
- TimTheTinker 17d agoHi author :wave: I'm confused - could you explain how the board/flag animation relates to Bend's compile time checking? Is it actually a direct demonstration of Bend running a check?
- LightMachine 17d agoThe check is happening in between the animations. When the AI edits the code, Bend will check if all laws still hold, mathematically so. If not, the AI repeats, until that's the case. So, the animations just show what happens to the app with and without Bend's involvement.
- mmoustafa 17d agohonestly just Bend is a great HN title, you can describe it more concretely on the homepage
- throooooo 16d agoThank you for being honest.
- avodonosov 17d agoCould you recommed literature (preferrably a single book) that does not require prior knowledge and allows to fully understand the logical foundation of it? (Why it is done the way it is, what problems are solved by affinity, why closure can be called at most once, how a function that never returns can prove anything, and everything else)
- LightMachine 17d agoThere isn't a single book that covers all of it... Bend's theory touches various domains (dependent types, substructural types, termination). And then there's the runtime, compiler, GPU kernels... If you mean about the type theory specifically, "Type Theory and Formal Proof by Nederpelt and Geuvers" is a good introduction. Not sure what I'd recommend on linear types, no book I know of is very introductory? Perhaps "Idris 2: Quantitative Type Theory in Practice", which is a language with similar foundations to Bend, and the author wrote a book on it (and inspired myself!)
- avodonosov 17d agoThank you.
- avodonosov 16d agoMaybe you can explain or give a hint, why a function that never returns could prove anything?
- alew1 17d agoDoes Bend have linear types? I didn't see anything on them in a quick skim of the GUIDE file.
- LightMachine 17d agothe entire language is based on linear types! it says so in the GUIDE yes
- alew1 17d agoAh, thanks, was looking at the readme instead of the guide
- ble 17d agoI like the idea of a language intended from the start to be proved and it seems very compelling given coding agents. It's a good idea that others don't see coming -- so expect it to be frequently misunderstood and even verbally abused!
- gslepak 17d agoAmazing work, one question regarding the guide, it states: > That same file is the CPU program and the GPU kernel: clang builds it for the host, Metal or CUDA builds it for the device, so a `!` runs the exact same code on either chip. What exactly is this saying? The guide doesn't really explicitly define `!`, and it's unclear from this sentence whether it's saying that, "clang builds it for the host and Metal, and CUDA builds it for the device", or if it's saying, "clang builds it for the host, Metal, and CUDA, and builds it for the device", or something else entirely.
- LightMachine 17d agoI will improve that phrasing, thanks. It just means that Bend compiles to a single .c file, and that file compiles to either Metal or CUDA, via macros, depending on your target. This shouldn't be relevant to most users. It is just a way I found to keep the file small and reuse as much code as possible, rather than rewriting the runtime 3 times (once for C, once for Metal, once for CUDA).
- pdpi 17d agoDon't know whether this is a common outcome, but I tried the "remove the walls" example, and the result was... scary. It completely changed the game so that movement is now diagonal, and made the arbitrary decision that up/down move you on the positive diagonal, and left/right move you on the negative diagonal. The problem, of course, is that having only the one single "you can't win" law is severely underspecified, but the solution was too clever by half, and highlights the problem with this approach — every program will be under-specified, because, at some point, writing the laws becomes a bigger problem than writing the code itself. This becomes a real issue because the combination of underspecified but rigid laws pushes the aI towards this sort of "creative" solution that matches the letter but not spirit of the law. In this case, the issue was obvious, but I seriously worry about what sort of shenanigans will occur in less obvious cases.
- pixl97 17d agoHeh, We're writing Asimov in real life after been warned to decades.
- thomasfromcdnjs 17d agoWell described the problem scope. I wonder if harness-hooks + Jev (equivalents) could semantically lint for `sloppy_law` etc when ever they are edited
- abraxas 17d ago> writing the laws becomes a bigger problem than writing the code itself. Of course because at its limit programming is basically defining desired behaviour under all circumstances and logical conditions.
- deleted 17d ago[deleted]
- deleted 17d ago[deleted]
- LightMachine 17d agoExactly, "you can't win" is grossly under-specified. The goal of the demo is just to show that laws can't be broken. Yet, if that's your only law, the AI can do whatever to protect it - including changing how the character moves, or even removing the flag entirely! So, yes, that's the issue with laws: they only protect what you remember to write. They're not a silver bullet. But they can still be incredibly useful, because it takes a small law to protect against entire classes of bug, covering your entire codebase. For example: LAW: "the sum of all balances in this contract must be zero" This one liner would have prevented Ethereum's infamous "The DAO" hack, where millions were stolen and almost undermined the entire project. But if your laws are under-specifying or ill-specifying your intents, Bend can't do anything to protect you.
- rao-v 17d agoHey Victor! Been following you since HVM/Kind, partly because I'm moderately unhappy with the state of out of the box automatic parallelism in modern languages! Do you plan to invest in profile guided optimization or autotuning in Bend2 - using runtime profiles / cost models to make decisions around SIMD vs. multicore vs. GPU parallelization? Bend2's model might give you a really nice view into available parallelization. Heck I can imagine integrating an LLM to profile and optimize in an absurdly expensive `-O7` optimization mode one day!
- LightMachine 17d agoHi. Yes and of course, I plan to invest in everything that makes Bend better. The language is, in theory, capable of parallelizing perfectly in any setup. Currently, though, only a very simple scheduler is shipped, and you must still tune it manually. We're a small team, but we're not stopping here, and I hope I can make it grow to the point where that kind of tooling becomes part of the ecosystem.
- mathisfun123 17d agowhat happened to your other project? HVM?
- LightMachine 17d agoSurprise - HVM has been reimplemented in Bend 2. You can find it on Bend's demo directory in our GitHub. Don't tell anyone though!
- mathisfun123 17d agoi'm asking you what happened to HVM that it needed to be reimplemented as Bend.
- LightMachine 17d agoIt didn't "need to", it just evolves by rewrites as I learn (the project is fairly small) so in the latest rewrite I choose Bend!
- rowanG077 16d agoThat sounds like it's dead? The entire point of HVM as I understand was to be an incredibly fast evaluator. If bend2 does not use what right to exist does HVM still have?
- douglasisshiny 16d ago>If bend2 does not use what right to exist does HVM still have? What? This is such a weird comment.
- rowanG077 16d agoHVM was too be a highly parallel extremely efficient language target. Bend has taken that place in their ecosystem. I don't think that's weird question were that leaves HVM.
- hei-lima 17d agoCongrats, Victor! É ótimo ver um brasileiro criando algo tão único!
- LightMachine 17d agoobrigado amg
- davidw 17d agoSpeaking of lava, you should do a presentation to the local tech group if you're ever here in Bend, Oregon...
- holden_nelson 17d agoJust wanted to say this is really, really cool, and impressive stuff. Looking forward to reading your papers and playing with it. Thanks for working hard on it and sharing it with us.
- greenlimetea 17d ago[dead]
- pasteleft 17d agoThank you for adding a 5-line AGENTS.md. Other projects force you to install skills or MCP even when they're just doing the same thing.
- didibus 17d agoSorry for not knowing, but in the AI world that we are in, I need to learn more about the creator behind a project to trust it. Something that can help me know why the creator is qualified to deliver on the promises being made, that I can trust their judgement and decision, that they know what they are doing and don't need AI to tell them what/how to do it, and that they are committed long term to the project. Do you think you could share a bit about you that would give me some answers on those?
- dgf18 17d ago[dead]
- killerstorm 17d agoA lot of information here: https://gist.github.com/VictorTaelin/77fd5a2a8a4a07e1da6157ebca3c7cf1 https://gist.github.com/VictorTaelin/77fd5a2a8a4a07e1da6157e... https://github.com/victortaelin https://github.com/victortaelin
- IanCal 16d agoThis is a nice reminder for people. Cool project! This is really interesting, I’ve been very interested in the power of checks for code and things like hypothesis (which seem very similar in terms of writing a “for this kind of case, this holds true”, obviously different in terms of statistical checking vs actual proof). I’ll have to explore and this isn’t my field so this isn’t a substantive comment and this may be bikeshedding but I found the game example a little confusing at first because we’d want winning to be possible. It fits the context of stopping a bad thing happening if it’s “evil actor can’t do X” and if your mind is on CTF but games we want to win. Potential changes: Make it a proof that the game can be won. Make it require something first - so the game can’t be won unless the key is found for example. End result is still roughly the same and the failure case is still the same (walk over side of game) but it’s the kind of thing I’d want encoded in a puzzle game - game is winnable, but not winnable without getting the key first. Since my other direction normally would be quickcheck style, I’d be interested in cases that are statistically hard to find but easy to prove exist. And in fairness, the other way too I guess. When to use each approach. In the spirit of your comment, these are not things I see as failings, they are not things I in any way expect to be changed or done, they are intended as just an outsiders perspective if useful. Thanks for making things, and thanks for releasing them!
- cyanmoonx 16d ago[dead]
- cyanmoonx 16d ago[dead]
- jsnider3 16d agoGlad to see this finally released! What are you doing next?
- ycucumber 16d ago[flagged]
- tuesdaynight 14d agoI remember how negative were the comments in your last submission here. They were unnecessary and I never understood why. I hope you get better comments now.