Arc gets I/O right

In any significant program, a great deal of code is spent on two activities that have very little intrinsic interest: I/O and error handling. This makes them good targets for language design. If a language can make these two areas easier, it can remove a significant part of the accidental complexity of programs. Conversely, a language in which either is difficult is a language in which effort is wasted on uninteresting problems.

This is where Arc is good. Many parts of it are hacky or just not there yet, but its I/O library is strikingly convenient. There's a lot there worth seeing and maybe stealing. In particular:

I/O is really a subset of a more general category, glue, which probably accounts for more complexity than everything else put together. And it's all accidental complexity, so it should be a target for libraries. Unfortunately I don't think there are any general ways to reduce it, because there are so many different transformations that have to be done. But simplifying I/O addresses the most common kind of glue. Remarkably, considering its age and importance, this area is not solved. There are still considerable improvements to be found, and Arc is finding some of them.

I wish I could find similar improvements in error handling.

Labels: ,

Comments

Check out REBOL as well. http://www.rebol.com/index-lang.html

They get a lot of this kind of stuff right as well-- the small language details that add up to a simpler and more enjoyable experience.
I wish I could find similar improvements in error handling.

Are you familiar with Erlang's supervisory trees?
I know about Erlang exit signals (although I have no idea how they work in practice), but not about supervision trees. Reading... it looks like they address the problem of recovering after an error, which is something I (unwisely?) don't usually worry about. The sort of error handling I was thinking of is the more mundane problem of expressing which handler to call after an error is detected. I think it should be possible to improve on the ML-style exceptions most modern languages use, but I haven't been able to do so. I should do a post about this.

My favorite part of Erlang's error handling isn't the multiprocess stuff, but the way it catches exceptions by plain old pattern matching - like ML, but without having to break the rules of the language. (ML exceptions are an open sum type, which ML doesn't otherwise support.) It's also nice that (IIUC) you don't have to declare them first, since anything that increases the effort required to signal an error is likely to discourage programmers from even checking for the error.

Post a Comment