Hacker News new | past | comments | ask | show | jobs | submit login

There is, it's called COM, and Windows as an operating system and ecosystem is built on top of it. (Though COM as a specification is not limited to Windows)

The language you use for defining the types is creatively named "Interface Definition Language (IDL)", and the "MIDL" compiler converts the interface definitions into C & C++ types and objects which can be used. Both via in-process/inter-process function calls, or via RPC/DCOM (Distributed COM).

https://en.wikipedia.org/wiki/Component_Object_Model#DCE/RPC...

  "As a cross-language component model, COM relies on an interface definition language, or IDL, to describe the objects and associated functions. The COM IDL is based heavily on the feature-rich DCE/RPC IDL, with object-oriented extensions. Microsoft's own implementation of DCE/RPC, known as MSRPC, is heavily used as the primary inter-process communication mechanism for Windows NT services and internal components, making it an obvious choice of foundation."

  "DCOM (Distributed COM) extended the reach of COM from merely supporting a single user with separate applications communicating on the Windows desktop, to activating objects running under different security contexts, and on different machines across the network. With this were added necessary features for configuring which users have authority to create, activate and call objects, for identifying the calling user, as well as specifying required encryption for security of calls."
If you want to learn more about this (it's an incredibly powerful concept that has a wide range of uses and is very much still used today), my recommendation would be:

1. The book: "Essential COM (1997)" by Don Box, one of the architects of COM at Microsoft in the 90s

  https://www.amazon.com/Essential-COM-Don-Box/dp/0201634465
2. The online tutorial "COM in plain C", which is one of the only (it might even be, like, THE only) resources for learning how COM actually works, since generally you use C++ frameworks to interact with it and they cover up all the details.

  https://www.codeproject.com/Articles/13601/COM-in-plain-C
---------

Disclaimer: I'm no expert in COM myself, I'm also working through these same learning materials.

I have a strong interest in FFI/Interop between languages and so have been working through things like "What is an ABI, conceptually?", understanding the C++ Itanium ABI, reading about vtable's, manually emulating C++ classes and class-inheritance with C structs of function pointers (vtables) etc.

COM is foundational here so it's the thing on my list atm. Hope you find this useful!




Thank you!

Yeah, I also feel like it's important. Too much time is wasted on X-lang wrappers for Y-lang libraries.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: