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: Wed, 22 Mar 2023 11:05:20 -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> <87ilet5hq0.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ca9d1d05f77e7d39" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34854"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 22 16:06:19 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 1pf02d-0008lS-0v for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Mar 2023 16:06:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pf01x-0001hY-FZ; Wed, 22 Mar 2023 11:05:37 -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 1pf01v-0001h8-Jt for emacs-devel@gnu.org; Wed, 22 Mar 2023 11:05:35 -0400 Original-Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pf01t-00063g-CL for emacs-devel@gnu.org; Wed, 22 Mar 2023 11:05:35 -0400 Original-Received: by mail-pj1-x102f.google.com with SMTP id qe8-20020a17090b4f8800b0023f07253a2cso19436885pjb.3 for ; Wed, 22 Mar 2023 08:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679497532; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KaZJJvMCldlHhF74ZxkPaFGURasgBjgQkal1Pd2Q11o=; b=HnXjfNgRwHq1Tm0otmushvZzcAjxBtAMtkPYh+m7x58fdAf31ZWM0+00hz9a/gQFvk 8RG9sVx+8ezVptp/mF8RrxppPQ5fxl6Jp91cYQpUBxGJ8ThYs5QDKFyJ6X6c6m7YQPHi 1zIYFyICKGdAxDPuKz0nRZ1a6e2BtkCS4LWTGzuMSmuzDvmsKTKNoe7JOtsgNyMUh8QP 6O11Zr8RGa6jbNTe7EgUNSKJsFq63bCnQTbGBH/zIgBDJvbXOKamL3Yr9MckVntkxpfA xA9fKqAErKmezYi4vfIHX1T/DkDWACpzGfeIL2P4Tt+GOBooSpsbgSmx8PUFku1VyQ3R +w4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679497532; h=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=KaZJJvMCldlHhF74ZxkPaFGURasgBjgQkal1Pd2Q11o=; b=TWBuNv6w98+3dyHrI7MB6ZM2k8hckGvMm9pbjgoXFVuiqwOIqRYORBtRAZv1rt1L/B 3cyED3KVXXwygPszdRualwh+0CoBZzT3jXDvW9uyTet+3RFsERdpFuWYWpRFffzg3awz aW8TlZwGzjLHHTV5eYcYbujZzpm3bwitQQem+LWLrMZieW2jvbqG5v0DQklBmHxnq16x 0jCd15McVnDbW9rNkRgPFGOVN+FFr/FbTho7DVpg4IopoF534ZsqDAkQBb6R0YdZWi4C OdvA8a7WYnnfPJy2K6jx2sleU/6WtMEasxgSQGBFeYrpomTmW8Agd4Lg8zgPU5E1baoH 69DA== X-Gm-Message-State: AO0yUKVLO5H9Ejv9Kistc/jWbxNBeEjV8icxTpc2p2e6FojwmKPFJTrZ ure6C588quQdMDESpXRD4qwmctTza1O96212TLs= X-Google-Smtp-Source: AK7set9IYhjyXQejx4Mwbqj0jD2/EyOydJfPbO099YgUeZPXCvaX5yehfgYt8mo3OSgC/6O5TXRjtx4ioT3DU7drATg= X-Received: by 2002:a17:903:244f:b0:1a1:d366:b0bd with SMTP id l15-20020a170903244f00b001a1d366b0bdmr1212133pls.9.1679497531922; Wed, 22 Mar 2023 08:05:31 -0700 (PDT) In-Reply-To: <87ilet5hq0.fsf@posteo.net> Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=owinebar@gmail.com; helo=mail-pj1-x102f.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, HTML_MESSAGE=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:304714 Archived-At: --000000000000ca9d1d05f77e7d39 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 22, 2023, 4:10 AM Philip Kaludercic wrote: > Lynn Winebarger writes: > > > 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. > > I get that, and I am not advocating for string concatenation. Perhaps > that is what is confusing me? > > > I don't think "? ? table values ( 1.0, 'Foo' )" can be supplied with > > 'insert and 'into as parameters. > > Nor do I, but I doubt the necessity. SQL is a very brittle language, > and replacing one keyword with another will usually require other > changes to be made as well. > Exactly the point of a DSL that compiles to a query. Whether emacsql is the best DSL or not, I don't know. I really haven't used it. It has the distinct advantage of existing and providing a syntax tree of the query, which are strong points. >> 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? > > Experience and convention? There is no algorithm to determine this, but > before 2000 the highest number of Emacs packages I heard someone was > using was maybe 300-400 (which I also think is an absurd number). > I don't know why it's absurd. There are ~300 packages in gnu elpa, ~200 in nongnu elpa, and over 5000 in melpa. The vast majority are single files. My experiments have shown that a substantial part of the pain of adding packages is simply due to the cost of extending the load path. I really question how much of the effort in these configuration management systems and specialized configs like doomemacs is prompted by the inordinate cost of the extending the load path just to add a one-file package. I can report from experience that most packages can be simultaneously loaded and work fine as long as conflicting modes are not simultaneously in effect. > > 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. > > In Elisp? > Eventually, sure - for elisp itself, anyway. It's a longer term project for me, though. > You might consider the LINQ sublanguage of C# and other .NET-based > > languages as an example of a useful query DSL. > > As far as I understand (I have no experience with .NET-based languages), > this is only syntax sugar? "Syntactic sugar" should be reserved for syntax that the compiler immediately transforms into a simpler syntactic structure. Otherwise any DSL can be shrugged off as syntactic sugar. I don't know the implementation details, but it's an example of a query DSL integrated into an otherwise imperative/OO paradigm language. Or how does this relate to the point of > dumping an in-memory database. > I just think it's a powerful paradigm that will eventually be utilized in core tasks involved in managing emacs itself, like reasoning about customization variables and relationships between them. Things that aren't done now because doing them without a relational language to take care of the details is painful as error prone. Once those kinds of tables are in use at startup, why wouldn't you want to include them in pdmp file? Particularly if you record pointers to objects as integers in the database - the dumper/loader will be needed to ensure those remain consistent. Lynn --000000000000ca9d1d05f77e7d39 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Mar 22, 2023, 4:10 AM Philip Kaludercic <philipk@posteo.net> wrote:
Lynn Winebarger <owinebar@gmail.com> w= rites:

> On Tue, Mar 21, 2023 at 12:53=E2=80=AFPM Philip Kaludercic <philipk= @posteo.net> wrote:
>> I really, really have no idea what you are getting at.=C2=A0 As in= "ok, but
>> what is your intent in explaining this?".
>>
>> Are you trying to propose that Emacs circumvents the SQLite API (t= hat as
>> far as I see uses strings) by constructing statement objects manua= lly?
>
> Not at all.=C2=A0 I don't think I can communicate via email the po= wer of
> generative programming techniques, and why basing them on simple
> string concatenation is a bad idea, so I'm going to stop trying.
I get that, and I am not advocating for string concatenation.=C2=A0 Perhaps=
that is what is confusing me?

> I don't think "? ? table values ( 1.0, 'Foo' )" = can be supplied with
> 'insert and 'into as parameters.

Nor do I, but I doubt the necessity.=C2=A0 SQL is a very brittle language,<= br> and replacing one keyword with another will usually require other
changes to be made as well.
<= br>
Exactly the point of a DSL that compiles to a qu= ery.

Whether emacsql is = the best DSL or not, I don't know.=C2=A0 I really haven't used it.= =C2=A0 It has the distinct advantage of existing and providing a syntax tre= e of the query, which are strong points.

<= div dir=3D"auto">
= >> Are we sure that a database is more efficient than a hash-table (w= hich
>> can already be printed and read)?=C2=A0 Or are we talking about un= usually
>> extreme values, like in your other message where you were loading = 2000+
>> packages?
>
> Who determines what is extreme?=C2=A0

Experience and convention?=C2=A0 There is no algorithm to determine this, b= ut
before 2000 the highest number of Emacs packages I heard someone was
using was maybe 300-400 (which I also think is an absurd number).

I don'= t know why it's absurd.=C2=A0 There are ~300 packages in gnu elpa, ~200= in nongnu elpa, and over 5000 in melpa.
The vast ma= jority are single files.=C2=A0=C2=A0

My experiments have shown that a substantial part of the pain = of adding packages is simply due to the cost of extending the load path.=C2= =A0 I really question how much of the effort in these configuration managem= ent systems and specialized configs like doomemacs is prompted by the inord= inate cost of the extending the load path just to add a one-file package.

I can report from experie= nce that most packages can be simultaneously loaded and work fine as long a= s conflicting modes are not simultaneously in effect.=C2=A0 =C2=A0


>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Tasks that aren't done= today because
> they are difficult to code efficiently?=C2=A0 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.=C2=A0 I don't thin= k simply
> *installing* 2000+ packages is all that extreme in itself.=C2=A0 Even<= br> > loading all those packages, particularly when using redumping, is not<= br> > particularly extreme in terms of resource consumption on modern
> desktop hardware.
>
> Hash tables only index a single key of a data set.=C2=A0 And they don&= #39;t
> address tasks like efficiently joining tables.
>
> My personal interests run to using relational programming for problems=
> like abstract interpretation and compiler implementation.=C2=A0

In Elisp?

Eventually, sure - for elisp itself, anyway.=C2=A0 =C2=A0 It'= s a longer term project for me, though.=C2=A0=C2=A0
=
> You might consider the LINQ sublanguage of C# and other .NE= T-based
> languages as an example of a useful query DSL.

As far as I understand (I have no experience with .NET-based languages), this is only syntax sugar?=C2=A0

"Syntactic sugar" should be reserved= for syntax that the compiler immediately transforms into a simpler syntact= ic structure.=C2=A0 Otherwise any DSL can be shrugged off as syntactic suga= r.=C2=A0 I don't know the implementation details, but it's an examp= le of a query DSL integrated into an otherwise imperative/OO paradigm langu= age.


Or how = does this relate to the point of
dumping an in-memory database.

I just think it's a powerful paradigm tha= t will eventually be utilized in core tasks involved in managing emacs itse= lf, like reasoning about customization variables and relationships between = them.=C2=A0 Things that aren't done now because doing them without a re= lational language to take care of the details is painful as error prone.
Once those kinds of tables are in use at startup, why = wouldn't you want to include them in pdmp file?=C2=A0 Particularly if y= ou record pointers to objects as integers in the database - the dumper/load= er will be needed to ensure those remain consistent.

Lynn


--000000000000ca9d1d05f77e7d39--