caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] COM binding & CAMLIDL ?
@ 2002-05-16  9:29 Samuel Lacas
  2002-05-16 12:26 ` Dmitry Bely
  2002-05-18  9:48 ` Xavier Leroy
  0 siblings, 2 replies; 4+ messages in thread
From: Samuel Lacas @ 2002-05-16  9:29 UTC (permalink / raw)
  To: caml-list

Hi,

Reading a recent thread on the list, I noticed that ocaml could be
used with COM components on windows. As I currently intensively use
the Python COM bindings with MS' text processor whose name I won't
say, I wonder if I could use ocaml to the same end.
However, the release notes in the ocaml-win distribution states that
the cygwin version lacks COM support, and the native win32 version
partially implements the libraries, among which I find no COM nor IDL
link. Does anyone on the list have more information ?

Thanks,

sL
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] COM binding & CAMLIDL ?
  2002-05-16  9:29 [Caml-list] COM binding & CAMLIDL ? Samuel Lacas
@ 2002-05-16 12:26 ` Dmitry Bely
  2002-05-18  9:48 ` Xavier Leroy
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry Bely @ 2002-05-16 12:26 UTC (permalink / raw)
  To: caml-list

Samuel Lacas <Samuel.Lacas@trusted-logic.fr> writes:

> Reading a recent thread on the list, I noticed that ocaml could be
> used with COM components on windows. As I currently intensively use
> the Python COM bindings with MS' text processor whose name I won't
> say, I wonder if I could use ocaml to the same end.

Probably yes, if you are going to use/create COM components with vtbl-style
interfaces. Support for IDispatch interfaces is very limited (see camlidl
manual).

> However, the release notes in the ocaml-win distribution states that
> the cygwin version lacks COM support,

In fact Cygwin gcc has all necessary COM libraries and camlidl can be
easily patched to support COM interfaces for Cygwin-build OCaml (I have
done that if you are interested).

> and the native win32 version
> partially implements the libraries, among which I find no COM nor IDL
> link. Does anyone on the list have more information ?

[ocaml\README.win32]

The native Win32 port has threads and COM support

[camlidl\readme]

In addition, Camlidl provides basic support for COM interfaces and
components under MS Windows.  It supports both using COM components
(usually written in C++ or C) from Caml programs, and packaging Caml
objects as COM components that can then be used from C++ or C.

[end of quote]

So yes, MSVC-compiled OCaml supports Camlidl and COM out-of-the-box.

Hope to hear from you soon,
Dmitry


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] COM binding & CAMLIDL ?
  2002-05-16  9:29 [Caml-list] COM binding & CAMLIDL ? Samuel Lacas
  2002-05-16 12:26 ` Dmitry Bely
@ 2002-05-18  9:48 ` Xavier Leroy
  2002-05-18 11:28   ` Dmitry Bely
  1 sibling, 1 reply; 4+ messages in thread
From: Xavier Leroy @ 2002-05-18  9:48 UTC (permalink / raw)
  To: Samuel Lacas; +Cc: caml-list

Hi Samuel,

> Reading a recent thread on the list, I noticed that ocaml could be
> used with COM components on windows. As I currently intensively use
> the Python COM bindings with MS' text processor whose name I won't
> say, I wonder if I could use ocaml to the same end.
> However, the release notes in the ocaml-win distribution states that
> the cygwin version lacks COM support, and the native win32 version
> partially implements the libraries, among which I find no COM nor IDL
> link. Does anyone on the list have more information ?

In the Windows world, there are actually two flavors of COM, the
inter-application communication framework:

- "Pure" COM, which uses native C data representations, and is
oriented towards statically-known, statically-typed IDL interfaces
from which stub code can be statically generated.

- Automation, which uses Visual Basic data representations (the
"variant" universal type used by VB to represent its data), is
dynamically typed, and is often used in a context where the IDL
interfaces are dynamically discovered.

Both flavors are loosely related -- Automation uses a fixed "pure" COM
interface called IDispatch to implement remote invocation -- but quite
different in practice.

CamlIDL implements (most of) the "pure COM" approach, but is geared
towards statically-typed, statically-known interfaces (on ne se refait
pas, as we say in French), and is not suited to Automation.

Microsoft applications use mostly (exclusively?) Automation to allow
scripting.  The reason is that Microsoft pushes Visual Basic as the
scripting language for their applications, although non-Microsoft
dynamically-typed scripting languages such as Perl and Python have
also been quite successful at that,

A Caml interface for Automation seems feasible, and actually could be
simpler than the CamlIDL "pure COM" interface.  I know of at least two
serious users of Caml that are interested, and one of them is
considering to host a summer intern to work on this.  So, stay tuned.

- Xavier Leroy
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] COM binding & CAMLIDL ?
  2002-05-18  9:48 ` Xavier Leroy
@ 2002-05-18 11:28   ` Dmitry Bely
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Bely @ 2002-05-18 11:28 UTC (permalink / raw)
  To: caml-list

Xavier Leroy <xavier.leroy@inria.fr> writes:

>> Reading a recent thread on the list, I noticed that ocaml could be
>> used with COM components on windows. As I currently intensively use
>> the Python COM bindings with MS' text processor whose name I won't
>> say, I wonder if I could use ocaml to the same end.
>> However, the release notes in the ocaml-win distribution states that
>> the cygwin version lacks COM support, and the native win32 version
>> partially implements the libraries, among which I find no COM nor IDL
>> link. Does anyone on the list have more information ?

BTW, OcamlIDL can be easily patched to support COM under Cygwin, are you
interested in that?

[...]

> CamlIDL implements (most of) the "pure COM" approach, but is geared
> towards statically-typed, statically-known interfaces (on ne se refait
> pas, as we say in French), and is not suited to Automation.
>
> Microsoft applications use mostly (exclusively?) Automation to allow
> scripting.  The reason is that Microsoft pushes Visual Basic as the
> scripting language for their applications, although non-Microsoft
> dynamically-typed scripting languages such as Perl and Python have
> also been quite successful at that,

I think most of them use dual (custom/dispatch) interfaces, so
*theoretically* one can extract their IDL interface definition by OleView
tool and then create the necessary stubs by CamlIDL. But *practically* it
is not an easy task: many MIDL features are still not supported by CamlIDL,
so I gave up when I tried this recently...

Hope to hear from you soon,
Dmitry


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-05-18 11:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-16  9:29 [Caml-list] COM binding & CAMLIDL ? Samuel Lacas
2002-05-16 12:26 ` Dmitry Bely
2002-05-18  9:48 ` Xavier Leroy
2002-05-18 11:28   ` Dmitry Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).