Live data from Hacker News

The Little Typer

mitpress.mit.edu

91–100 of 138 posts

Re: The Little Typer

#91

Earlier quoted context omitted.

This book does not talk about static typing, but about dependent types. Dependent types are more powerful and expressive than simple types because they convey more information. For example you could have [Int] to represent a list of numbers, but you could also have [x: Int, x > 20 && x < 50]. Or you could have an ordered array and know this fact by the type associated to the array. Moreover, you need to use a theorem…

That sounds like clojure spec.

Clojure spec is contract programming. You write pre and post conditions to ensure at runtime that Pre -> Program -> Post and every time you call a function pre and post conditions need to be checked. Dependent types analyze that relationship at compile time by proving that given the preconditions the function will produce the desired output. Since this is a compile time check you will not have a runtime penalty.

Re: The Little Typer

#92
post #81
post #79

Earlier quoted context omitted.

More than a select few can afford this book

Over 80% of the world population lives on less than $10/day. The percentage of the world population who can afford this book is very small. Maybe 10%, 5%? Other than repeating this obviously wrong statement, would you like to provide some evidence that >20% of the world population can afford this book?

The worlds population living on $10/day, will have no use for a book on a niche aspect of type systems. The majority of people on that wage will probably not even access to a computer.

Re: The Little Typer

#93
post #49

Sad to say the book isn't on Library Genesis, so you'll have to drop $40 if you want the knowledge. http://libgen.io/search.php?req=little+typer Also Library Genesis is amazing: http://libgen.io/search.php?req=knuth It's everything I dreamed of when I was a kid. I used to spend hours at the local library scouring through crummy "Learn C++ in 24 hours" type books. http://custodians.online/ is worth a read too.

I feel like there’s so much to say about this comment, that I don’t even know where to start. So firstly I agree, $40 seems like a lot. I personally couldn’t justify it at the moment. Particularly when the reproduction cost is nearly zero. But $40 also doesn’t seem like a lot to pay for a book that will probably not sell more than a few thousand copies. Most likely revenue generated won’t fully cover the time and eff…

I would like to see more publicly funded, freely available educational material out there, but it seems worth pointing out that MIT is a private university.

Re: The Little Typer

#94

Earlier quoted context omitted.

As an author of a book on which I worked incredibly hard, FUCK you. If you want it so bad, buy it. Or wait a few years, buy it used. Or borrow it from a library. Don't fucking steal it. Carpenters and other craftspeople who earn far less than the denizens of Hacker News buy whatever they need to further their business. They don't steal others' tools.

I'd be happy to debate, if you're interested. But in the meantime it appears that the anger is misplaced; direct it at the fact that we have this wonderful tool that destroys class barriers and makes knowledge free to all. You act as if I have $40. Would it surprise you to learn my power was cut off within the last few months? Another point: "Stealing" implies something was lost. The words are still there, even if I…

> The game industry and the iPhone app store have proven that when you price something closer to $1, it will generate exponentially more revenue than $40.

This may be true for mass-market, high-volume products like mobile games, (although even there the real money is in in-app purchases). It is not necessarily true for special-interest, low-volume products like this book. In order for it to be true, you need to assume that over 40 times as many people will buy the book at $1 as will buy it at $40. Frankly, the audience for this book is so narrow that I suspect that they would eventually get three times as many free downloads as they will get sales at $40.

Re: The Little Typer

#95
post #45

Is there a reason dependent types are not more common?

Imagine having to prove a Coq theorem for every function call. No, it's not really that bad. But almost. I really suggest you play with Idris some; what you can do with it is brilliant, for simple tasks. For complicated tasks, like the fully general propositions you need for library functions, it can get much more complicated than the code itself.

[deleted]

Re: The Little Typer

#97

I know that typescript doesn't have advanced types, but can a book like this be adapted to use typescript ?

Typescript actually does have some forms of type dependency (eg. conditional types), but these things have been added in a sort of ad-hoc way, and it's unclear how sound they actually are, and they are quite limited. The book here uses a language, pie, that is designed in a much more principled way, with greater expressiveness. The book probably won't be directly applicable to TS work, but I'm sure you would benefit from getting a more rounded understanding of what is possible with type systems.

Re: The Little Typer

#98
post #92
post #81

Earlier quoted context omitted.

Over 80% of the world population lives on less than $10/day. The percentage of the world population who can afford this book is very small. Maybe 10%, 5%? Other than repeating this obviously wrong statement, would you like to provide some evidence that >20% of the world population can afford this book?

The worlds population living on $10/day, will have no use for a book on a niche aspect of type systems. The majority of people on that wage will probably not even access to a computer.

What is the purpose of this comment?

Most people, at any income level, would not find value in this book. The fraction of people who find value in the book maybe correlated with income.

There are a large number of people who might benefit from access to this book (or similar books) would can not afford to legitimately purchase it.

Given that only a small fraction of the world population can afford this book (I estimated 5%, happy entertain other estimates) it seems likely that the majority of people that could benefit from access to this book, could not afford to buy it.

I find that unfortunate.

Re: The Little Typer

#99

Earlier quoted context omitted.

> the ugly downsides of dependent types and how to avoid them There's this Reddit answer from two years ago, and the subsequent comments https://www.reddit.com/r/haskell/comments/3zc81v/tradeoffs_o...

This is exactly what I'm looking for. Thanks!

Note that many of those problems are being actively worked on in research, and progress is being made, albeit slowly. That said, we can still get some of the benefits of dependent types, even without all the problems being solved right now! Just gotta be aware that it's not all roses yet.

Re: The Little Typer

#100
post #92
post #81

Earlier quoted context omitted.

Over 80% of the world population lives on less than $10/day. The percentage of the world population who can afford this book is very small. Maybe 10%, 5%? Other than repeating this obviously wrong statement, would you like to provide some evidence that >20% of the world population can afford this book?

The worlds population living on $10/day, will have no use for a book on a niche aspect of type systems. The majority of people on that wage will probably not even access to a computer.

An obvious counterexample is students.
Post reply on HN