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 9A1D57F0F9 for ; Wed, 25 Nov 2015 17:06:35 +0100 (CET) IronPort-PHdr: 9a23:cegtjRxnJiauPLvXCy+O+j09IxM/srCxBDY+r6Qd0e8fIJqq85mqBkHD//Il1AaPBtWGra0UwLqK+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStOU0JT8h7z60qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGwD884mooRLWKD+OqA5VqBwDTI8Mmlz6teh/U3IRA6Lo38dSXk+kxxSAgGD4gusDbnrtS6vk+Nj1TObNs6+crczEWCn5rlmUh7jiw8MLHgy9XyRh8Bt2vEI6Cm9rgByltaHKLqeM+BzK/vQ Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=maverick@cs.cmu.edu; spf=None smtp.mailfrom=maverick@cs.cmu.edu; spf=None smtp.helo=postmaster@smtp01.srv.cs.cmu.edu Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of maverick@cs.cmu.edu) identity=pra; client-ip=128.2.217.200; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="maverick@cs.cmu.edu"; x-sender="maverick@cs.cmu.edu"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of maverick@cs.cmu.edu) identity=mailfrom; client-ip=128.2.217.200; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="maverick@cs.cmu.edu"; x-sender="maverick@cs.cmu.edu"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp01.srv.cs.cmu.edu) identity=helo; client-ip=128.2.217.200; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="maverick@cs.cmu.edu"; x-sender="postmaster@smtp01.srv.cs.cmu.edu"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BdAAAa21VWnMjZAoBehA5vwDgZhXYCgUA8EAEBAQEBAQEBEAEBAQEBCAsJCSEjC4ItgggBAQSBCQsYCSUPAjgOBg0IAQGIKrlvhCUBAQgCIYtSiTkFjhiIP4UoiWlJlkeDcjiCUoF7VIUsAQEB X-IPAS-Result: A0BdAAAa21VWnMjZAoBehA5vwDgZhXYCgUA8EAEBAQEBAQEBEAEBAQEBCAsJCSEjC4ItgggBAQSBCQsYCSUPAjgOBg0IAQGIKrlvhCUBAQgCIYtSiTkFjhiIP4UoiWlJlkeDcjiCUoF7VIUsAQEB X-IronPort-AV: E=Sophos;i="5.20,343,1444687200"; d="scan'208";a="189089571" Received: from smtp01.srv.cs.cmu.edu ([128.2.217.200]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Nov 2015 17:06:34 +0100 Received: from poohpro.wv.cs.cmu.edu (POOHPRO.WV.CS.CMU.EDU [128.237.200.209]) (authenticated bits=0) by smtp01.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id tAPG6ULc001236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 25 Nov 2015 11:06:31 -0500 (EST) To: "caml-list@inria.fr" References: <5655AE66.6000307@coherentgraphics.co.uk> From: Maverick Woo X-Enigmail-Draft-Status: N1110 Message-ID: <5655DC86.10205@cs.cmu.edu> Date: Wed, 25 Nov 2015 11:06:30 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5655AE66.6000307@coherentgraphics.co.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Scanned-By: mimedefang-cmuscs on 128.2.217.200 Subject: Re: [Caml-list] Do you use a debugger with OCaml? If not, why not? Hi, The first moment I detect I need a printf in a program for debugging, I put in a logging framework instead because I find it saves me time in the long run. This is true regardless of the language I am using. I essentially never use an interactive debugger for normal programming projects, even if I am using C++ on Windows, which has an excellent debugger in Visual Studio. For OCaml projects, I use Lwt_log even if the program itself does not use Lwt. Previously I have also tried Bolt (and Volt), but I switched to Lwt_log because some of my programs do use Lwt and I like uniformity across my projects. Maverick On 11/25/15 07:49, John Whitington wrote: > Hi, > > Like, I suspect, many people, my method has always been to insert Printfs, and > stare at code until I find the problem. In fact, the ocaml.org page on > ocamldebug says: > > "In fact, for complex programs, it is likely the case that the programmer will > use explicit printing to find the bugs, since this methodology allows the > reduction of the trace material: only useful data are printed and special > purpose formats are more suited to get the relevant information, than what can > be output automatically by the generic pretty-printer used by the trace mechanism." > > So, I ask: What do you use for debugging small and large OCaml programs? If not > a debugger, why not? What problems prevent it? How does your debugging process > differ when writing OCaml compared with other languages you use? > > John >