From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Shorter and more flexible implementation for parse-time.el Date: Sun, 25 Jul 2021 12:14:04 +0200 Message-ID: References: <87mtqb3o7q.fsf@gnus.org> <87lf5uzyt0.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20666"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , "Guu, Jin-Cheng" , Emacs developers To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 25 12:15:01 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m7b9w-00057o-Vg for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Jul 2021 12:15:01 +0200 Original-Received: from localhost ([::1]:39420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7b9w-0000Gz-1r for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Jul 2021 06:15:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7b9A-00083H-S8 for emacs-devel@gnu.org; Sun, 25 Jul 2021 06:14:12 -0400 Original-Received: from mail-oln040092074064.outbound.protection.outlook.com ([40.92.74.64]:25597 helo=EUR04-DB3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7b96-00021v-Jx for emacs-devel@gnu.org; Sun, 25 Jul 2021 06:14:12 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JBjO/TueEwseVglWSioywOyrdMQKjN3Mq8HJPHbqojRtMv+Mq4boCn8sfcn4S7RR87/d9GNG4sugN8CXibX7rCfSPOe+nX0f53Gb7dXGXCR2x8bm4vKAPk732RTK5big3VFPDna6QOA9NATFcCue9XGrP885BmRFgiwD+hfdvGxSd1AaXSSjvoiFVXvhTuhmXnzRCVK6dBrR3U+tBK1t6G3E8eMZdgr6Dp2pWAEz6FQN50RNC+68aNuDSuPA3KH4+ZPzECe0WRyrcvIqkTjDmaye2DFXPGb3w8UXlnZUIK6yRARKnrtk0sbMgmfokhmovNOckmi2NkxlS2gs/igWfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N5DXJzcVszG5C098wVmDVA4kY3/cxeM61Ki81IiTVD0=; b=NdHeFsuln5e3NkFkfjxVBJTQNA/nA7hPf8/Dw5oHYScQ+mQqyPTSBNM9h2FxWyEXJW/vU0xnXsw01uJozF+qrDiuxD2brMJPJ7AWHQSetHqm5F7EXWnMD8VzEpfSp3rf/jc2GZT7vRgyuGa+o+YS1AaCYGNQQX/3TlCKgmAxnb16wKJIfA+Dh5WeuFaXtXEFd6cqskPYvqInmpkIm9Ma7Z43SuAqZljIAjRPhClPSWqB/ANw8rXOt2oBeOfcMsKoMexo3qC3HtWjPcYRIF0qEN5Ml7dES4qDkAMLPUYZUOzO6i7ox1UACVlqd9vo2koseumn8gggz3kUgEf7VZ3/eQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N5DXJzcVszG5C098wVmDVA4kY3/cxeM61Ki81IiTVD0=; b=UjOz8QJyxtP/47Fu9skE4++9iP0DU7QYDHC1u5diB+cYgSkR/fHwiFc11BcYdWQY+pT4dnjdo4kkUZZeTRVt+ufwq3qmH3SGaNXUkRYRNy45TNeKImSyaWwqTY5B3YSRRCtFf0PIzRlM5Dyr4GWNuV+B1Ik70mzFu4QU/3BbPUXdbmD6Hns9KhKnwo5qmnwaNCusWevNxJNo70BG8EwPMILvajQ/S7YeS7ZlH+qhE4V37BSSWq8Fgwr8T7RxYnmm5W4X9rBl2ExhCmt+/dr5asKj75tTY21t/XBUY0tWg+vSJIRfG73DTO7qH35s5K3Uu7gOE37K81W9Qi6I8282VQ== Original-Received: from VI1EUR04FT033.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::50) by VI1EUR04HT155.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::451) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24; Sun, 25 Jul 2021 10:14:04 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e0e::4b) by VI1EUR04FT033.mail.protection.outlook.com (2a01:111:e400:7e0e::386) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Sun, 25 Jul 2021 10:14:04 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A90DAB1A64614608B0BAA5C98F0803A20E5A6C59711821978E7B302571C6FE0A; UpperCasedChecksum:83E6F0641F6505F8F54717C42896C6EE0A5E06F6F679DB3E795B799A803B4150; SizeAsReceived:7837; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::e47b:760e:fa35:f28b]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::e47b:760e:fa35:f28b%7]) with mapi id 15.20.4352.031; Sun, 25 Jul 2021 10:14:04 +0000 In-Reply-To: (Yuri Khan's message of "Sun, 25 Jul 2021 16:58:18 +0700") X-TMN: [lcplM5ou/YB9b8RKcbSHvrJN53OlxB6i] X-ClientProxiedBy: AS8PR04CA0051.eurprd04.prod.outlook.com (2603:10a6:20b:312::26) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87k0len1jn.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AS8PR04CA0051.eurprd04.prod.outlook.com (2603:10a6:20b:312::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.29 via Frontend Transport; Sun, 25 Jul 2021 10:14:04 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: be956726-8a2e-401d-dbf1-08d94f54ee5f X-MS-TrafficTypeDiagnostic: VI1EUR04HT155: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LmIv33ZWIoOJQVYhZ+1nUyuVsT8CV+s/ZeRgg53eJcam0gmxI/kiI3B5l1rzXCVFFDp9ygEakz6GhoW7tMxE7WD286JWye/3lzoklst/PkZQUlLCCA78YoFoDTKY8hv7VLC/Jqc8Vq4A5iw2WHqR31iCccUE14U2deWtujJeXbxZxgUzbFuhYwHrLE8C59e9SoD2TLGx9k9SrdvO9WG9ykgokgOk2IJxxCqs9tGrAqLwJZpAWu18LUhsbFYJ5s3khZYIEPsHoRIRPejGzdeuGKoQpHZ6rtA9g7r+G13HbtA3SC72rshbjzs6DWzq/Dkh5v9gCOzeldCZWwN0sBleRA92RMJE1Y2cl5y9HqiKuBRjoNWsQwFbwBaMXI33D5EqEh7i1knpkCjH+z+yXy82YJLhMjX9mvR7xL+bLUE7FczqF6O1cfovHtMngGe2GvKJ6h4PD/b/RLT9u5QQ99AUrJMtA+4uyuFMMkGcAqgUw3c= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +/kzuEgFMJ7aJod6Ei3QmM1Z5+lg7tVaHbZJHshXryLAmdzZ0uGnvHns8zw28wKiX/1FQR+1RVQoDLTB16aSW6tIrWa++rPvmLo8guz4hIr+Q/nXDFNysErRT2psjIf3Ivn8nVCNjP3waUHncbnoxw== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: be956726-8a2e-401d-dbf1-08d94f54ee5f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2021 10:14:04.7948 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR04FT033.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR04HT155 Received-SPF: pass client-ip=40.92.74.64; envelope-from=arthur.miller@live.com; helo=EUR04-DB3-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271596 Archived-At: Yuri Khan writes: > On Sun, 2021-07-25T16:38, Guu, Jin-Cheng wrote: > >> And you're totally right, date parsing as a whole won't be easy. In >> general we would hope for a parser that is smart enough to deal with >> flexible formats. However, some specification needs to be given at >> some point - for example "01/01/01". That is why I came up with an >> assumption that I think is general enough but also can have a definite >> output. > > The right way to solve the date parsing problem is by getting everyone > on ISO-8601, not by learning to parse every existing format. > > https://xkcd.com/1179/ Indeed, but as we have seen with other standards that will probably not happen out lifetimes. Americans are still measuring in inches and Englishman in yars, despite both signing SI convention long, long time ago ... :). How interesting/prospectful would it be to get (optional) elisp binding for the icu library? https://github.com/unicode-org/icu http://site.icu-project.org/ It offers lots of translations, date formats, and other locale things. ICU is likely to be installed on most of desktops since lots of other software use it, and it has support for binding from C. Alternatively one can transform their database into something usable form Emacs, but it's probably more work and would be duplication of the database which probably is installed somewhere on users computer anyway.