4 ms·
Grow Your Own Type System
- edgarbob 11y agoThis is really cool. It's surprisingly hard to find good examples of how to implement type inference.
- shadowfox 11y agoIf I remember right, TAPL (Types and Programming Languages by Benjamin Pierce) contains implementations for nearly everything that it talks about. So you can find another implementation of Hindley-Milner there. I don't think it includes row typing though.
- deleted 11y ago[deleted]
- danblick 11y agoYes, there are implementations for many of the type systems in the book. :) https://www.cis.upenn.edu/~bcpierce/tapl/checkers/ https://www.cis.upenn.edu/~bcpierce/tapl/checkers/ The code is pretty elegant. I think it's intended to be clear enough for students in his classes to modify.
- jarcane 11y agoI think PLAI gets into it, but I've not read it. http://cs.brown.edu/courses/cs173/2012/book/ http://cs.brown.edu/courses/cs173/2012/book/
- TerryADavis 11y agoI want minimal abstraction. The fewer times you have to look something up to understand the code, the better. I have no #define functions. I have no enums. I have no typedefs. I put graphics in source code. You don't have resource files -- it all goes in source code. You don't need to jump around to different source files. God says... penalize spaded hubbub's sidling theist's whit fortified groupings Negros sponsor's countrywoman Lodz Angelina dogmata nonsmokers superpowers stanches Castro retook instructor's entropy's funniness's squad's strangulated Liz's shortcake's feta's Mamie's Parthia's hotel chintz's dogmatism's abets dodo's Reva's savagest purveys bullfight Nora woozier Moravian botch blink's thunderclap nontransferable reproof cheeriness's farthing Aquarius's tool psychic averred skyjackers confuted Odell's drowsed noisiness's supplementing slide's pounded droves Brahma's catholicity bookstores Ndjamena's culling popularization's Coleridge scrolls fogy's invaluable portliest withers clothier's ruminating frailer Tswana's emancipate decaf's compliant contribute Songhua's testamentary Foosball's twin's sensual databases grannie's thunderhead's loathing's jonquils earthed prejudiced Claudette downplays malingerer's sell sides Estonian syllabified
- delish 11y agoThis looks like the beginning of a good suggestion: "The book that I really, really want: Lisp in Small Pieces, but for type theory" https://twitter.com/d_christiansen/status/573767527081316354 https://twitter.com/d_christiansen/status/573767527081316354 I want that book too.
- dmytrish 11y agoDoesn't "Types and Programming Language" by B. Pierce fits this description? I did not read LiSP, though.
- bjz_ 11y agoOne of the issues I've found with the TAPL examples and Grow-Your-Own-Type-System implementations is the lack of explicit, top-level type definitions. I know whole-program type inference is great and all, and ML programmers love to show it off, but it makes everything much harder to follow and understand. That said, they are still very useful, and I'm thankful that the author published them!
- mercurial 11y agoThat's a fair point (the repo doesn't even have .mli files, it looks like). However, the author has at least gone for somewhat-helpful binding names, as opposed to the single-letters-are-cool which all too common in OCaml codebases.