The type system in Scala is Turing complete. Proof? Example? Benefits?

There is a blog post somewhere with a type-level implementation of the SKI combinator calculus, which is known to be Turing-complete. Turing-complete type systems have basically the same benefits and drawbacks that Turing-complete languages have: you can do anything, but you can prove very little. In particular, you cannot prove that you will actually eventually … Read more

Compile-time and runtime casting c#

Upcasts can be checked at compile time – the type system guarantees that the cast succeeds. Downcasts cannot (in general) be checked at compile time, so they are always checked at runtime. Unrelated types cannot be cast to each other. The compiler considers only the static types. The runtime checks the dynamic (runtime) type. Looking … Read more

What are some compelling use cases for dependent method types?

More or less any use of member (ie. nested) types can give rise to a need for dependent method types. In particular, I maintain that without dependent method types the classic cake pattern is closer to being an anti-pattern. So what’s the problem? Nested types in Scala are dependent on their enclosing instance. Consequently, in … Read more

Dynamic type languages versus static type languages

The ability of the interpreter to deduce type and type conversions makes development time faster, but it also can provoke runtime failures which you just cannot get in a statically typed language where you catch them at compile time. But which one’s better (or even if that’s always true) is hotly discussed in the community … Read more

tech