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 1C8447F108 for ; Wed, 25 Nov 2015 17:52:29 +0100 (CET) IronPort-PHdr: 9a23:TJimFxcmZYusdpT8keIGph4dlGMj4u6mDksu8pMizoh2WeGdxc6yZR7h7PlgxGXEQZ/co6odzbGG7ua/CSdRuN6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDvvcKDKFQRzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IeezAcq85Vb1VCig9eyBwvZWz9EqLcQzaz30AVWNeuBNDAwnDpEXzWIv2tCHzvep83gGLNM3xSvY/XjH0vIlxTxq9rSYMNzc09Fb4kFh2gb1SpB7p8xl+yI7VeICRNdJxe6rceZURQm8XDZUZbDBIHo7pN9hHNOEGJ+sN6tCl/1Y= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=michipili@gmail.com; spf=Pass smtp.mailfrom=michipili@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f51.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of michipili@gmail.com) identity=pra; client-ip=74.125.82.51; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="michipili@gmail.com"; x-sender="michipili@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of michipili@gmail.com designates 74.125.82.51 as permitted sender) identity=mailfrom; client-ip=74.125.82.51; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="michipili@gmail.com"; x-sender="michipili@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f51.google.com) identity=helo; client-ip=74.125.82.51; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="michipili@gmail.com"; x-sender="postmaster@mail-wm0-f51.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BfAADh5VVWlDNSfUpehA5vrmKFOoo3gWYdhXICgUA6EgEBAQEBAQEBEAEBAQEHCwsJHzCCLYIHAQEBAwESLgEbHQEDAQsGBQsNLiMRAQUBChIGEyKHdgEDCggEAQigAIExPjGNMoJ5hggKGScNVoQNAQEBAQEBAQEBAQEBAQEBAQEBAQEBEgEBBA6IVoFogQaCU4VRgRUFhhEMkDqFKIYdgXCJEAyLbIYJNoEXKAWCOiOBXnGFLAEBAQ X-IPAS-Result: A0BfAADh5VVWlDNSfUpehA5vrmKFOoo3gWYdhXICgUA6EgEBAQEBAQEBEAEBAQEHCwsJHzCCLYIHAQEBAwESLgEbHQEDAQsGBQsNLiMRAQUBChIGEyKHdgEDCggEAQigAIExPjGNMoJ5hggKGScNVoQNAQEBAQEBAQEBAQEBAQEBAQEBAQEBEgEBBA6IVoFogQaCU4VRgRUFhhEMkDqFKIYdgXCJEAyLbIYJNoEXKAWCOiOBXnGFLAEBAQ X-IronPort-AV: E=Sophos;i="5.20,343,1444687200"; d="scan'208";a="189097637" Received: from mail-wm0-f51.google.com ([74.125.82.51]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 25 Nov 2015 17:52:24 +0100 Received: by wmec201 with SMTP id c201so265361784wme.0 for ; Wed, 25 Nov 2015 08:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=iw35q5KcZu/xBcxp8A1bxrdWHeag/1+yLtFu9u+RtwE=; b=LN786V42p8m3P/MA5KMClTKmHDNPm/2c1e/EvG8nfwQ6kxilN0Z2Keg2P26Pvy7PZQ cmqiocei6NlK4r2HrgFx99yDli8sfcT35KEzxTlPk37EyPCjtVXuRJ5Rnu7cOOoIPdk5 eu3Zs547QVS8/9UNctWesmavjBt5rc/opgRSkBLIGUEdZGndX4zy6qAk2tt8eipqcY7z 2MIsM6nbtjgRRMFipuhzGeZ4e0Yf4UP0Vv2oWcKo8FRme5Xz7rJf9hKUqkTq9lcUElI6 BlJSuPaKvDMyy25HfH4jbAnZSm+2eyM75SSxxFnUcBB51t87rYLmITtesIO+DWYZMc3z mRwQ== X-Received: by 10.194.239.104 with SMTP id vr8mr50381486wjc.64.1448470344413; Wed, 25 Nov 2015 08:52:24 -0800 (PST) Received: from oscar.localdomain (xdsl-89-0-69-200.netcologne.de. [89.0.69.200]) by smtp.gmail.com with ESMTPSA id u134sm4377373wmd.0.2015.11.25.08.52.23 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Nov 2015 08:52:23 -0800 (PST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) From: =?windows-1252?Q?Michael_Gr=FCnewald?= In-Reply-To: <67E3C8E6-47E2-4010-9399-F66A18EBF493@yahoo.com> Date: Wed, 25 Nov 2015 17:52:22 +0100 Cc: John Whitington , "caml-list@inria.fr" Content-Transfer-Encoding: quoted-printable Message-Id: References: <5655AE66.6000307@coherentgraphics.co.uk> <67E3C8E6-47E2-4010-9399-F66A18EBF493@yahoo.com> To: Anton Bachin X-Mailer: Apple Mail (2.3096.5) Subject: Re: [Caml-list] Do you use a debugger with OCaml? If not, why not? > On 25 Nov 2015, at 17:16, Anton Bachin wrote: >=20 > I always use prints and never debuggers when I have access to the > source, in any language. I use debuggers when reverse-engineering > binaries, however. As for why =96 setting up breakpoints, trying to > examine values usually takes more time for me than adding some > prints and reading and understanding the resulting trace. Perhaps > it only seems that way, but that has been my habit for a very long > time. While OCaml has an incredibly powerful debugger, I rarely use it. In most situation, I can analyse code to make an hypothesis that I can turn into an automatic test case. Time spent writing tests is in my opinion much better invested than time spent debugging, because the investment is reflected by a code artefact that adds value to the project, in the form of confidence about results. Sometimes, problems observed do not have any obvious plausible cause, so that stepping through the code is one of the best options. Instead of print-peppering, I prefer to use structured failures (like the success monad https://github.com/michipili/lemonade) giving context for the failure, or improved logging capacities. This is not really related to debugging, but let me add that I tend to use the toplevel loop, either for experimenting or to interactively solve complex (to me) typing problems that I cannot do right away. Best, Michael