Re:Functional Programming in Lean – a book on using Lean 4 t...
by d_christiansen on Sunday May 28, 2023 @05:08PM
(#36107798)
Lean 4 is an interactive theorem prover. It's also a programming language with a self-hosting compiler. This is a free book on using Lean 4 as a programming language, written without assuming any background in functional programming. It's intended to be accessible to Python, C#, Rust, Kotlin, Java, TypeScript, and Scala developers. Today marks the final release, after more than a year of writing.
[ Parent
| on HN ]
Re:Functional Programming in Lean – a book on using Lean 4 t...
by mdm12 on Sunday May 28, 2023 @08:40PM
(#36109309)
Congratulations on the publication! As a dabbler in strictly typed functional programming languages like Scala and F#, I have always been curious about proof-oriented languages such as Coq or Agda, but found it difficult to justify the time investment. Lean seems to position itself as a theorem proving language that also supports general-purpose programs. Looking forward to digging into your book!
Re:Functional Programming in Lean – a book on using Lean 4 t...
by epgui on Sunday May 28, 2023 @11:12PM
(#36110182)
Agda and Idris both also position themselves similarly.
Re:Functional Programming in Lean – a book on using Lean 4 t...
by siknad on Monday May 29, 2023 @07:15AM
(#36112835)
Lean4 is intended to be both, while Idris is more on the programming side and Agda - one the proof side. Maybe I'm mistaken about Idris, but Agda really doesn't prioritize programming: library handling, ffi, and tooling are all rudimentary.
Re:Functional Programming in Lean – a book on using Lean 4 t...
by epgui on Monday May 29, 2023 @06:22PM
(#36118799)
You may be right— My knowledge of these languages does not run very deep (although I am enthusiastic about them and am learning).
Re:Functional Programming in Lean – a book on using Lean 4 t...
by d_christiansen on Monday May 29, 2023 @05:58AM
(#36112397)
Thanks! I hope you find it valuable!
Those other languages are also definitely worth learning. Happily, there's lots of cross-transfer of ideas and skills between them, so learning one will make the others easier. I got my start in dependent types with Software Foundations and Coq, and that was very helpful when learning Agda and Idris later. Similarly, skills from them transferred quite readily to Lean.
Re:Functional Programming in Lean – a book on using Lean 4 t...
by ykonstant on Sunday May 28, 2023 @08:41PM
(#36109318)
Thank you very much for this book. It has been invaluable for my introduction to Lean and a joy to study from. I still have not read the last chapter, looking forward to it! Kudos for your effort, and I hope you will write some more stuff about Lean in the future.
Re:Functional Programming in Lean – a book on using Lean 4 t...
by d_christiansen on Monday May 29, 2023 @06:00AM
(#36112402)
Thank you for reading it, and I hope that the final chapter is also enjoyable for you. Right now, I plan to take a break - this book occupied every Saturday for about a year, and some time off is in order. But Lean is tons of fun, and I'd like to get back into it once I'm recovered a bit.
Re:Functional Programming in Lean – a book on using Lean 4 t...
by Reitet00 on Monday May 29, 2023 @12:44AM
(#36110741)
This looks very nice! Is epub version planned?
Re:Functional Programming in Lean – a book on using Lean 4 t...
by d_christiansen on Monday May 29, 2023 @06:02AM
(#36112412)
Unfortunately not. I wanted to produce PDF and epub versions in parallel with the HTML version, but getting those to be of sufficient quality would have blown the time budget for the project. There's some old code in the Git history for dumping the source to Pandoc's dialect of Markdown, from which I was going to generate those, but the differences in Markdown dialects are enough that it was a fair bit of work.
Dropping a print version and focusing on epub could very well be faster, as I suspect that an mdbook->epub pipeline is less challenging than creating a quality print-ready PDF. But no plans right now.