From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id CB1C5BBAF for ; Tue, 14 Oct 2008 07:43:45 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYDABLO80jAXQIniGdsb2JhbACTYAEBARUiqSGBbA X-IronPort-AV: E=Sophos;i="4.33,407,1220220000"; d="scan'208";a="30307022" Received: from concorde.inria.fr ([192.93.2.39]) by mail4-smtp-sop.national.inria.fr with ESMTP; 14 Oct 2008 07:43:45 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m9E5hhaQ002537 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 14 Oct 2008 07:43:44 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AukCAIDO80jCbRgZhmdsb2JhbACTYAEBAQoLCAcTA6kWgWw X-IronPort-AV: E=Sophos;i="4.33,407,1220220000"; d="scan'208";a="18068791" Received: from smtp-vbr5.xs4all.nl ([194.109.24.25]) by mail3-smtp-sop.national.inria.fr with ESMTP; 14 Oct 2008 07:43:43 +0200 Received: from [172.19.3.6] (a82-93-212-155.adsl.xs4all.nl [82.93.212.155]) (authenticated bits=0) by smtp-vbr5.xs4all.nl (8.13.8/8.13.8) with ESMTP id m9E5hgJ4011525 for ; Tue, 14 Oct 2008 07:43:42 +0200 (CEST) (envelope-from elliott@elliottoti.com) Message-ID: <48F4318D.7070607@elliottoti.com> Date: Tue, 14 Oct 2008 07:43:41 +0200 From: Elliott Oti User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Road to native windows OCaml... References: <200810131935.53365.kuba@mareimbrium.org> In-Reply-To: <200810131935.53365.kuba@mareimbrium.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner X-Miltered: at concorde with ID 48F4318F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 mingw:01 toolchain:01 cygwin:01 stubs:01 mingw:01 toolchain:01 pointer:01 ffi:01 stubs:01 cygwin:01 compilation:01 hacked:01 masm:01 Ocaml works fine on windows with the mingw and msys toolchain. Cygwin is not needed. What you are doing with (1) and (2) would be duplicating msys. With regards to (4), you need at the very least to be able to parse header files correctly, & provide link stubs. This would again be duplicating parts of the mingw toolchain. In addition, binding to C code is not just a matter of wrapping the bare C functions. First C function declarations are underspecified (is char* a string? is int* an array of ints or a pointer to an in-out parameter? How long is the array?). Second, C types do not always match easily to ML types (converting C to ML is easy, the other way round is often harder). Third, it is often necessary to do extra processing in an FFI function i.e. between receiving the ocaml parameters and calling the c function. (3) would be nice, though. And fleshing out the non-functional win32 stubs in the Unix library (fork etc). Regards, Elliott Kuba Ober wrote: > I've looked briefly at what it'd take to have OCaml > fully working natively (with mingw/VS), without any Cygwin > needed for compilation. > > What I've surmised is this: > > 1. I need some "hacked up" make implementation, good enough just > to let it build; this would be a-la web2c in concept. This "make" > would implement bits and pieces of make, bash and sed -- just > the bare minimum needed to get it going. The goal is for people to > have bare mingw or VC and have OCaml build for them. > The functionality needed is quite minimal, so requiring people to > actually pull full sed, bash and make would not be necessary. > I would prototype it in Qt (it's quicker that way), > and then port it to "bare" C++ as time permits. > > 2. I need to get OCaml to use nasm instead of masm. I would go as far > as completely pruning any masm references from OCaml -- there is just > no need for masm when a good, free alternative exists. nasm is a single > standalone executable -- you can't get much better than that. Heck, it > works on unixes too, so it could be used on all platforms. gas is horrible > too -- it's only raison-d'etre is to process output from gcc. > Masm exists in "alternate reality" and the legality of its use is dubious. > So-called masm9/masm10 (non-Microsoft products) have licenses which are a > slap in the face and don't deserve a second look. > > 3. I need to look at the bytecode debugger and figure out why doesn't it work > on non-Cygwin builds. > > 4. I need to get OCaml to generate C binding code using assembly, without a > need for C compiler. It's easy enough and removes one big dependency from > OCaml. I don't know if OCaml side of things is expressive enough (whether > you can pass parameter/struct descriptions without use of C per se), > but it should generally work just fine. > > Can anyone add to/elaborate on this list? > > Cheers, Kuba > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > >