From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id IGrRDTP7bmJYeQEAbAwnHQ (envelope-from ) for ; Sun, 01 May 2022 23:27:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GLH2DTP7bmKSlgAA9RJhRA (envelope-from ) for ; Sun, 01 May 2022 23:27:15 +0200 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 2CE1C38061 for ; Sun, 1 May 2022 23:27:14 +0200 (CEST) Received: from localhost ([::1]:56266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlH61-0003iA-0V for larch@yhetil.org; Sun, 01 May 2022 17:27:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlH5q-0003i0-Hr for guix-patches@gnu.org; Sun, 01 May 2022 17:27:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlH5q-0008M5-94 for guix-patches@gnu.org; Sun, 01 May 2022 17:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlH5q-0006Ig-5i for guix-patches@gnu.org; Sun, 01 May 2022 17:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55030] [PATCH 00/30] gnu: elm: Update to 0.19.1. Add build system & importer. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 01 May 2022 21:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55030 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 55030@debbugs.gnu.org Received: via spool by 55030-submit@debbugs.gnu.org id=B55030.165144038624173 (code B ref 55030); Sun, 01 May 2022 21:27:02 +0000 Received: (at 55030) by debbugs.gnu.org; 1 May 2022 21:26:26 +0000 Received: from localhost ([127.0.0.1]:34376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlH5F-0006Ho-PO for submit@debbugs.gnu.org; Sun, 01 May 2022 17:26:26 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:36009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlH5E-0006Hc-Cg for 55030@debbugs.gnu.org; Sun, 01 May 2022 17:26:24 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 49FD55C00BD; Sun, 1 May 2022 17:26:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 01 May 2022 17:26:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1651440379; x=1651526779; bh=HSXPPYXMEW /F1vEybPUciNuFyLTUxTH+yGVeLV1CdJY=; b=mGWTzgJxIkFjjZq2RVS6KdG8gA ymwHE5QcWISa4fjhR+eqcykOXO3m2B9Ni8Ri8ZuaWaT3gbRxZUPlxW+ePOrtfZ1V 6W6KsEZhhxpswYyIaiMZ6dFWM7p0zFs7Zu/a32wBWtia1YYvse7RvFHgQYdk0hCm tFgmy6jCtrHCBlhpbYUwYaEPx+g+7NQloNa7WMv6G67tCvqeIG9I+LoOO9u3i3mR jfqdh2dlb2LrI065g5qweXqQ1TH7YLYGW4PE/1k9dpRXHFH09jaVNDpFGyeBkFn9 m2sPbpALhTWSKO0pg7PVSY90VTE0VeFFbqrGTd9zkqKxFUMX+uV2FTnc7bjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1651440379; x=1651526779; bh=HSXPPYXMEW/F1 vEybPUciNuFyLTUxTH+yGVeLV1CdJY=; b=wDCutnukv84iBJ3kgd+JhSWsMQLJf BJ4Bl4u8Rr8MSBNwaCqYjKb4MVh5uTL6FBBrV+AP3exmv+oEPBZVVFjfkDJqhiGP x2S19/4bXJ6PQigLPA2glTsiYC9FgKk8LBSb+NIXTmvqBRntyNBOAKpZGUKEupNl LWSDbtgPmipm1zbRprabiMrD0JXnHIZJ+D4hWs3Ln7WCMISycsI0qrN2a9deJQGs MQRCH151UNjO0iksum3kwigOC+WsXSekF5CeuSP/hHQnLmUt7KBflGYkSXZCy9AQ NNT8MVeOsmodr2icswjNSKNUTJmALZYgvQJx99Pff7sN4FopOe8gxmokQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdefgdduiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefrhhhi lhhiphcuofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtg homheqnecuggftrfgrthhtvghrnhepkedtffehtddvhedvtdetkeelgfeivedugeffgeev tdefgfduueetgfdvgfdtgeefnecuffhomhgrihhnpegvlhhmqdgthhgrrhhtshdrohhrgh dpvghlmhdqlhgrnhhgrdhorhhgpdhgihhthhhusgdrtghomhdpohhpthhimhhiiigvrdhm ugenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphh hilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 1 May 2022 17:26:18 -0400 (EDT) Message-ID: <8bb2cf89-ae0e-cdcd-5149-a2d62aa3bbcc@philipmcgrath.com> Date: Sun, 1 May 2022 17:26:17 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Content-Language: en-US References: <20220419232736.272970-1-philip@philipmcgrath.com> <87k0b52ec3.fsf@gnu.org> From: Philip McGrath In-Reply-To: <87k0b52ec3.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651440434; 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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=HSXPPYXMEW/F1vEybPUciNuFyLTUxTH+yGVeLV1CdJY=; b=qjsqQ7v2nXquNl1ReSL/qqatIBoHJLBaC0ni4R2LDPiYazvWDckX80U4zu6NEzwdV4U1DS EiLdv5rng6ehrj4r/uRHKAbkYG8z0r1EC2kqbsxeMv8jLTxmA8RTTrAjiLXAxOMLpec9OC UUXRxgTFqWxvXPyw6X7ty/EU4R6m0UDAOH8Dchjv/zqCn4t3NQS3Sev9rckSSQ2iJ+sgOq q7f2/w/pZULc09Ra/W+haGoAFBPv8jHV+ucfQs2OsI9Cg8fEvLFlBjGReC9BcYMvJahy5/ 82zG2BLit36ZOa2swy5teHGfTWji85Nh29JDnXHmgYIiowZsC0BK42Es+kiaVQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651440434; a=rsa-sha256; cv=none; b=SNcfjaGn1H/68PhyW1uqd32LnE97Aw+zMwvHKFO2kNO81iRT4QoE6Rzhdx+qdCK5NBTWXt /+P8vQusyXDBDrmVqDvyoEnb7tAUr+NrB0Yv5rihGvGZ38PHI6I5CB9vC5zWgbROJamRVV 70eWeWBncQgx5F683CfbgR3IBM/GKvqFdd/BXRzJah9VSFuRmHbkfXOBDpR+vdEVZS+XKP vTZBNUpDBJs5z96PbqncXsDjoThHRoOa/Kk/w0tpYuE/DWDMYsV07I+XK+wqz7Dwstrz4P Y/NgojoCoJuI+cwbgADZkxIO/3zbOAYBpTPwtrNGZTmnWSZ72fJTOs3ZYZnjDg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm1 header.b=mGWTzgJx; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=wDCutnuk; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 0.91 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm1 header.b=mGWTzgJx; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=wDCutnuk; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 2CE1C38061 X-Spam-Score: 0.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: rbBvgKTTUpF8 Hi, Hi, On 5/1/22 16:22, Ludovic Courtès wrote: > Hi Philip, > > Philip McGrath skribis: > >> This patch series updates Elm to version 0.9.1, then adds an >> 'elm-build-system' and a 'guix import elm' command. > > Impressive! > Thanks! >> To exercise the new features, this patch series then: >> >> * Build the front-end for the `elm reactor` command (which is written in Elm) >> and adds a variant of Elm to Guix with the command enabled; >> >> * Builds 'elm-todomvc', an official example of a basic Elm application; and >> >> * Builds a feature-rich third-party package, "terezka/elm-charts": >> . > > Woow, neat. > > Annoying question that I have to ask: do these packages bundle > JavaScript libraries? If yes, is it source or is it “minified”? > > (My take is that we could tolerate some level of bundling if “doing the > right thing” is impractical, but it’d rather be source.) > Short answer: no, they don't! Longer answer: Elm basically takes the view that the existing JavaScript/NPM thicket should be considered harmful. It imposes a lot of very strict requirements on Elm "packages" (vs. "applications") to avoid whole classes of problems. Not all of them are precisely the requirements I would have chosen, but I like them better than the alternative chaos. (One reason I gave this a try was to get some hands-on experience writing a build system and importer in a simplified context before trying to write `racket-build-system`.) In particular, allowing arbitrary JavaScript would defeat the strong guarantees Elm wants to offer as a statically-typed, purely-functional language with compiler-enforced semantic versioning (well, for a decidable subset of "semantics") that can make runtime errors vanishingly rare in practice. To that end, Elm requires that "packages"---the things `elm-build-system` knows how to build---be written in pure Elm, with no JavaScript at all. For "applications", interop is limited to asynchronous message passing.[1] The only two "applications" in this series, the `elm reactor` frontend and `elm-todomvc`, don't use any message passing. Of course, Elm needs some way to implement primitives. These are provided by modules in the `Elm.Kernel.*` namespace, which are written in JavaScript with the undocumented, unsafe conventions expected by the Elm compiler. The Elm compiler only allows kernel modules in packages in the `elm/*` and `elm-explorations/*` namespaces, so users can know that third-party packages won't break Elm's guaranteed, and the compiler is free to change its internal APIs without breaking anything. (This is free software, so you could patch the compiler to do whatever you want: it's just a community norm so strong it's expressed in code.) Even this is all source code with whitespace and comments: it's written in a very stylized way, as an ASM file in another compiler implementation might be, but it isn't generated code. For people who want to "minify", Elm suggests flags for UglifyJS that can also do otherwise-unsafe whole-program optimization of the compiled "application".[2] (Compiling "packages" emits only an internal representation, not JavaScript.) In my own projects, I've also done other post-processing, like adding LibreJS comments and converting the output to an ES6 module. I haven't tried to make `elm-build-system` do any of those kinds of things for "applications": I think we should find more examples of Elm applications people would want to package for Guix first, rather than trying to guess what they might need. [1]: https://guide.elm-lang.org/interop/ [2]: https://github.com/elm/compiler/blob/master/hints/optimize.md -Philip