From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: current-time and GMP Date: Wed, 29 Aug 2018 15:16:44 -0400 Message-ID: References: <90b5009f-f752-3c7d-0a01-97dc6bc9d5ac@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1535570132 7653 195.159.176.226 (29 Aug 2018 19:15:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 29 Aug 2018 19:15:32 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 29 21:15:28 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fv5w8-0001qp-60 for ged-emacs-devel@m.gmane.org; Wed, 29 Aug 2018 21:15:28 +0200 Original-Received: from localhost ([::1]:44633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fv5yE-0001XV-DJ for ged-emacs-devel@m.gmane.org; Wed, 29 Aug 2018 15:17:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fv5xc-0001X9-Gb for emacs-devel@gnu.org; Wed, 29 Aug 2018 15:17:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fv5xX-0001ur-HT for emacs-devel@gnu.org; Wed, 29 Aug 2018 15:17:00 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:36332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fv5xX-0001tu-Cj for emacs-devel@gnu.org; Wed, 29 Aug 2018 15:16:55 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w7TJGigr025345; Wed, 29 Aug 2018 15:16:45 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 69F11AEBF7; Wed, 29 Aug 2018 15:16:44 -0400 (EDT) In-Reply-To: <90b5009f-f752-3c7d-0a01-97dc6bc9d5ac@cs.ucla.edu> (Paul Eggert's message of "Wed, 29 Aug 2018 02:07:17 -0700") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6362=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6362> : inlines <6837> : streams <1796925> : uri <2698853> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229062 Archived-At: >> - use GMP's mpf or mpq numbers (that seems like a lot of work for this >> only use, tho I guess we could then use those numbers in Calc as >> well). > Since the underlying nominal precision is typically nanoseconds, mpf is > unsatisfactory since it's inexact, Indeed, the problem with it is that mpf works with binary rather decimal exponents so it can't represent exactly the 10^-9 of nanoseconds. > and mpq's canonicalization would lose useful information about > timestamp resolution. Not sure to what extend knowledge about the resolution is important here. > Also, as you mention, both approaches are overkill for timestamps. That's right. > Furthermore, we extend existing timestamp functions to accept the form (A), > where A is an integer, to stand for a timestamp with count A using > clock-resolution ticks per second since the epoch. I guess in practice it might work fine, but I'm uncomfortable with the idea of using a representation that depends on `clock-resolution`, so if you print a timestamp with one Emacs and read it with another they may disagree (in a big way) about what it means (if one Emacs uses nanoseconds while the other uses picoseconds resolution). > Finally, let's deprecate the long-obsolete timestamp form (A . B) > where A and B are integers, Sounds good. > so that future Emacs versions can support a new > format where B is the timestamp resolution. Right, I think (INTEGER-TIMESTAMP . RESOLUTION) would be a nice representation. We can additionally (and temporarily) signal an error/warning if INTEGER-TIMESTAMP (and/or RESOLUTION) is "too small" (indicating a very likely use of the deprecated (HOGH . LOW) representation). Stefan