Live data from Hacker News

Leanstral 1.5: Proof abundance for all

mistral.ai

111–116 of 116 posts

Re: Leanstral 1.5: Proof abundance for all

#111
post #62

Earlier quoted context omitted.

I like to make less money and pay more taxes for higher quality of life reasons. Sure I could go to America and have more many in my pocket by eating mcdonalds every day, but I'd rather eat amazing high quality food and have less money in my pocket.

what country is that ? I'm just curious as most European coworkers I have spoken to have not so nice things to say about EU and their country.

I live in Sweden, but would happily live in most European countries. Yes, some are less well functioning, and many that have joined the EU have significantly improved their living standard (not always counted in GDP), since joining the EU. There are always things to complain about in any country, and the hardest thing for most people to do is actually make a fair comparison, as they haven’t lived in another country.

I have lived in the UK, in the US and spent significant time running a startup in the Netherlands, and half the family lives there. I have relatives in Spain and in Switzerland. I have helped setup startup subsidiaries on all continents.

Re: Leanstral 1.5: Proof abundance for all

#112

Earlier quoted context omitted.

I've gone from zero knowledge of lean4 to the point where I'm doing most of my coding with it in ~6 months, and this was dramatically helped by how facile the AI assist is: it's remarkable how consistently fluent models are in lean4. I've found this to be true of the near frontier and smaller local models alike, LLMs just seem to get lean4. I still have a ways to go before calling myself a lean4 expert, but I don't n…

Any chance you can share any of your process? Super interesting to hear you use lean as a meta language, I'd be curious to see how you've harnessed this (as I'd like to do the same)!

I hope to open source some of this soon but it's still married to quirky internal build tools and other jank. I'll make a note to come back to this comment when there's code up.

In terms of process I don't know that I really have any unique edge or anything, I'm still very intermediate as a lean4 programmer. I was a strong Haskeller before so I had a little bit of a map. The key thing about lean4 coming from e.g Haskell is that it has a much cleaner type tower, there's no type/kind/PolyKind jank, it's just Type 0, Type 1, as high as you care to go (which usually isn't very high), so a fair bit is unlearning some of that.

A mistake I made was to try to learn lean4 in emacs, which I'm working on making more reasonable, but today lean4 is a vscode only experience IMHO, this is partially because the default Mathlib4 style is really unapproachable without the tooling (not being a professional mathematician I'll stop short of calling the style bad, maybe it's intuitive to mathematicians, but it's very ill suited for programming in the large as a hacker would approach it). Proofs of theorems are this tactic match space with a lot of implicit projection up into a big possibility space at every step, and then the next explicit tactic is grabbing things from that space often very implicitly. It's my least favorite part of the semantics (or maybe one I feel is over-used, there are ways to make it more explicit, the canonical example is probably `simp_only` which grounds in specific lemmas).

The effectful part of the language should be a pretty short hop from anything else with do-notation, it reads very naturally and the conditional/looping/match stuff sorta looks like Rust if you squint a little. One place the AI assist really shines is to go rename all the variables something reasonable, a lot of otherwise great code looks like it hybridized with a bizarre Hungarian-notation splinter faction, the keywords are fine.

There's some stuff that probably makes a lot of sense in a meta mathematical view of things that makes zero sense from a TCB standpoint. To mathematicians there is a distinction between the map coloring proof and Wiles' FLT proof. This is real and it makes sense in mathematics. But in high-assurance software having an issue with `native_decide` as opposed to `bv_decide` is a weird religion: TCB certifying them is identically compromised by a compromised compiler.

So I think it's mostly just a very small community trying to write code as the primary activity and layering on formal methods as a correctness strategy as opposed to a much bigger community doing real maths where the programming language is more of an amenity than the main show.

I suppose my approach is to be willing to go a different way in a different use case.

Re: Leanstral 1.5: Proof abundance for all

#113
post #96
post #61

Earlier quoted context omitted.

Do they even _make_ actual money? https://isaiprofitable.com/ seems to disagree.

You were a net loss for ~18y or even more and not many people were concerned.

I was a net loss for quite longer than that. Nobody was concerned because I was surrounded by people who loved me.

Re: Leanstral 1.5: Proof abundance for all

#114

Earlier quoted context omitted.

Have you ever been downvoted for calling 'dupe?' I once was downvoted after calling dupe on a link posted thrice. HN is an interesting place to hang out, that's for sure.

oh of course, unfortunately people's self-interest in pushing their own submissions and not being told they missed a story causes adverse reactions, but a bit of sacrifice worth keeping the site fresh and discussions focused.

I also classify 'presence on HN' as a cause of adverse reactions. ;)

Re: Leanstral 1.5: Proof abundance for all

#115
post #80

Earlier quoted context omitted.

Are you writing general use programs in it, then? Have any good examples?

It's early days of using it as a general purpose programming language, my initial use case was using it as a metaprogramming framework that lowered into target languages with some rigor on correspondence of the lowered artifact and the proof-amenable surface. By lines of code the biggest use case historically was describing state machines and codecs/protocols for high-assurance IO primitives: define QUIC or ZMTP once…

God damn.

Re: Leanstral 1.5: Proof abundance for all

#116
post #35

Earlier quoted context omitted.

Because this is garbage PR. That's it. Every property-based testing system (invented ca. 1980) will explore boundary values. The semantics (or lack thereof) of C and C++ can make this difficult to actually test for because the compiler is allowed to say "test passed" to any input leading to UB.

> The semantics (or lack thereof) of C and C++ can make this difficult to actually test for because the compiler is allowed to say "test passed" to any input leading to UB. I get what you are saying but does this actually apply to a test? If the code under test is in one compilation unit and the test harness in another and they are linked together then the UB optimization issue ends at the API boundary and can't poss…

It's definitely less likely with that technique (in practice!), but still very possible, via e.g. ODR violation or even the classic SIOF.

So, ideally you'd want each separate test case to be compiled separately, but even then you wouldn't be safe! ... because any UB in that test (or the code it's testing!) could lead to a random pass.

UB is good in some ways, but other ways it's really really bad.

EDIT: I will say: If you have a UBSAN turned on for testing, etc. you're reasonably safe... but not fully. There's a lot of stuff they don't catch because it's essentially impossible.

Post reply on HN