From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id BABC57EE51 for ; Fri, 12 Apr 2013 21:39:26 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of misterherr@freenet.de) identity=pra; client-ip=195.4.92.90; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="misterherr@freenet.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of misterherr@freenet.de) identity=mailfrom; client-ip=195.4.92.90; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="misterherr@freenet.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout0.freenet.de) identity=helo; client-ip=195.4.92.90; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="postmaster@mout0.freenet.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmEBAHdiaFHDBFxalGdsb2JhbABKBoJlhAW7ToJngQwWDgEBAQEHDQkJFAMlgh8BAQUjVRELGAICBRYLAgIJAwIBAgFFEwgBAYd9ARMDqiyIIgmBNgGIdIEjjE6BLRaCGIETA50Hjhk X-IPAS-Result: AmEBAHdiaFHDBFxalGdsb2JhbABKBoJlhAW7ToJngQwWDgEBAQEHDQkJFAMlgh8BAQUjVRELGAICBRYLAgIJAwIBAgFFEwgBAYd9ARMDqiyIIgmBNgGIdIEjjE6BLRaCGIETA50Hjhk X-IronPort-AV: E=Sophos;i="4.87,464,1363129200"; d="scan'208";a="13059962" Received: from mout0.freenet.de ([195.4.92.90]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Apr 2013 21:39:26 +0200 Received: from [195.4.92.142] (helo=mjail2.freenet.de) by mout0.freenet.de with esmtpa (ID misterherr@freenet.de) (port 25) (Exim 4.80.1 #3) id 1UQjoj-00066E-K7 for caml-list@inria.fr; Fri, 12 Apr 2013 21:39:25 +0200 Received: from localhost ([::1]:58758 helo=mjail2.freenet.de) by mjail2.freenet.de with esmtpa (ID misterherr@freenet.de) (Exim 4.80.1 #3) id 1UQjoj-00050X-6P for caml-list@inria.fr; Fri, 12 Apr 2013 21:39:25 +0200 Received: from [195.4.92.24] (port=39291 helo=14.mx.freenet.de) by mjail2.freenet.de with esmtpa (ID misterherr@freenet.de) (Exim 4.80.1 #3) id 1UQjl3-0002aX-Qi for caml-list@inria.fr; Fri, 12 Apr 2013 21:35:37 +0200 Received: from cl-252.ham-02.de.sixxs.net ([2001:6f8:1c00:fb::2]:37594) by 14.mx.freenet.de with esmtpsa (ID misterherr@freenet.de) (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (port 465) (Exim 4.80.1 #3) id 1UQjl3-0003e3-KH for caml-list@inria.fr; Fri, 12 Apr 2013 21:35:37 +0200 Message-ID: <51686208.9020801@freenet.de> Date: Fri, 12 Apr 2013 21:35:36 +0200 From: "Mr. Herr" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: caml-list@inria.fr References: <5167325A.2030600@lakaban.net> <51682FE2.60607@freenet.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] ocamlfind? how to compile Am 12.04.2013 18:19, schrieb David Allsopp: > Mr. Herr wrote: >> I did not understand how the helpers for compilation are supposed to work. >> >> For example I have a script that executes external programs, and needs the >> Unix module. >> >> For script execution I have in the top of my script: #load "unix.cma";; > Good "trick" for findlib is to add: > #use "topfind" > to ~/.ocamlinit (create it, if necessary) and then in future toploops you just say > #require "unix";; > instead. Useful when you start using packages which depend on other packages... > >> This must be removed for ocamlc or ocamlopt to work, right? Annoying. > Yes and no - a way around it is to create a wrapper script for debugging in the toploop which loads all the required libraries (or just have libraries you usually need loaded via .ocamlinit). I think it's fairly unusual that you have something that's actively intended for both the toploop *and* separate compilation so it's usually just a matter of making debugging easier in the toploop with a little script. > The response goes to the list... I am using a lot of scripting, and you could perfectly well execute the ml scripts with a #!/usr/bin/ocaml line on top. The idea is that scripts are not "finished" (or less finished, and not documented) compared to programs, and that you read and adjust the source to your instant need. My findings say that scripted ml is only a little bit slower than bytecode, but has a bigger memory requirement. This matches or is better than a lot of _very_ popular scripting languages. Additionally you can compile, even to native code. If only it was not so unfinished. I am just writing exec functions, it should be rather easy to capture "Reference to undefined global `Unix' " and repair it. Has this not been done?? What is ocamlfind for? /Str.