Search code examples
comerlang

Erlang interactions with COM objects


Does anyone know how to interact with COM objects using Erlang? I found comet library that allowed it, but it looks like this code is no longer present in OTP package.

I'm considering to write code in another language (like C++ or C#) and communicate with Erlang through ports but not sure if this approach is the most convenient.


Solution

  • Yep, erl_com (comet) is not supported since R9B.

    Comet, COM client for Erlang (REMOVED)

    The Comet application is removed from the product because we currently have no resources to maintain it. We plan to make it available on the Open Source site. It still works on Windows NT 4, but there are problems on Windows XP.

    We have 18.3 now (R18B03 in old version format). It was using a linked_in driver for communication. It is a quite efficient way to communicate with external code but dangerous.

    Warning

    A faulty linked-in driver causes the entire Erlang runtime system to leak memory, hang, or crash.

    See Interoperability Tutorial User's Guide for more details. There are four main options:

    1. Ports - forked process communicating thru stdin/stdout.
    2. Port Drivers (linked-in drivers) - like Ports but inside emulator memory space. Faster with great flow control but dangerous.
    3. C/Java Nodes - Servers which are written in foreign language behaving like nodes in Erlang cluster. Uses Erlang Distribution Protocol.
    4. NIFs - Same reliability drawbacks as linked-in drivers but much simpler API.

    Ports and C/Java Nodes are preferred way if reliability is in your concerns. NIFs are preferred when performance is most important. Linked-in drivers are legacy and for special use where NIFs API is not powerful enough.

    And of course, you can communicate with servers using Standard Protocols.