Nerd stuff continued. skip to next :-)
> ...and UNIX APIs (which I take it is what you are incorrectly > calling ABIs) are, in fact and as we speak, implemented in the > C programming language; other languages are then grafted onto the > C language libraries and system calls.
I really did mean ABI. API is what programmer's write to. APIs are tied to languages. It is true that Unix APIs are published in C. ABIs represent what binaries look like and I would claim..no matter what language they started in. Or atleast they should. I am aware how certain languages also can and do "graft" into C and make calls from another language syntax while writing code in another language. But this started with what people view a definition of an OS and that is why I am indulging in hair-splitting details.
When compiled, there is a certain expectation about how the binary looks like and how the calls are laid out to objects in outside libraries. That information (in addition to names of routines, parameters etc derived from API) together form the ABI. That also includes how you access system calls. You can consider it a machine language level spec and contents are often (unlike Java) specific to processor family. Typically what the OS is shipped as is a bunch of pre-compiled machine language stuff.
You can do things by "grafting" to C library. You can also build the infrastructure from scratch in another language. Maybe we are talking the same thing except you somehow consider it as "grafting" to C and I consider it as using knowledge of the binary interface. I also talking about what is possible, I am aware that most OS APIs are only in C. If you decide to extend Unix APIs in Java or C++ can you do it ? yes. I would think so.
Most of my information has Unix bias which I use/develop on. You are probably right about how certain things may have been done on many platforms but in the world of open systems, you can build in any language. It is all a matter of having access to the technical information of the binary interface. Who should specify the ABI ? That is an interesting question. Certain things for Unix ABIs may be most efficient for C but not for C++ or Java. You can argue things will be most efficient in any one language relative to another but I am talking about what is possible not efficient.
With Java APIs and ABI, there is a more homogeneous environment specified. and if they have specified enough things for that environment, it should be possible to build platform independence. because it mandates the who environment. Unix APIs are same but ABI varies from every processor/vendor so same binary cannot work on another vendors platform. It should also be possible to have, for example, a Fortran or CObol APIs compiled into java bytecode and the bytecode binaries shipped and work on the platform. You call it as "interfacing" with Java and I call it as using the ABI even though the ABI may have a structure which is biased to a specific language. I could call it using the "ABI" part and not grafting into Java. Maybe we just differ in use of terms. ABI names usually come from OS but in the Java world, the ABI and the language are both called "Java". Also, the "machine" is a "virtual machine" (JVM) so it is possible to build it wherever (or even as some are trying into real Silicon, the java chips). But then I probably don't know as much about Java world as you do so I might be stepping into dangerous statements here :-)..but I would like to think some general technical principles.. while bottled into new terms are essentially the same.
Most of this hair splitting has to do with what people view and define as an "OS". Some people view it as shell script commands. For others it is a set of APIs/libraries. For others it is the set of applications that they use in a platform/environment. I was giving yet another techie perspective/opinion on it.
- LKO |