(Originally written on 21. Februar 2009)
Listening to an episode on SE-Radio on Haskell made me think. Haskell is a pure functional programming language, in the sense that all functions are side-effect free. This makes debugging and testing much easier. From another perspective every function in Haskell is a well-defined interface between two components.
On the web, one main feature of the REST-style architecture is the side-effect free GET-method, which makes caching by intermediaries possible, which in turn makes the web so fast. Datatypes on the web are MIME content-types. So instead of calling a function with an getting a return type, on the web you call a function and express a list of desired return types in ascending order. Compared to programming languages, the type system of the web is rather weak. E.g. the IANA which is responsible for maintaining the registry of content types lists less than thousand types. Of course, many vendor-specific types are not listed there. Web APIs emerged together with the Web 2.0 hype. These APIs are described in natural language terms. In principle, the web has both call-by-value (sending data, returning data) as well as call-by-reference (sending URI, returning data).
The semantic web an RDF could serve well to describe a rich type-system. The missing building block for treating HTTP GET calls to URLs a functions in a programming language is a sort of language and compiler or runtime environment, that allows to compose functions etc. Or a library could map function calls in Java automatically to HTTP GET calls.
Hmm, this post seems unfinished. I'll post it anyway.
No comments:
Post a Comment