Hacker News new | ask | show | jobs
by choudanu4 3462 days ago
This is an interesting idea that has been explored before in VMS, an old operating system I believe competed with UNIX.

VMS had a feature called CLE (Common Language Enviornment) [1] which defined calling conventions for computing primitives (functions, registers, stacks...you get it) independent of any language. You could call bits of code from all sorts of languages like COBAL, FORTRAN, C, and some others I'm not really familiar with. Because the calling conventions were specifically designed for language interopperability in mind, VMS was implemented in several different languages. Different components were coded in whatever language best expressed them. This directly contrasts with Unix, which we all know champions C.

I'm not too familiar with Unix calling convention specifics, but as I understand, it revolves around C and its memory model. I believe this is what gives some languages difficulty "talking" with each other; if a language doesn't have a memory or execution model close to C's, it needs to translate through a FFI (Foreign Function Interface) [2] before exchanging execution routines efficiently.

[1](https://en.wikipedia.org/wiki/OpenVMS#Common_Language_Enviro...)

[2] (https://en.wikipedia.org/wiki/Foreign_function_interface)

1 comments

I think Unix's pipes are better examples that how components could communicate. It's a pity that due to terminal limits, the best we can do about connecting components in Unix is to pipe things through.