From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Vibhav Pant Newsgroups: gmane.emacs.devel Subject: Re: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.] Date: Thu, 23 Feb 2017 23:20:54 +0530 Message-ID: References: <1b07c68a-873e-83c8-246d-423bc83a3881@gmail.com> <83y3xg4ldw.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c052e4644de3d05493641d6 X-Trace: blaine.gmane.org 1487872273 16657 195.159.176.226 (23 Feb 2017 17:51:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 23 Feb 2017 17:51:13 +0000 (UTC) Cc: =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= , Tino Calancha , Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 23 18:51:09 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgxXj-0003d8-Bq for ged-emacs-devel@m.gmane.org; Thu, 23 Feb 2017 18:51:03 +0100 Original-Received: from localhost ([::1]:60056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgxXp-0006lb-93 for ged-emacs-devel@m.gmane.org; Thu, 23 Feb 2017 12:51:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgxXf-0006kf-1X for emacs-devel@gnu.org; Thu, 23 Feb 2017 12:50:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgxXe-0003Kg-2z for emacs-devel@gnu.org; Thu, 23 Feb 2017 12:50:59 -0500 Original-Received: from mail-yb0-x230.google.com ([2607:f8b0:4002:c09::230]:33185) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cgxXd-0003Ji-VT; Thu, 23 Feb 2017 12:50:58 -0500 Original-Received: by mail-yb0-x230.google.com with SMTP id d88so6508172ybi.0; Thu, 23 Feb 2017 09:50:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qPUK4Q6OjKMJ+Y2AWwjQN3pB+w4TKy0QXqnBXJ7kGeA=; b=mFY6kAQsUmnUturTuVrhDZfhpe0byXiER05EbH9pNyUB9B/rZy3/56KD1s2sSC2u6J mJYZK38YcMnbAayxcO2Nxq7whfTKvuByFEFNQrrYZ4ZHeiuhdisSGSYQqg58hi4jPQ3D qO5QXNDJv6eYc9JogCNPQFDNbHSSVQ+eCLDgoYvUFI5k5AVUkUYhRODGFv06tkqbBu9s PyIXVX00gnH/VfNWKilOQdqa/ICtuGmWFPmJIQYcaZ+UiywY9GY/ybdTV6OOUIy2ulYU zsY9js0YtuhKLt/w8VMEX0JRYVkd5Wzy7tIgjOjPbFxbaUfVTOHaq3XlXPa+og90joTq gXqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qPUK4Q6OjKMJ+Y2AWwjQN3pB+w4TKy0QXqnBXJ7kGeA=; b=bfql1//8K8Yaple7Nfy1vimUX1/C36bxaf/XHk+DoB5Tum+hcngoplLAOhv/jrN+rN MDdU9Eq67zK/SCByZ4pK2r1bE2B/gIS3oPYhT6ZdfFlmWe9BlX1mXuCdLctoi/VnEnuW h6oIhI2R0hq5ShctinDK/lIe62Fr0nw3dJnTq+GZfmT+cXXoQ56uGEY/+YXUpxYaIRdL SNsmx/0q1DI2r9p+6bkDcAcjuiBar5DByRQDqy7UpQrpl5QCrlnT7V99HsG2BDCCRS5E xmCbkS20AeIu4s5v5vg8LXnT3MhFoDeJG9GMDTvAElRne3Cw17hSB79PdU7NViR6YDBu R72A== X-Gm-Message-State: AMke39ljuPKBPLbcos+D6T6Wc0YHMAJKG/fLcI36lVwQSe9OAagsqtufQnj+sOwtPJQh4alKwFlCFTJqbL96gA== X-Received: by 10.37.193.69 with SMTP id r66mr28616886ybf.123.1487872255645; Thu, 23 Feb 2017 09:50:55 -0800 (PST) Original-Received: by 10.129.164.67 with HTTP; Thu, 23 Feb 2017 09:50:54 -0800 (PST) Original-Received: by 10.129.164.67 with HTTP; Thu, 23 Feb 2017 09:50:54 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c09::230 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:212550 Archived-At: --94eb2c052e4644de3d05493641d6 Content-Type: text/plain; charset=UTF-8 I think we should improve how compatibility checks are done with ELC files. The current code is hardcoded only for adding a comment header denoting that the bytecode uses dynamic docstrings and multibyte characters. IMO, this should be replaced with a list of (FEATURE-NAME . COMPATIBLE-VERSION) pairs that Emacs checks against while loading bytecode files. Thoughts? Vibhav Pant vibhavp@gmail.com On 23-Feb-2017 7:09 PM, "Stefan Monnier" wrote: > I) Compile under master branch. > II) Load the resultant .elc with Emacs-25 As explained by Richard, this is usually considered acceptable. We don't really try to provide forward compatibility of byte-code files between major versions. This said, occasionally we try to reduce the pain a little: e.g. in Emacs-25 a similar incompatibility was introduced for the compilation of catch&condition-case, but the bytecodes were introduced a bit earlier. IOW the incompatibility was fundamentally introduced in 24.4 (IIRC), but the use of the this new feature was only enabled in Emacs-25.1, so files compiled with 25.1 will usually work in 24.5 as well. Stefan --94eb2c052e4644de3d05493641d6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I think we should improve how compatibility checks a= re done with ELC files. The current code is hardcoded only for adding a com= ment header denoting that the bytecode uses dynamic docstrings and multibyt= e characters. IMO, this should be replaced with a list of (FEATURE-NAME . C= OMPATIBLE-VERSION) pairs that Emacs checks against while loading bytecode f= iles.

Thoughts?

<= br>

On 23-Feb-2017 7:09= PM, "Stefan Monnier" <monnier@iro.umontreal.ca> wrote:
> I) Compile under master = branch.
> II) Load the resultant .elc with Emacs-25

As explained by Richard, this is usually considered acceptable.
We don't really try to provide forward compatibility of byte-code files=
between major versions.

This said, occasionally we try to reduce the pain a little: e.g. in
Emacs-25 a similar incompatibility was introduced for the compilation of catch&condition-case, but the bytecodes were introduced a bit earlier.<= br> IOW the incompatibility was fundamentally introduced in 24.4 (IIRC), but the use of the this new feature was only enabled in Emacs-25.1, so files compiled with 25.1 will usually work in 24.5 as well.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--94eb2c052e4644de3d05493641d6--