From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Tue, 17 Feb 2015 10:04:21 -0800 Message-ID: <54E382A5.5030408@dancol.org> References: <87bnl1vmqf.fsf@lifelogs.com> <87vbj8tow4.fsf@lifelogs.com> <87r3twtagf.fsf@lifelogs.com> <85siebl7ws.fsf@stephe-leake.org> <85a90ilwmm.fsf@stephe-leake.org> <83386a6f7z.fsf@gnu.org> <85h9upjz7v.fsf@stephe-leake.org> <83wq3k3kl4.fsf@gnu.org> <85bnkwil1c.fsf@stephe-leake.org> <83pp9cwky8.fsf@gnu.org> <85a90ggf2d.fsf@stephe-leake.org> <54E0A40F.5080603@dancol.org> <83sie7un20.fsf@gnu.org> <54E0D181.2080802@dancol.org> <83r3trulse.fsf@gnu.org> <54E0D7E0.305@87.69.4.28> <83h9unukbg.fsf@gnu.org> <54E0DEF8.7020901@dancol> <83egpruiyp.fsf@gnu.org> <54E0FF93.2000104@dancol.org> <833 865vp4d.fsf@gnu.org> <54E2355A.90@87.69.4.28> <83vbj1u020.fsf@gnu.org> <54E24CA4.9020601@dancol.org> <83h9uk7ddb.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="avToIbfo8huNQbuJ4ri1vOMS3ucaL5TsM" X-Trace: ger.gmane.org 1424196290 6881 80.91.229.3 (17 Feb 2015 18:04:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Feb 2015 18:04:50 +0000 (UTC) Cc: Stephen Leake , Emacs development discussions To: =?UTF-8?B?QXVyw6lsaWVuIEFwdGVs?= , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 17 19:04:49 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YNmVo-0001k9-GH for ged-emacs-devel@m.gmane.org; Tue, 17 Feb 2015 19:04:44 +0100 Original-Received: from localhost ([::1]:46691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNmVn-00033R-NW for ged-emacs-devel@m.gmane.org; Tue, 17 Feb 2015 13:04:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNmVf-00032y-Ib for emacs-devel@gnu.org; Tue, 17 Feb 2015 13:04:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNmVZ-0007RU-7Q for emacs-devel@gnu.org; Tue, 17 Feb 2015 13:04:35 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:50611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNmVY-0007RB-QR; Tue, 17 Feb 2015 13:04:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=plfdsdMLohXVSg0ylt+aqU8XCDUhNQkea7fjDO0yzeQ=; b=Z5AMaHyjMv6Fat5IaYIZN/clW2aSHhtipyRz8MDww+DPHQeeRubk8WzqyE9A6k96cz6Or+zZuvxyZyCnIUvfW3fx4+4loPr1xob46qJLvoBHyF1j8Kcr08AyNrvhSPpCtJRte0SjNTVx623Mi1qWRcBksJioA92BRzfw9CZM/rnPdfYqOTCKco1ifVgp9CSBScfR7UFkkJ7gSaJdbSqeCl8A4HmE3zWKoOF2ayp7qs7c/oGj9AjKIb5SB2D22MVVw/2++5IgvI9vOrc83SfXpjQVfNWXPz/ZcoLlftTZkmzducwetG1V2CXZGxOQxm3JzedGn50WOahnjodKC90SxA==; Original-Received: from [2620:10d:c083:1004:7211:24ff:fe8c:b06d] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1YNmVX-0006lw-Np; Tue, 17 Feb 2015 10:04:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183201 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --avToIbfo8huNQbuJ4ri1vOMS3ucaL5TsM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/17/2015 09:46 AM, Aur=C3=A9lien Aptel wrote: > I'm with Eli on the versionning choice but it's just bike shedding at > this point. I'm worried about what happens during long Emacs development cycles. Say we're developing Emacs 26 and during its yearlong release cycle, we add to emacs_env a `make_foo' in month 3 and an `access_bar' hook in month 6. I want to make an distribute a module that uses `make_foo' if it's available. If we have some kind of explicit versioning enum, we'll probably have only one per Emacs release, so modules won't be able to detect that `foo' is available until we release Emacs 26. If we make the version date-based, we'll have a lot of different versions, and it'll be hard for a module author to figure out which constant they need to test against. A size field seems just right, since it automatically updates when and only when we add something to the struct. > Interning all the time seems tedious and probably (a bit?) slow but > moving the interning on Emacs side won't change the slow part. At > least on the module side you can do it once and reuse the result. Or > maybe you shouldn't if the user changes the binding in the meantime? I agree that interning all the time is tedious, but I don't intend module authors to use this interface directly. What I've described is just the narrow ABI-stable boundary between Emacs and modules; we can give module authors a richer "client" library, implemented in terms of the stable ABI, that itself doesn't need to ABI-stable (although we should try to make it source-compatible upwardly). I have a few ideas for making life easy for module authors. One idea is to make evaluating Lisp very easy. We can provide something like this: bool emacs_eval(emacs_env* env, const char* lisp, ...); Then module authors can write code like this: success =3D emacs_eval(env, "(put-text-property %v %v 'myproperty (myfunction))", value_min, value_max); Internally, we'd then call (using emacs_env::funcall) a function we'd define in Lisp in Emacs: (%module-eval "(put-text-property %v %v...)" ) That function would then transform the %v substitutions to expressions like (nth module-eval-arguments 0) (nth module-eval-arguments 1)) And then call (let ((module-eval-arguments args)) (eval expression-from-module)) This interface isn't the most efficient thing in the world, but it's hard to be more convenient, and it's good enough for code that isn't executed frequently. --avToIbfo8huNQbuJ4ri1vOMS3ucaL5TsM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJU44KlAAoJEN4WImmbpWBlsl8QAKv651LNhCBhLBFQBMAvnjUd dhF0vJaCQy7+TIvv1nJWf2IcG5d1gNlRcSgQQ7buKJ3G09Z7Go2fAa97H4j6NjPz d6q9jgZHr4XSHZev4qBOp8gjfNLpWSSCVAALAuZhkbFFPtnoVm5tLeAnkFCovewh zzWfxxBAN6tMAnTqwM6cSmtZ8fjUl0cQsHmbo5onRSw1Rm1lXuMEl9ACRx1wx4I3 kGmE1WMrsGK5y+xWcxF6xGn6q4wlOh/+gHNgLfwzVMZYe3S2NsFZukBl8yQCJIm0 kMCx+wA69foGo+aaCQIW47S91NeD2FBS4vr6VT03JLZgFLzZ6/3yYBqG5zGBG+bh XLnBpbXXYpiQwL5FQPhosPZkDAq33xw0DR+Zi+wnJcC5oVcfsTW3os0kurkP7UBu Z+R6fclx348xDq8g0nC1IVkHaYLNZfXuV+KvbqWPrc022c+7Hqxp3uPvU57k0ICz 6OEq0bIrJNvQpusVC59J8bd6lA60jK18zNZSsgrx816FUngYHg6v4R3Ib6bdOucf qkJNQ1dPyv/As0SQeC/JyKs5vB9/FBkgI3ZeySVxdAV3iZK8joGKOMxwRydfugv8 qmzFdMXJOXz7srWdKGVRxpIBAd3VZhXGlUeKjnKUP5cgzkcAhHom25C+d8lJbLjD e6LvPrKaWnmcq9LJCeTx =7WPN -----END PGP SIGNATURE----- --avToIbfo8huNQbuJ4ri1vOMS3ucaL5TsM--