Tuesday, June 15, 2010

Calling Conventions

In *n?x the C calling convention reigns supreme. The C calling convention allows libraries and programs to be written in different languages - to a certain extent. OpenVMS extends the idea of a calling convention with its calling standard[1]. The OpenVMS approach provides more detail than the C one, allowing better interoperability between languages.

Another issue, that might be related is that of bindings. Many libraries are written in compiled languages, and must have bindings made to be used from a scripting language. This strikes me as less than satisfactory - I would like to get access to a new library for free, no need for bindings. Unfortunately, I think that there is a problem with this idea - namely, scripting languages generally have higher level constructs available than the lower level language the libraries are written in. This means, to provide an interface appropriate for the scripting language, taking advantage of its idioms and syntax, additional information is needed. The alternative is for a standard for libraries to follow which recognizes, and encodes information for all desired idioms. This strikes me as absurd, since it requires an update to the system in the case that a language introduces an idiom that isn't yet recognized, and coded for.

What I think I want is a system where a common set of functionality is available to any language on the system, and any language can be used to add functionality to that set. Perhaps the executable or process provide this ideal in *n?x.

[1] OpenVMS Calling Standard

No comments: