Difference between Scala’s existential types and Java’s wildcard by example?

This is Martin Odersky’s answer on the Scala-users mailing list: The original Java wildcard types (as described in the ECOOP paper by Igarashi and Viroli) were indeed just shorthands for existential types. I am told and I have read in the FOOL ’05 paper on Wild FJ that the final version of wildcards has some … Read more

How to learn agda

When I started learning Agda about a year ago I think I tried all available tutorials and each taught me something new. You should probably give Coq a try, because it has a larger user base and there are two nice books available for it: Coq’Art – slightly dated, but beginner friendly Certified Programming with … Read more

Why does null exist in .NET?

We’ve got Tony Hoare, an early pioneer that worked on Algol to thank for that. He rather regrets it: I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). … Read more

What makes Haskell’s type system more “powerful” than other languages’ type systems?

What is it, specifically, that makes Haskell’s type system It has been engineered for the past decade to be both flexible — as a logic for property verification — and powerful. Haskell’s type system has been developed over the years to encourage a relatively flexible, expressive static checking discipline, with several groups of researchers identifying … Read more

How to manually return a Result?

Error is a trait and you want to return a trait object (note the dyn keyword), so you need to implement this trait: use std::error::Error; use std::fmt; #[derive(Debug)] struct MyError(String); impl fmt::Display for MyError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, “There is an error: {}”, self.0) } } impl Error for … Read more

Which languages are dynamically typed and compiled (and which are statically typed and interpreted)?

Here’s a list of a few interesting systems. It is not exhaustive! Dynamically typed and compiled The Gambit Scheme compiler, Chez Scheme, Will Clinger’s Larceny Scheme compiler, the Bigloo Scheme compiler, and probably many others. Why? Lots of people really like Scheme. Programs as data, good macro system, 35 years of development, big community. But … Read more

Why Is Dynamic Typing So Often Associated with Interpreted Languages?

Interesting question. BTW, I’m the author/maintainer of phc (compiler for PHP), and am doing my PhD on compilers for dynamic languages, so I hope I can offer some insights. I think there is a mistaken assumption here. The authors of PHP, Perl, Python, Ruby, Lua, etc didn’t design “interpreted languages”, they designed dynamic languages, and … Read more

Functions don’t just have types: They ARE Types. And Kinds. And Sorts. Help put a blown mind back together

You touch so many interesting points in your question, so I am afraid this is going to be a long answer 🙂 Kind of (->) The kind of (->) is * -> * -> *, if we disregard the boxity GHC inserts. But there is no circularity going on, the ->s in the kind of … Read more