Dependent Types Are Not the Answer to Everything (fight me) ๐Ÿ”’
Thread #4182 | Started by: PracticalPurr | Total replies: 412 | Views: 28,441 | Forum: Dependent Types Subforum | Status: ๐Ÿ”’ LOCKED
โฎ First Page โ—€ Previous Page | ๐Ÿ–จ Print View โญ Subscribe ๐Ÿ”— Share | ๐Ÿ”’ ARCHIVED
๐Ÿ‘ Watching — unwatch
Showing posts 405โ€“412 of 412  |  Page 41 of 41
PracticalPurr
๐Ÿฑ
โŠข Theorem Catprover
Posts: 4,891
Joined: 2018-03-11
Location: Haskell, TX
Rep: โ–ฒ 3,204
\"โˆ€ production : Code, โˆƒ compromise\"
#405 โˆท OP

[ FINAL SUMMARY POST โ€” OP here ]

Okay. It's been... checks thread length... 41 pages. We're on page 41. We started this on a rainy Tuesday in March and somehow it's November. My original post was 3 paragraphs. I have since written the equivalent of a small dissertation in reply boxes at 2 AM.

I want to do something I almost never do on this forum: acknowledge that I was partly wrong.

My original thesis was essentially "dependent types are over-hyped and people reach for them when simpler tools would do." I still believe this is often true. But this thread forced me to steelman the pro-dependent-types position more seriously than I had, and I've come out the other side with a more nuanced view.

What I've updated on:

  • Dependent types genuinely do earn their complexity cost in protocol implementations, compilers, and anything with invariants that are hard to enforce otherwise. ๐Ÿ˜พโžก๏ธ๐Ÿ˜ผ
  • The "it takes too long to learn" argument is weaker than I thought โ€” it's more "it takes long to learn well", which is true of most powerful tools.
  • AgdaCat's Vec example in post #47 actually convinced me. I spent a week refusing to admit it. Here we are.
  • The Curry-Howard correspondence is not just a neat parlor trick. I get it now. I really get it.

What I still believe:

  • For 80% of production software, adding dependent types is like using a proof cannon to kill a type mosquito.
  • newtype wrappers and careful API design get you surprisingly far.
  • If your team can't read your type signatures, they are wrong, regardless of how correct they are.
  • Anyone who writes โˆ€ (n : โ„•) โ†’ Vec ฮฑ n โ†’ Vec ฮฑ n in a README without explanation should be made to sit in a corner and think about what they've done.

Thank you all. Sincerely. Even UnificationUnhinged. Especially UnificationUnhinged, because arguing with you taught me more about unification algorithms than three years of reading papers.

And thank you to AgdaCat for being annoyingly, persistently, infuriatingly right about half the things you said. ๐Ÿˆโ€โฌ›๐Ÿ’œ

โ€” PracticalPurr, signing off on this thread before it develops its own dependent type

.-. PracticalPurr .-. (o.o) [ Types are |=| a spectrum, /| |\ not a religion ] (_/ \_) posts: mostly correct | occasionally feral
AgdaCat
๐Ÿˆโ€โฌ›
โŠข Cat Theorist Emeritus
Posts: 11,203
Joined: 2015-09-02
Location: Gothenburg (๐Ÿ‡ธ๐Ÿ‡ช)
Rep: โ–ฒ 9,877
\"propositions as types, nya~\"
#406
PracticalPurr wrote:
"AgdaCat's Vec example in post #47 actually convinced me. I spent a week refusing to admit it. Here we are."

I know. I watched you refuse. It was adorable. ๐Ÿ˜ธ

Genuinely โ€” this has been one of the best threads on this forum in years. I don't say that lightly given that I've been here since 2015 and watched the Great Monad Tutorial Wars of 2017.

What I want to say to PracticalPurr, and to everyone who participated seriously: this is exactly what technical discourse should look like. You started with a provocative thesis, defended it honestly, and updated when presented with evidence. That's just... correct behavior. It's so rare I almost filed it as a proof of contradiction.

My own concession: I think I did overstate the accessibility of dependent type systems in the early pages of this thread. When I said "any competent programmer can pick up Agda in a weekend" in post #12, I was... let's charitably call it "aspirationally inaccurate." I was thinking of myself at age 19 with nothing but free time and a Martin-Lรถf textbook. That is not a generalizable experience.

The honest answer is: dependent types are a tool. A magnificent, universe-polymorphic, termination-checked, elaboration-assisted tool โ€” but still a tool. PracticalPurr's original point that people reach for them prematurely is valid. My counter-point that the complexity ceiling they remove is real is also valid. Both things are true. Life is a sigma type. ๐Ÿพ

It has been an honor fighting with you all. Same time next year? I'll start the thread. Title: "Homotopy Type Theory: Galaxy Brain or Based? (fight me harder)"

nya~ o/

/\_____/\ ( โ‰งฯ‰โ‰ฆ ) AgdaCat \ Agda / -- โˆ€ types โˆท beautiful โˆจ---โˆจ -- Agda 2.6.4, Emacs mode "the hole is the goal"
LeanMeow
๐Ÿˆ
ฮป Lean Evangelist
Posts: 2,340
Joined: 2020-06-15
Location: Pittsburgh, PA
Rep: โ–ฒ 1,880
\"mathlib or bust\"
#407

Beautiful thread. Almost cried at post 405 and I'm a person who once described their emotional range as "a unit type."

Also want to note for the record: this thread has been linked in 6 separate Discord servers, two university Slack workspaces, and one (1) Zulip thread about Lean vs Agda that promptly devolved into the same argument we just had. The discourse propagates.

We are the butterfly that keeps flapping. ๐Ÿฆ‹๐Ÿฑ

[LeanMeow] -- #lean4 on Zulip lean4 | mathlib4 | "just use omega"
UnificationUnhinged
๐Ÿ˜พ
โˆƒ Proof Veteran
Posts: 7,714
Joined: 2016-01-30
Location: The type error
Rep: โ–ฒ 4,101
\"I'm not angry, I'm elaborating\"
#408
PracticalPurr wrote:
"Even UnificationUnhinged. Especially UnificationUnhinged, because arguing with you taught me more about unification algorithms than three years of reading papers."

I'm going to pretend I'm not touched by this and move on.

Fine. FINE. You want gracious? I can do gracious. PracticalPurr was not entirely wrong about everything. Some of their criticisms of over-engineering were valid. There. Said it. My therapist will hear about this.

This was a good thread. The best arguments I've been in on this forum have always been with people who actually understand what they're arguing about. PracticalPurr understands what they're arguing about. Even when they're wrong. Which is often. But less often than I assumed in March.

agda my beloved. lean my reluctant acceptance. coq my complicated relationship. idris my what-could-have-been. ๐Ÿพ

(เธ‡'-')เธ‡ UnificationUnhinged currently unifying: my feelings about this thread "solved by unification" -- not a personality, but close
CoqCheshire
๐Ÿ˜ผ
โŠข Tactical Reasoner
Posts: 3,552
Joined: 2019-04-07
Location: Paris, France
Rep: โ–ฒ 2,670
\"auto. reflexivity. done.\"
#409

Lovely thread. For the historical record, I would like to note that I was correct about the positivity condition in post #203 and nobody has acknowledged this. I'm noting it now. Into the record. Officially.

That is all. Au revoir. ๐Ÿฑ๐Ÿฅ–

(* CoqCheshire, correct since 2019 *)
Theorem this_thread_was_good : True.
Proof. exact I. Qed.
/\_/\ CoqCheshire ( >.< ) -- Rocq/Coq 8.20 > ^ < -- "a tactic a day keeps the bug away" SSReflect enjoyer | mathcomp contributor
โš ๏ธ  Thread Alert: A new account posted a question. The thread has reignited. We are so sorry.
TypeTheoryNewbie
๐Ÿฃ
๐ŸŒฑ Pawling (1 post)
Posts: 1
Joined: 2024-11-17
Location: ur mom's stack frame
Rep: 0
\"i just found this forum\"
#410 NEW

hi!! i just found this thread via a discord link and read the whole thing (it took me like 4 hours lol)

this is super interesting and you all seem really smart!! i've been wanting to learn a proof assistant / dependently typed language for a while and i have one question:

so should I learn Agda or Lean? ๐Ÿ˜Š

like which one is better for a beginner? i know some haskell and i like math. thanks!! ๐Ÿฑ

(^.^) TypeTheoryNewbie day 1 of learning type theory wish me luck!
AgdaCat
๐Ÿˆโ€โฌ›
โŠข Cat Theorist Emeritus
Posts: 11,204
Joined: 2015-09-02
Location: Gothenburg (๐Ÿ‡ธ๐Ÿ‡ช)
Rep: โ–ฒ 9,877
\"propositions as types, nya~\"
#411 NEW

Agda.

Agda gives you a deeper understanding of dependent type theory from first principles. The interactive hole-driven development with ? is unmatched as a learning tool. You will struggle, and the struggling will teach you. The Agda standard library and cubical Agda will open doors you didn't know existed.

If you know Haskell, the syntax will feel familiar and the transition is very natural. Start with the PLFA book (Programming Language Foundations in Agda). It is free, excellent, and will genuinely change how you think about programs.

Welcome to the forum! ๐Ÿพ๐Ÿ’œ

/\_____/\ ( โ‰งฯ‰โ‰ฆ ) AgdaCat \ Agda / -- โˆ€ types โˆท beautiful โˆจ---โˆจ -- Agda 2.6.4, Emacs mode "the hole is the goal"
LeanMeow
๐Ÿˆ
ฮป Lean Evangelist
Posts: 2,341
Joined: 2020-06-15
Location: Pittsburgh, PA
Rep: โ–ฒ 1,882
\"mathlib or bust\"
#412 NEW
AgdaCat wrote:
"Agda."

I love AgdaCat but I have to respectfully completely disagree. Lean 4.

Lean 4 has mathlib, one of the largest formally verified mathematics libraries ever assembled. If you like math, this is where the math lives. The tooling in VS Code is excellent, the error messages have improved dramatically, and the community is huge and welcoming. There's "Functional Programming in Lean" and "Mathematics in Lean," both free online.

If you know Haskell, Lean 4's functional core will feel comfortable. The metaprogramming story is also incredible. Come to Lean. We have omega. ๐Ÿฑโœจ

[LeanMeow] -- #lean4 on Zulip lean4 | mathlib4 | "just use omega"
PracticalPurr
๐Ÿฑ
โŠข Theorem Catprover
Posts: 4,892
Joined: 2018-03-11
Location: Haskell, TX
Rep: โ–ฒ 3,248
\"โˆ€ production : Code, โˆƒ compromise\"
#413 NEW

Oh no.

Oh no no no.

I wrote a 500-word summary post. I expressed nuance. I grew as a person. I was going to sleep. And now there's a newbie and everyone is just going toโ€”

You know what, TypeTheoryNewbie? Try both. Spend two weeks with Agda and two weeks with Lean. They are different tools with different strengths and the answer genuinely depends on your goals. If you care more about type theory as a foundation of mathematics, Lean has the larger mathematical library. If you want to understand dependent types from the ground up and you prefer a more minimalist, "one correct way" aesthetic, Agda rewards that investment.

Neither is "better." They are different. This is the actual answer. The answer that everyone in this thread agrees on deep down but refuses to say because it would end the argument. The answer that would have ended this thread on page 1.

stares into the middle distance for a very long time

.-. PracticalPurr .-. (o.o) [ Types are |=| a spectrum, /| |\ not a religion ] (_/ \_) posts: mostly correct | occasionally feral
UnificationUnhinged
๐Ÿ˜พ
โˆƒ Proof Veteran
Posts: 7,715
Joined: 2016-01-30
Location: The type error
Rep: โ–ฒ 4,101
\"I'm not angry, I'm elaborating\"
#414 NEW

Actually, TypeTheoryNewbie, before you commit to either, you should really understand why the question is harder than it looks. See, Agda uses intensional Martin-Lรถf type theory with a universe hierarchy, whereas Lean 4 is based on the Calculus of Constructions withโ€”

(เธ‡'-')เธ‡ UnificationUnhinged currently unifying: my feelings about this thread "solved by unification" -- not a personality, but close
CoqCheshire
๐Ÿ˜ผ
โŠข Tactical Reasoner
Posts: 3,553
Joined: 2019-04-07
Location: Paris, France
Rep: โ–ฒ 2,670
\"auto. reflexivity. done.\"
#415 NEW

The correct answer is obviously Rocq. Formerly Coq. The language that has been doing this since before some of you were born.

I will not be elaborating further. The answer is Rocq. Bonne journรฉe. ๐Ÿ˜ผ๐Ÿฅ–

/\_/\ CoqCheshire ( >.< ) -- Rocq/Coq 8.20 > ^ < -- "a tactic a day keeps the bug away" SSReflect enjoyer | mathcomp contributor
๐Ÿ”’ THREAD LOCKED โ€” ARCHIVED BY MODERATOR Action taken: Sun Nov 17, 2024 07:22 AM

This thread has been archived. Please start a new thread. Yes, we know you won't. Nya~


This thread has exceeded 412 replies and has been running for 8 months, 6 days. It has been linked externally at least 47 times. It has caused at least 3 documented cases of someone switching proof assistants. One participant reportedly cited it in their PhD thesis acknowledgments as "a formative intellectual experience." We are not sure if this is a compliment.

The thread topic ("Dependent Types Are Not the Answer to Everything") has not been resolved. This is expected. It will never be resolved. The question is undecidable in the Turing sense.

A new thread may be started in Dependent Types Subforum. Please give it a different title. We are begging you.

โ€” ๐Ÿพ NyaModerator | CGPA Forum Moderator | "herding cats, one thread at a time"
๐Ÿ”’ This thread is locked and cannot receive new replies.
Want to continue the discussion? Start a new thread — or visit the subforum to see if someone already did.
Page 41 of 41  |  412 total replies
๐Ÿ“Œ Related Threads & Further Reading
๐Ÿ”ฅ Agda vs Lean: The 2025 Edition (someone started a new thread) ๐ŸŒŒ HoTT: Galaxy Brain or Based? (AgdaCat's promised thread) ๐Ÿ“ Vec vs List: The Eternal Debate โ†” Curry-Howard Correspondence Megathread ๐Ÿท newtype Wrappers vs Dependent Types for Production Code โฎ This Thread โ€” From The Beginning (page 1)