| ▲ | Buttons840 a day ago | |
The opposite is also interesting. Would this have happened without Lean? I only scratched the surface of De pendant Types long ago with The Little Typer[0], but there is basically nothing that cannot be verified correct at compile time, so long as we're smart enough and write the code. Well, now we have a smart tool that can write lots of code. Why are we not verifying everything at compile time? Let's say we want to write a function that: 1) receives data over the internet 2) returns that data so long as it is a valid solution to a Sudoku puzzle 3) returns an error otherwise 4) is allowed to print to a debug log, but nowhere else 5) is NOT allowed to access the local file system 6) cannot change global variables We can write a function that does all of this and verify that all those condition are always true AT COMPILE TIME. We can make it so those things are ALWAYS true. Well, I guess we can't ensure the function is connected to an operational internet, but... well, you get the point. There are limits outside the programming language, but within the rules of the programming language we can ensure all kinds of things are ALWAYS true, and we can prove this is true AT COMPILE TIME. Unit tests suck, forget tests. We have a shape and we cut a hole to match the shape and then we put the shape through the hole and pat ourselves on the back because the shape passed through the hole. This is unit testing. Meanwhile Lean's type system is proving the Riemann hypothesis. I feel like we haven't seen the language of the future yet, but I bet Lean is the closest to it. | ||
| ▲ | program_whiz a day ago | parent [-] | |
The compile time is ~2 hours for 76k line abbreviated prove on dozens of cores. You can imagine how long and how much memory millions of lines will take. These solvers are slow, its very hard to make them faster while keeping it totally general and robust. For arbitrary code you can end up in "SAT solver" territory where in theory the question you are asking is an exponential combination of discrete inputs. So while "verify everything" sounds very nice, unless it is well implemented there are good reasons to avoid (unless you have 2-4 hours to kill every time you change a line). The Mathlib which is the core of this can take half an hour and many gigs of RAM to compile as well. Only languages that have a decent chance at reasonable compile times and memory use either A) place restrictions on what can be proven / types / logic, B) functional with neutered expressiveness so that values are immutable, everything has one return type, etc. | ||