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 09:04:45 -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> 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="17212"; 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 Tue Mar 21 14:05:26 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 1pebg5-00049z-6g for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Mar 2023 14:05:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pebfg-0001wN-JK; Tue, 21 Mar 2023 09:05:00 -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 1pebff-0001w2-Aa for emacs-devel@gnu.org; Tue, 21 Mar 2023 09:04:59 -0400 Original-Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pebfd-0005NC-Hz for emacs-devel@gnu.org; Tue, 21 Mar 2023 09:04:59 -0400 Original-Received: by mail-pl1-x632.google.com with SMTP id o2so8499505plg.4 for ; Tue, 21 Mar 2023 06:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679403896; 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=ChvBMgDyrhnpvAN+F/SWwtq9LeJcyukafUNospLFO6A=; b=NZLONTYO5FOoz2eNqgSbzZSv6SSt5+f4Uy5IMAvRiID3OekAKv5FC53EbD9phRtUxi nYufF7bubZN8Q7ZYKhUWQr55Iwp6XcXfh8ChgHKF1+qbwb3xp4FVgbleSNvKFqphUfxi yE/1TiCNFLEScoHwAEyYKhrqhbGN5Y/jF299KHCKXo8f9fj0RS67VMyq5HEOQZMGNxze 7VJbFWQNAU9exfPOAuif79sgpnlYiK8HTEWZfP/gtx/o00vted/TLMr6SQcQiVHyM6qF nrAF0eJk+BrOrYI9Lj1F6Dat7ptWSfoGpV2cU+rRB+AUOgqRcJWR4/d9YcFnII1ipJ10 gRzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679403896; 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=ChvBMgDyrhnpvAN+F/SWwtq9LeJcyukafUNospLFO6A=; b=DnuQkO8sKrOxrSYpMYzAuJFM1JvVugiesmiOEUyS0G3DMEYem9nYnCCLJqk8rYQ72P s9w4OYsRH8ExYeA78KMpYe8bwHpRB57Um+JCXbQDvZ1L+mqicXaECkN05/8X07+DmiAC DQDfHZeDuY384ArRQHPQZH8NXm2nqCKbiixDphaAHKkahx5+grzR2qZosXjVXPu/tbFt Uhca3CsaKvsIUWq7avE1f4xCSSmCf3QkxDQmjR2IwyeTWS67Lf4I0BsyMwHD8dP/HwYY F26prRILIfnxaNQBK318YE/3jtNrqhBW77M58OAHhPt8sCHZhEiFZdWzNwRnzp5CARhS it3A== X-Gm-Message-State: AO0yUKVHPYMgj6hkhetASm+nNiFKo1NIYgvBcq5Uq50WpPJAkJ1R0AuE kStAK8OgeQQxuagK8QyfUhYZ9FBK3pWMBT4H6pIPBeDx X-Google-Smtp-Source: AK7set80mMhA6EKsb/e+b/8rjdPU/dp2Z+Q3nDSIXrtMQJJHL6MwstM8gJWdKqrTI2n+oaN+E6Kwk/YGS19dqYjfYxg= X-Received: by 2002:a17:90a:64cd:b0:233:cc2c:7dae with SMTP id i13-20020a17090a64cd00b00233cc2c7daemr633158pjm.8.1679403895778; Tue, 21 Mar 2023 06:04:55 -0700 (PDT) In-Reply-To: <87ttye5mcw.fsf@posteo.net> Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=owinebar@gmail.com; helo=mail-pl1-x632.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:304643 Archived-At: On Tue, Mar 21, 2023 at 8:18=E2=80=AFAM Philip Kaludercic wrote: > Lynn Winebarger writes: > > >> > * Treating code as data and vice-versa is a powerful programming tec= hnique > >> > >> Not sure about this.... Strings are data too, but neither the SQL > >> statements or the regular expressions are (Elisp) code. > > > > Are lisp macros written in terms of string interpolation? If there > > are no other types of data than strings, fine, but that's not really > > the case - machine instructions have different operations for > > integers/floats/pointers, a good programming abstraction will reflect > > that. If the underlying machine used strings to represent numbers and > > arithmetic operations took two numeric strings and produced another > > numeric string, maybe there'd be a case to be made (although the first > > point above still mitigates against it). > > I really have no idea what you are getting at. The reason for not trying to construct SQL from strings (in macros or other programmatic ways) is the same reason lisp and other dynamically typed languages don't just treat every value as a string. The lisp macro expander doesn't create a string to pass to eval - why would you want to turn everything into a string for it to be parsed again, and possibly introduce errors along the way? If I have a double that happens to be expressible as an integer in text, will the system ensure the generated query uses and returns values as doubles? If the machine only had string data types (I don't know how that would work, it would be radically different from any architecture I'm familiar with), then there would be an argument for only having strings as primitive values, even in general purpose languages like lisp. > > >> To me the > >> advantage of something like `rx' is that I can insert comments and mak= e > >> use of regular indentation. Then again, it would also be possible to > >> provide specialised SQLite wrappers (sqlite-insert, sqlite-update, ...= ) > >> instead of taking a `rx' like approach to generating strings. > >> > >> > The real power of embedding sqlite in elisp will come when sqlite da= ta > >> > structures can be used as efficient representations of sets and > >> > relations in lisp code. Eventually, I would also expect to see > >> > mutually recursive code enabled, with "virtual table" modules for > >> > emacs data structures so they can be transparently used in sql code, > >> > along with sql functions written in lisp. For example, you might > >> > create a table from lisp data using a select statement rather than > >> > executing a large number of insert statements. In-memory databases > >> > would not be unusual, and should be dumpable objects. > >> > >> What is the point of using a in-memory database if you want to dump it= ? > > > > It's just another data structure at that point, so why wouldn't I want > > to be able to include it in my pdmp file? Why would I want to make my > > internal data structure available as a separate file, or manage > > creating and tracking those files? > > My bad, I did not understand that you were talking about dumping in > terms of what temacs does. Also for redumping with dump-emacs-portable. > [...] Perhaps you could be more clear if you have > a specific example of what you think a in-memory database could be used > for when dumped along with Emacs? * Anywhere a large association list or hash table is currently used * Caching library locations, checksums, and modification times for more efficient loading * Tracking customization variables, dependencies, etc for generating the correct sequence of initialization commands at startup (particularly after redumping) I'm sure there's more, but we won't know until the programming idiom is readily available and easy to use. Lynn