From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cAT/GJCDVWCNVQAA0tVLHw (envelope-from ) for ; Sat, 20 Mar 2021 05:09:36 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yKvWFJCDVWBvGgAA1q6Kng (envelope-from ) for ; Sat, 20 Mar 2021 05:09:36 +0000 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 E3A411A1C1 for ; Sat, 20 Mar 2021 06:09:35 +0100 (CET) Received: from localhost ([::1]:48734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNTri-00054h-V2 for larch@yhetil.org; Sat, 20 Mar 2021 01:09:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNTrb-00053L-2C for guix-devel@gnu.org; Sat, 20 Mar 2021 01:09:27 -0400 Received: from world.peace.net ([64.112.178.59]:42156) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNTrY-0006YT-GH for guix-devel@gnu.org; Sat, 20 Mar 2021 01:09:26 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNTrV-0005fA-7t; Sat, 20 Mar 2021 01:09:21 -0400 From: Mark H Weaver To: raid5atemyhomework , "guix-devel@gnu.org" Subject: Re: A Critique of Shepherd Design In-Reply-To: References: Date: Sat, 20 Mar 2021 01:07:45 -0400 Message-ID: <87y2eil8eb.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=64.112.178.59; envelope-from=mhw@netris.org; helo=world.peace.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616216976; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=5WENegph6ljBkjuUKKo1LAJa98HevU6vRAPNalpJCy4=; b=eaCvHtz+M1efIf1KsRZ4kOz8wIJeiGmcUyax1gmQ5M+So35CXNKE6xvQVo3isQbGrNQTH9 0pVV1W2e8hb+X+wckQ8WriwOa1tsW/8bn2XHgV8G5izVZSRrFZdfld3lUdQhgKyFBLicSZ d+Xb5W81ReUjDSeV3oYq2GyKrp9zucTSRcGnMIcZJ/tOtXQuOV0VdZutkgrOfIOxXKc9iY GJ/Q2pLaX6NCSdmZgabQiZSrJfITR6ZqOURb39JuUJxrLDKnDWhvfAwwzZS/oyTOTcD6nt AMp3WJ7W9I3kGqWtzaP/pKgV+1S8a7wnsoF5gO35bmJT+5EoCQhUu6MiH514NQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616216976; a=rsa-sha256; cv=none; b=b16fOiNWtXXpdhhFI6qzd9WLyuTu11MNI8dyrhavpsa3gfej3CbdhW2LrCDu0JGCsOlN+F h2RwF+S7FU+5+/HB5wx60AIEhat/tV59sotyx6EO/sOGU/6tBB5YjrOxiiKnFN2YJRx0jI Bb3uU8sxNkpcVdAX9a+qfcUmT+sanQYv2oT4/S88OpOhvkuwQZbrU7ZldrbI3lZy8Yf51G cXmbS6LF8rBhrME0B3wdKDGotl7DddnPkgBhY2HlBGzCiyY3Mx/Dltf+V27Uy24shB5ail JB3UoEzbhT7c2ApQKGYB/fM4yVoU87VTdz/nMMTwEb+y6p98Fj7vnarqW1xIrw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -2.41 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: E3A411A1C1 X-Spam-Score: -2.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: RDDXjYKFMYq6 Hi, raid5atemyhomework writes: > GNU Shepherd is the `init` system used by GNU Guix. It features: > > * A rich full Scheme language to describe actions. > * A simple core that is easy to maintain. > > However, in this critique, I contend that these features are bugs. > > The Shepherd language for describing actions on Shepherd daemons is a > Turing-complete Guile language. Turing completeness runs afoul of the > Principle of Least Power. In principle, all that actions have to do > is invoke `exec`, `fork`, `kill`, and `waitpid` syscalls. These 4 calls are already enough to run "sleep 100000000000" and wait for it to finish, or to rebuild your Guix system with an extra patch added to glibc. > Yet the language is a full Turing-complete language, including the > major weakness of Turing-completeness: the inability to solve the > halting problem. > > The fact that the halting problem is unsolved in the language means it > is possible to trivially write an infinite loop in the language. In > the context of an `init` system, the possibility of an infinite loop > is dangerous, as it means the system may never complete bootup. Limiting ourselves to strictly total functions wouldn't help much here, because for all practical purposes, computing 10^100 digits of Pi is just as bad as an infinite loop. That said, I certainly agree that Shepherd could use improvement, and I'm glad that you've started this discussion. At a glance, your idea of having Shepherd do more within subprocesses looks promising to me, although this is not my area of expertise. Thanks, Mark