caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jean Martos <jean.martos@wanadoo.fr>
To: Jean-Marc Eber <jeanmarc.eber@lexifi.com>, caml-list@inria.fr
Subject: [Caml-list] Re: MinGW port
Date: Mon, 26 Nov 2001 15:37:12 +0000	[thread overview]
Message-ID: <3C0261A7.25698439@wanadoo.fr> (raw)
In-Reply-To: <007301c17659$0ae17840$060000c0@N7YYB>



Jean-Marc Eber a écrit :

> There have been some interesting postings on this list
> about a MinGW port of the OCaml Compiler. The
> attached patch was textually large but conceptually
> simple.
>
> I'm really not a specialist about this topic, but have now
> (or in a near future) to choose between possible
> Windows "technologies" (Visual C, Cygwin, MinGW) for
> an OCaml program (only a console mode stuff in my case).
>
> Could anybody explain to me why a MinGW isn't *always*
> preferable to a Cygwin one (use of the same compiler, GCC,
> MinGW being more "direct" Windows without an indirection
> layer, not speaking about licensing problems, etc....).
>
> I understand well that the Caml Team wants probably to
> maintain a MS C version of the OCaml implementation,
> but wanted to ask the Team if they have some ideas about
> the future of Cygwin/MinGW ports. Isn't a MinGW port, in
> the medium term, preferable to a Cygwin one ? Or do I
> miss a point ?
>
> Jean-Marc Eber
> LexiFi

Cygwin offers an emulation layer of the UNIX system calls. But if you compile using
Cygwin, you have to provide the cygnus.dll which contains the emulation layers.
And then, it is no so easy to mix both unix like system calls and native system
calls.

Msv compiler, by default (so for Ocaml), generated objects using I/O routines
provided by crtdll. (For example C++ woks this way). But a lot of programs use the
msvcrt.dll, which provides I/O routines which conflits with crtdll. So if you want
to mix  codes from ocaml and c for example, you must be coherent with the runtime
library (crt or msvcrt), or encapsulate your code in a DLL.

Mingw32 use the native system calls and the msvcrt.dll.

The problem arises when you want to mix code from a tool which generates code using
msvcrt.dll and Ocaml. For example, we have a program writing in GNAT and we use
Ocaml as an extension language. GNAT use gcc (mingw32) as backend to generate code.
To mix ADA code and Ocaml, we must isolate the ADA code or Ocaml code in a DLL. And
in our application it is not possible for a lot of reasons. So we have port Ocaml
for gcc-mingw32 and it works fine.

The work to port the core Ocaml for gcc-mingw32 is not very hard. It consists on a
very few changes in configure script, in asmrun and bytecomp.
The main problem is to adapt specific libraries like the native threads. But, I
have already take a look and it seems to be a little work to do it. The problem is
Time!!

Another problem is portability. And I just want to say that gcc on Window is not a
toy, but associated with all the gnu tools is a good mean, i think the best today,
to acheive portability betwen Unix and Windows. If you write code using Visual C++,
your application runs and only runs on Windows, the port to another platform can be
hard.

I unterstand the Ocaml team, when they say that they don't want to maintain 3 ports
on Windows. But I think that a lot of people, like us, want to use Ocaml with gcc
mingw32, and it will be fine to have an official mingw32 port.


Jean Martos.



>
> -------------------
> Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
> 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/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


      parent reply	other threads:[~2001-11-26 15:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-26  8:28 [Caml-list] Ocaml 3.03 alpha " Jean-Marc Eber
2001-11-26 11:03 ` Xavier Leroy
2001-11-26 13:34   ` Dmitry Bely
2001-11-26 15:37 ` Jean Martos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C0261A7.25698439@wanadoo.fr \
    --to=jean.martos@wanadoo.fr \
    --cc=caml-list@inria.fr \
    --cc=jeanmarc.eber@lexifi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).