From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QF2bHGLnJWIpRAAAgWs5BA (envelope-from ) for ; Mon, 07 Mar 2022 12:07:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WNAxGWLnJWJDfgEAauVa8A (envelope-from ) for ; Mon, 07 Mar 2022 12:07:14 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 26E1536755 for ; Mon, 7 Mar 2022 12:07:14 +0100 (CET) Received: from localhost ([::1]:50892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRBCr-0006Sz-90 for larch@yhetil.org; Mon, 07 Mar 2022 06:07:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRAMt-00053V-VH for guix-devel@gnu.org; Mon, 07 Mar 2022 05:13:32 -0500 Received: from [2001:470:142:3::e] (port=39958 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRAMs-0004QN-8y; Mon, 07 Mar 2022 05:13:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=3fj5OKsjzJHdiMGam8c7zIWNz0q2HtwNAOL6vYBvDsU=; b=mdSLWfvOeoFG1AhsqMib MH2Hm07FAtJJn+5ECOccjwM3vwdZzDPyeJzCgnjP3nr5pPhWIOhEZn82geUimnVlA4myIk+IiO2+e AT5pOz/JOReYOr4Ia7t06ThzSyL+NmPD7JGr04JMCju9W+FSkquhmkhdl1TRDlQ6Y8VpiSrPRCV4j 4BP0sFqbseloosasDgMzNdYdmeh02cUlCn9a4tugp6J7P8i4ht24XgZJQ6THDxR9TdG64sjUJTOTa NiDh7bFFBE56dBCoBUmS7bllY4WtvFcQiwcqTSzarPsj7k/6qy1yemA7vFsQUcdastRaNd8AcePAR Fh360gbJg9ScCQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:56407 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRAMr-0004gr-J7; Mon, 07 Mar 2022 05:13:30 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Philip McGrath Subject: Re: better error messages through assertions References: <87ilthoxvu.fsf@elephly.net> <87k0dv6ahq.fsf@elephly.net> <87mtibdu5l.fsf@gnu.org> <2205364.8dmU9V6fpu@bastet> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 =?utf-8?Q?Vent=C3=B4se?= an 230 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 07 Mar 2022 11:13:27 +0100 In-Reply-To: <2205364.8dmU9V6fpu@bastet> (Philip McGrath's message of "Mon, 28 Feb 2022 11:18:16 -0500") Message-ID: <87cziy2hq0.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Wurmus , guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646651234; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=3fj5OKsjzJHdiMGam8c7zIWNz0q2HtwNAOL6vYBvDsU=; b=VbKEzbpsDp1H/XNPeJI8MwHtDQf2XwvdkzhxgpWjHOwnmvL9lXjbggTrdTN8JYt7Oum0OW kfY/SO3n0LrjSgpwemRHkGIiM6O7w46yyif2EK9FLxUUIchhiR01pWASBA09SJHX5cMq9u kjvwBgDNvAs1LBjS5gGrMCOvoNWyK7Q8asKHLl6/7up+hEb6gHe5+A7rHfd72E4ynVNBfO wFJFw0iJgbXuqo2tM+orxuIwVkx+RlvyBu1q3lScIRVwPDzQEdrDCSnsU64wy/FsxuDQR+ bNhTI7hq4zQG5OtoQzz2uhNRo2R+3uV6a3Xrs7BufIHb0Ti175oZEjOSgEQFhw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646651234; a=rsa-sha256; cv=none; b=RxnV7fd1aq5iEWAUtLK0uzmfLmA4lvhSAVRnLVYN2QgejSun+67rjzfv2ICSYBLf3J1EaL +RUdRWTxBAkkYWoE8ktGNrz5vnH4IU/vNzFJBYPGQz5v85IFU5uSuRLu9jyVf4A5a+SEKg oKa/evNic2W4+ZqWRrJe5y+BuI9z7LUHUjo469mW6lH7rB5REhYtPHzIQ61CkKEzmNWFp8 aT9KL/TP7HlUfOnP64n7QfHRqIwYQs7rkGUF7Y5zwZ1jTk0D7MBxxK1QJ0mpxiKefXIQla G3zKAUgLzDHUSVqQrGWx8q6uCkVtZKR3Lx8qK856i1erV0FmHsRARy3mg/BaAQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=mdSLWfvO; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.92 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=mdSLWfvO; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 26E1536755 X-Spam-Score: -6.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: +yaRxKJj6oog Hi Philip, Philip McGrath skribis: > Racket's state-of-the-art contract system has many features and nuances. = I *do > not* think anyone should try to implement them all in one fell swoop. I'm > hoping there's a way to implement your simple assertions with only a mode= st > amount of overhead that will provide the right base on which to grow the = rest > of a contract system. In the short term, the advantage over: > >> (assert-type (listof service?) services >> "SERVICES must be a list of values.") > > is that you don't have to write error messages by hand. > > You need two types of values: > > 1. Contracts, recognized by `contract?`; and > 2. Blame objects, recognized by `blame?`. [...] Thanks for the explanation and references! I had briefly looked at Racket=E2=80=99s contract API in the past but your message gave a clearer v= iew of how this all fits together. > I would love to have contracts in Guix, even very rudimentary contracts. = If > it's something the community more generally would be interested in, I'd be > glad to help as much as I can. It=E2=80=99d be great to benefit from your expertise here. Like you wrote,= I think we should start with a simple contract system, certainly simpler than Racket=E2=80=99s, and build from there. If you=E2=80=99re willing and able to spend time prototyping this, that=E2= =80=99s great. :-) Thanks, Ludo=E2=80=99.