Effect Systems vs. Print Debugging: A Pragmatic Solution
blog.flix.dev·3h·
Discuss: Hacker News

“Every lie we tell incurs a debt to the truth. Sooner or later, that debt is paid.”

— Valery Legasov (Jared Harris, Chernobyl 2019)

Lying to a type system works the same way: the truth eventually comes out. In memory-safe languages, that usually means a runtime error (e.g. a ClassCastException, a TypeError: foo is not a function, and so on). In memory-unsafe languages, the consequences can be more dire: corrupted data, segmentation faults, or arbitrary code execution. Nevertheless, if we are in a memory-safe language, we might not feel too bad about lying to the type system...

But what happens when you lie to the effect system? Nothing good.

To understand why, let us examine how the Flix compiler leverages the effect system:

**Dead code elimination:*…

Similar Posts

Loading similar posts...