From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Gramiak Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Some new vector procedures (vector-{memq, apply, to-string, ...}) Date: Sat, 20 Apr 2019 19:52:36 -0600 Message-ID: <877ebo6s63.fsf@gmail.com> References: <8736md90v0.fsf@gmail.com> <83lg05b1jk.fsf@gnu.org> <87lg047h9n.fsf@gmail.com> <83y344a97a.fsf@gnu.org> <87bm107d7q.fsf@gmail.com> <83tvesa3w1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="2929"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 21 04:04:44 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hI1qV-0000e7-Un for ged-emacs-devel@m.gmane.org; Sun, 21 Apr 2019 04:04:44 +0200 Original-Received: from localhost ([127.0.0.1]:47672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hI1qV-00009u-1v for ged-emacs-devel@m.gmane.org; Sat, 20 Apr 2019 22:04:43 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hI1pv-0008UR-I7 for emacs-devel@gnu.org; Sat, 20 Apr 2019 22:04:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hI1f1-0005UP-1F for emacs-devel@gnu.org; Sat, 20 Apr 2019 21:52:51 -0400 Original-Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:43591) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hI1ey-0005Pn-4n; Sat, 20 Apr 2019 21:52:49 -0400 Original-Received: by mail-pl1-x631.google.com with SMTP id n8so4207049plp.10; Sat, 20 Apr 2019 18:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ebmaWaLGUXytLyYfDoMiNo1by8yjMSm7uVurYJq/NRc=; b=b+keMF18hFH2cLuvzJe1m/6M2Os9r7NgjHCbmWxtStg7vAXE1bk13B1xPGKPJq7Apd oINsX5rrxot/ZcgEYdDzEofGTcm3WXEfRAc7WZdulHAvtIoIAd8yM1A+5YRQY0ed+oKG ny7yWPVBGjVHsnVwEEkfDjAkYYOlPDIH3O0MhDBxSd0iSbSi79uXSrKaHVFXGwxam60M K/OWFH5dOCmy6YU5ZxBMLizpNmtfAj485JeFw64NfFBhjETY2EAVa6aq2mJ+4A6dHOK0 XTdYd+EEw6CgocAooEHSbmnM195lNk4e/b4QxfWO7t93sGjCNU27KLmtAyAnbmGGWVpx nB/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ebmaWaLGUXytLyYfDoMiNo1by8yjMSm7uVurYJq/NRc=; b=JLF8U0r8WsAdJKJAdyGnk9gE2UlzKB4dw2jMOcJ8AUmFF7H6qB6dVxThmd3AzktZR/ b6j/VlCHcF8q+z5rZ/nVuRlnDccB4JxMdmH7b9hk0GzD0XZIIEoBmwjVMIcCEtKLdV5I uPWNKXUqA3kOuDmtqFRcA0kBpxMMtSLBvwu1Yiy6LUgcowUMVH4U31DkEF+VKTW4HxpX 7j/fseFXjrFfbNVgaZp9rDvhpBq+bdz2aKhzdyB/4ILaXmCOmbXQ4muWToNcYL+T4c4o B1YX/ch1uYsCPp7Ez7b87yPY7LrB/Tj1tzfRpM9trEFH2KC/RaQ0z5b21ttK27k+mn09 5EtQ== X-Gm-Message-State: APjAAAVTE2/OVwSusWqjxK/subYnr2cPeirQikk3YIaQjibFwL72mVWj gngmX9So8Ix3zHlK5xAcimSUZKSm X-Google-Smtp-Source: APXvYqwNcRch9eFda3hdhZh7Ul5ouojYuCHWoFs6TYAu3cKHcHZW2/5gv5F/UoGa7KLNahS9Ar9xqQ== X-Received: by 2002:a17:902:5609:: with SMTP id h9mr2669051pli.35.1555811565792; Sat, 20 Apr 2019 18:52:45 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id y10sm12741285pfm.27.2019.04.20.18.52.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 20 Apr 2019 18:52:44 -0700 (PDT) In-Reply-To: <83tvesa3w1.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 20 Apr 2019 22:11:10 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::631 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:235722 Archived-At: Eli Zaretskii writes: >> From: Alex Gramiak >> Cc: emacs-devel@gnu.org >> Date: Sat, 20 Apr 2019 12:18:01 -0600 >> >> Ideally. Though in the case of vector-partition the size of the 2 >> partition vectors is not known in advance, so a Lisp implementation >> would have to create two extra Lisp vectors as opposed to using >> SAFE_ALLOCA. That is, unless Elisp grows a growable/resizeable vector >> type (which is something I was thinking about -- would that be denied?). > > What would be the advantage of that vs lists? Better space efficiency, less pressure (hopefully) on the GC, and faster random access. I believe growable vectors would make sense for linear lists that don't need the insertion/deletion properties of linked lists. As for vector-partition, it's more so a means of keeping the input and partition types the same. Not a huge deal. > Vectors are used quite rarely in Emacs Lisp, IME. Not enough suitable vector procedures doesn't help, though. Emacs Lisp is certainly not a general-purpose language, but that doesn't mean that it has to be missing particular language features/types that improve efficiency as long as it doesn't add a lot of complexity. > Every additional primitive means a burden. More importantly, we > should IMO be consistent in how we design and implement families of > functions, which is why I still think we should extend seq.el > (possibly some of that with internal C primitives, if needed), instead > of starting a new family. I'm not sure what you mean here by internal C primitives if it's not similar to vector-memq/member. Do you just mean expose a single `sequence-memq' and keep the new type-specific implementations internal?