Skip to content
0:00 / 0:00

#haskell#inspection-testing#ghc

BOB 2019 - Joachim Breitner, Inspection Testing

BOBKonf

978 subscribers • 7 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Joachim Breitner

Advanced. Deep dive for people who know the field.

277 views7 years ago1 recommendation

Programming languagesTools and practiceTestingPerformance and optimizationCompilers and interpreters

Joachim Breitner explains how to use inspection testing to verify that Haskell compiler optimizations successfully remove abstractions.

Joachim Breitner Inspection Testing Some high-quality Haskell libraries, including old friends like text and new kids on the block like generic-lens, promise that the abstractions provided by these libraries are actually free and will be completely dissolved by the compiler. In the case of text the promise is that certain pipelines of text-processing functions will be optimizes (“fused”) to never allocate a full text value; generic-lens promises that its generically derived lenses are, after optimization, identical to handwritten ones. But, in practice, these promises often don’t hold. They held at some point in the past, when the author checked them manually, but later versions regressed. This problem can be fixed with inspection-testing, a Haskell library and plugin to the compiler that allows you to explicitly state what you expect from the compilers optimizations, and have the compiler check that it actually happens. This can be used by library authors to test their promises, but also by users to learn more about what the compiler does with their code. In this talk, you will discover the tale of broken promises in commonly used Haskell libraries, and you will learn how these promises can be checked automatically using inspection-testing. bobkonf.de/2019/breitner.html

Why it's here

1 person recommends this

What people say. Recommended as a solution to ensure compiler optimizations and fusion promises are kept in Haskell libraries.

u/gelisamin r/haskell • Recommends

On “Are people still using lenses ?”

I know it doesn't; the paper promised it doesn't, and /u/nomeata made them kept their promise ;)