Sketching is a superset of programming by example. In examples, you only get input/output pairs, which as this thread shows, infers frustratingly close but wrong programs.
In sketching, the input and output can also includes partial programs (sketches), so you can mark what you like, tweak, etc, and it fills in the rest.
Increasing usability, the fragments can be in different languages. For example, input can be simple C and some test data, and output can be CUDA GPU code or pthread mutex locking schemes.
For Graphistry.com, we believe in these techniques for ETL and sketching visualizations.
(Also, sketching normally uses machine learning or SAT/SMT solvers: types are more typically used for input hints.)