From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Re: [NonGNU ELPA] New package: sqlite3 Date: Tue, 21 Mar 2023 19:58:34 -0400 Message-ID: References: <87cz5o6csk.fsf@bernoul.li> <87mt4swxsw.fsf@posteo.net> <875ybd7mbh.fsf@bernoul.li> <87y1nzb95o.fsf@posteo.net> <87y1nq5pkz.fsf@posteo.net> <87ttye5mcw.fsf@posteo.net> <87mt46nj00.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19592"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jonas Bernoulli , emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 22 00:59:46 2023 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 1peltJ-0004qm-5I for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Mar 2023 00:59:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pelsV-0000Cm-Au; Tue, 21 Mar 2023 19:58:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pelsP-0000Az-PT for emacs-devel@gnu.org; Tue, 21 Mar 2023 19:58:50 -0400 Original-Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pelsN-0006HH-GW for emacs-devel@gnu.org; Tue, 21 Mar 2023 19:58:49 -0400 Original-Received: by mail-pf1-x435.google.com with SMTP id l14so10095041pfc.11 for ; Tue, 21 Mar 2023 16:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679443126; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VzaxhwpYM4tv7Ua6qXEWSLxapoXdWMbJ11/BiCPe7cY=; b=ZVNCwY9KXdOY3rbPNDywu4zUW8Qqgb4dmz0FhB25wNKm7rAgaqImgpacZJCv5xIr8K tz8egsPTRMgzcanT84ciV5eYpCmWK6BBLTBxJGUmYV2mp86tgss5+TsKP7wvr2VYnsxg X4umG18HxXc1htvnitIsZK/U92hKvW7R40yQrV/ABYamcFj4YQ4CLt3F4bi7mu4tmLAG B5qbJQFoKLsG9RQsbRLr6WUo0Vhg/dIMD1hh/CKVQg06sqX5Rbhk1R/blA7OnJr12Mqu NivkEyuoi1IeE6BEMFqUdw7v6APutmdo8DyIvYPBSrB7TFWcfK+PT76ohaeBslVBVwRI fnew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679443126; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VzaxhwpYM4tv7Ua6qXEWSLxapoXdWMbJ11/BiCPe7cY=; b=RSk3/p0GlviAXK8KzXvHdX89Gc/mcNELK1WvCLiKk3bK67fL11mq9qW3AzGcBkTYmY vePaQWHObLLRGEVAjHq+MDMQfd7Uctsxyopp9f/kcOLN7t/qX3ScbdE9mBOfGyz284sz t/ymBSYOOG/nBe9c8P+r7jQkVkOjWdpBqOxQh7KWaWaFAWI0NRMNyl4uOQ/ip26RLV4u XyUyc0PPaLvWHMlbKCOsp4F2V72N7LKL6a/SfSDRj4tgpqFq+5+6bLrOBFUip0mZhXMK Utkhc6b2agxoDbuier2Ix2XnMU52V/RBDMUUt+a2RjQpwoGxQ7tDIL/6qgH4K6dAjAIM gjmA== X-Gm-Message-State: AO0yUKUHD8BVXZvSj3/HaejpY7YKd1qS+EznS+RpMA92IaX3QZqkC1OO 9nEXvDckPnE5XN5WU1NUfMCNryycXRlYqxExrIM= X-Google-Smtp-Source: AK7set8xDkRux2+XL45ZBy3ej69V6u3AsezSPw3kH+ouzGl141z5/kUX4UmDms0416GfFGp0onT7QQBgDxdrvX9WjKQ= X-Received: by 2002:a65:5184:0:b0:503:25af:f50d with SMTP id h4-20020a655184000000b0050325aff50dmr232479pgq.4.1679443125202; Tue, 21 Mar 2023 16:58:45 -0700 (PDT) In-Reply-To: <87mt46nj00.fsf@posteo.net> Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=owinebar@gmail.com; helo=mail-pf1-x435.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304687 Archived-At: On Tue, Mar 21, 2023 at 12:53=E2=80=AFPM Philip Kaludercic wrote: > I really, really have no idea what you are getting at. As in "ok, but > what is your intent in explaining this?". > > Are you trying to propose that Emacs circumvents the SQLite API (that as > far as I see uses strings) by constructing statement objects manually? Not at all. I don't think I can communicate via email the power of generative programming techniques, and why basing them on simple string concatenation is a bad idea, so I'm going to stop trying. You're correct that strings are used in representing the queries, but the values that are stored and returned via the C api are strongly dynamically typed. BTW, I am not advocating avoiding the use of any strings in interacting with sqlite. That's impossible, since queries are ultimately presented to the sqlite engine as text (possibly with additional explicit values). But in lisp, identifiers and keywords are just values, too. I don't think "? ? table values ( 1.0, 'Foo' )" can be supplied with 'insert and 'into as parameters. > Are we sure that a database is more efficient than a hash-table (which > can already be printed and read)? Or are we talking about unusually > extreme values, like in your other message where you were loading 2000+ > packages? Who determines what is extreme? Tasks that aren't done today because they are difficult to code efficiently? Tasks that seem extreme when you write the code in direct style may become much less extreme once a well-crafted table/query facility is available. I don't think simply *installing* 2000+ packages is all that extreme in itself. Even loading all those packages, particularly when using redumping, is not particularly extreme in terms of resource consumption on modern desktop hardware. Hash tables only index a single key of a data set. And they don't address tasks like efficiently joining tables. My personal interests run to using relational programming for problems like abstract interpretation and compiler implementation. I'm sure there are many applications for problems Emacs is used to solve, e.g. tracking cross-references, tag tables, etc. > > > I'm sure there's more, but we won't know until the programming idiom > > is readily available and easy to use. > > Are there any other languages that support this kind of interaction, > where we could learn some lessons about the advantages and limits of > these ideas? You might consider the LINQ sublanguage of C# and other .NET-based languages as an example of a useful query DSL. Lynn