Re: [calsify] RFC 5545/JSCalendar questions from ECMAScript TC39 "Temporal" working group

Neil Jenkins <neilj@fastmailteam.com> Sun, 04 October 2020 22:44 UTC

Return-Path: <neilj@fastmailteam.com>
X-Original-To: calsify@ietfa.amsl.com
Delivered-To: calsify@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B1AD13A0A68 for <calsify@ietfa.amsl.com>; Sun, 4 Oct 2020 15:44:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fastmailteam.com header.b=Erfphc1V; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=RgXijb90
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s4Ae6KPnR2T0 for <calsify@ietfa.amsl.com>; Sun, 4 Oct 2020 15:44:50 -0700 (PDT)
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C36703A0A65 for <calsify@ietf.org>; Sun, 4 Oct 2020 15:44:50 -0700 (PDT)
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 123645C00A0; Sun, 4 Oct 2020 18:44:50 -0400 (EDT)
Received: from imap7 ([10.202.2.57]) by compute3.internal (MEProxy); Sun, 04 Oct 2020 18:44:50 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= fastmailteam.com; h=mime-version:message-id:in-reply-to :references:date:from:to:cc:subject:content-type; s=fm3; bh=YK/A fPrnnR3DZ1jpZo/B9tPQSrNpsWZQn8O4U1/Er10=; b=Erfphc1VECsJd7u2SOg4 d56Iug9HUVhx6Lf1ReedpzZqpLESDpAKZI7sdeAofHaam4ZIWZLEEloEwCJiOE8z u09E1w/Z4NJDvyES/FJ9G40H9c4ZtX980eD8lhmqSb+26lNx1G/cEStHCnMQeh2Q kzWSb4CzaCVWrsjg8SD6R7x5wgi9UngmuBMkjJP4MU7Pu/rfnYLPLzw2sx0zmmtN LrbwgTEOo+7RnTr/eU21oAtmiS/E5ieMELJ2pxubd76MCRqn9iW7fg5foxXNgUjK AeNhdiSevKWfZm0kHNaqyyYyEKa8a43PNV6wN1IP+sHmnU2NOI/WKqVyI7D3n88j Lw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=YK/AfP rnnR3DZ1jpZo/B9tPQSrNpsWZQn8O4U1/Er10=; b=RgXijb90qhjDG2ORXP+TLC pchIdHQlb4vo1B0LiMNy6TH7lma1sxSA2amq7ERHjh4tJdQ3TItdIyp14jc8QOUy odF8eGhw8xth+lfbClU7W0k6Qp9ArF1Q9d25/2NWqec9CbQPSolVV5DDD4a65tOX AU5m44oYsD3wEMvAeFmLbMAXnd7Mx9zC+aDlyE/1+btVENnt9mRWcwoPQxG0ipom vHu9lsH5hxB774jqXAFgIb78ErXZGzd/MRlYCVb4dAcKfclGfDk8b/cUHAEpqBM8 EMFFWX+e2+EMQENDYFvjTjr03MFcXVgJmrR+CN7ReqQ/tmzDYObrul0iFJ5qj63A ==
X-ME-Sender: <xms:YFB6XwJcL4moO_67NrlKAraTPca7d_89ecNeHrTaHJBInw3_S_8j8g> <xme:YFB6XwIVosuYlvzRsqjH66HAKUhjgS2ogNw3S5YJtnw6DY7FceAJD9QOZDNE3hd09 j0SBco4toiKyQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrgedugddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesrgdtre erreerjeenucfhrhhomhepfdfpvghilhculfgvnhhkihhnshdfuceonhgvihhljhesfhgr shhtmhgrihhlthgvrghmrdgtohhmqeenucggtffrrghtthgvrhhnpeehuefhudejtdeive ekvdfhfffgleeflefhfeekhefhkeelkefhfeeufeevffejieenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehnvghilhhjsehfrghsthhmrghilh htvggrmhdrtghomh
X-ME-Proxy: <xmx:YFB6XwsWG2TpxtLjK1ZV0gxZamf0PeD7r6qTIcHbotd6EqKiQH9kaw> <xmx:YFB6X9awXRbFs-wsXYNZz8q9c54VwmcjOW7pfVX5QfVLL8NqzwNE5w> <xmx:YFB6X3ZTUIh_SC8EbE_1DDHhJSNaiZW_OLE6R4jHQee5cpXu3_icmw> <xmx:YlB6Xx0m_6H2T7mJdTxOHumhP1s--dHwo_ShuSjchwL9JrHLsmXT1g>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id 761101801A7; Sun, 4 Oct 2020 18:44:48 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.3.0-382-ge235179-fm-20200928.002-ge2351794
Mime-Version: 1.0
Message-Id: <6dd83e7f-bdd2-4aed-846d-566910fda683@dogfood.fastmail.com>
In-Reply-To: <CACy7CfjdvXsWTYZ7qO3-BN3VJV0bdFUtZQgtxRLiF1qVJMFM1w@mail.gmail.com>
References: <CACy7CficiNXA_tb01c0=PWQTnXPVu_e7TgWAKUVPY-ow9C=3SQ@mail.gmail.com> <5bfd4453-e9a9-4bf4-b403-1b2f19cc790a@dogfood.fastmail.com> <CACy7CfgbPG_ugC59CZWtMwA7w4UOJR=zUkovKzvHUdeoFxnpjg@mail.gmail.com> <6d357b96-9899-4bd3-93e0-97e147a86a4d@dogfood.fastmail.com> <CACy7Cfjfdu7yyjvVCcvYag7AVMrekqiSCfm6pQZ8PiQLFiJ7Aw@mail.gmail.com> <CACy7CfgBBHxu=gHirXs3xVc30psU0+F-E0ttiUiJ4KvSCR9Qew@mail.gmail.com> <e0656c88-6a1b-49b0-9fa4-14a794e9fb82@dogfood.fastmail.com> <CACy7CfhKg2rZsdPy0ELVrGwGdDvg+ELQWYN+YMrsYEyc6_8BJQ@mail.gmail.com> <CACy7CfjdvXsWTYZ7qO3-BN3VJV0bdFUtZQgtxRLiF1qVJMFM1w@mail.gmail.com>
Date: Mon, 05 Oct 2020 09:44:13 +1100
From: Neil Jenkins <neilj@fastmailteam.com>
To: Justin Grant <justingrant.ietf.public@gmail.com>
Cc: calsify@ietf.org
Content-Type: multipart/alternative; boundary="f4cb4b2eeecf4d1d9f62514c84a0aeed"
Archived-At: <https://mailarchive.ietf.org/arch/msg/calsify/9SIraCytTPSw-ue6ojkMYPb2RSU>
Subject: Re: [calsify] RFC 5545/JSCalendar questions from ECMAScript TC39 "Temporal" working group
X-BeenThere: calsify@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <calsify.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/calsify>, <mailto:calsify-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/calsify/>
List-Post: <mailto:calsify@ietf.org>
List-Help: <mailto:calsify-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/calsify>, <mailto:calsify-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 04 Oct 2020 22:44:53 -0000

On Wed, 30 Sep 2020, at 09:44, Justin Grant wrote:
> I think this result is probably OK (because DST is weird) but I'm wondering if the difference calculation in this case should return P1D (which makes `end - start == P1D`) or P1DT1H (which would make `undo == start`). Or is there some possible algorithm which could make both comparisons true? 

With this example, there are two different values of D that can be added to START that both result in the same END: P1D or P1DT1H. Therefore END - START could return either of those two values. You cannot guarantee that DIFF is the same as D, because from just END and START there is insufficient information to tell you which duration value was used.

> If not, then would it be better for the first comparison to work and the second to fail, or is it better for the second to work and the first to fail?

I would say the second one is the important one (as we already know the first one is impossible!):

> * let DIFF = END - START
> * let UNDO = END - DIFF
> * assert DIFF == D
> ** assert UNDO == START*

Neil.