Hacker News new | comments | show | ask | jobs | submit login

I think things are trending towards being more interactive.

In the immediate future, GHC is going to become more interactive by adding "type holes". Essentially, you can just leave out parts of your program and the compiler will tell you what type needs to go there. So instead of writing your program and checking if it typechecks, the type system can actually help you formulate the code in the first place!

Further afield, a bunch of people at the lab I'm working at are working on interactive systems that use a solver running in the background to solve problems for the programmers. These can be used to do all sorts of things from finding bugs to actually generating new code. Being interactive lets the solver suggest things without being 100% certain--the programmer can always supply more information. This also makes the solvers easier to scale because if it's not terminating quickly, it can just ask for more guidance from the programmer.

I think the general trend towards more interactive development is pretty exciting.




There's already a very primitive version of "type holes" available, namely, undefined. I realize it's not as advanced as what's to come, but I find myself using it somewhat frequently.

(For non- or fledgling Haskellers, "undefined" has any type, so if you define a function that plugs into your code and make its return value "undefined", then you can look at the type signature of the function and learn what the compiler proved about the type of that function. Pretty handy!)


Type holes themselves are already included in the HEAD of the GHC trunk, and will be included with the next release I believe. Undefined is useful, but you can't get the types of a specific subexpression easily -- with type holes, you can.


Slight upgrade: turn on the -XImplicitParams flag and then use ?nameGoesHere instead of undefined. Detailed type information will leak out in the errors or, if it can infer all of the types, the type of the top level expression that contains your ?implicit.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: