From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: bug#24514: 24.5; Lispy backtraces Date: Sun, 4 Dec 2016 17:14:38 -0500 Message-ID: <233f14a0-7542-5d0c-d8da-209e7e5e54f7@gmail.com> References: <20160922231447.GA3833@odonien.localdomain> <98fbb582-3da4-bd83-a2e9-e341dd7f6140@gmail.com> <20160923075116.GA612@odonien.localdomain> <82e39377-f31b-698c-5a9a-343868686799@gmail.com> <20161202005226.GA4215@odonien.localdomain> <0a69afa7-e9e6-e75f-8e90-6438683db98d@gmail.com> <53ba4534-1ec3-4e4f-d929-1a72f79c1abe@gmail.com> <83mvgblniy.fsf@gnu.org> <143c480c-a9db-7053-4b70-175633197981@gmail.com> <83a8cbl94w.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wvWFWbTjcfIdwu6QwLGtfElFmoe7wtuQD" X-Trace: blaine.gmane.org 1480889732 10550 195.159.176.226 (4 Dec 2016 22:15:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 4 Dec 2016 22:15:32 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 04 23:15:28 2016 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 1cDf4B-0001bi-MR for ged-emacs-devel@m.gmane.org; Sun, 04 Dec 2016 23:15:27 +0100 Original-Received: from localhost ([::1]:35848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDf4D-0004Sn-RT for ged-emacs-devel@m.gmane.org; Sun, 04 Dec 2016 17:15:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDf3c-0004SX-GB for emacs-devel@gnu.org; Sun, 04 Dec 2016 17:14:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDf3Z-0002nU-8Q for emacs-devel@gnu.org; Sun, 04 Dec 2016 17:14:52 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.130]:64203) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cDf3Y-0002mi-VN; Sun, 04 Dec 2016 17:14:49 -0500 Original-Received: from [18.189.106.208] ([18.189.106.208]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.168]) with ESMTPSA (Nemesis) id 0MIjEq-1cFryx0mDY-002Drc; Sun, 04 Dec 2016 23:14:47 +0100 In-Reply-To: <83a8cbl94w.fsf@gnu.org> X-Provags-ID: V03:K0:TzdDzOYAxV09wvjfPBKR06jJYOToqe1hRVrKpdnXPw1lPslOIBy VULEY6ooQG5ixkIjpwArvASarR6tHkKAcnqwQJ3etPpglB8XUcm1233RX+oBKs6nIEvPJuo FNNZPFMSyCc379pmWR+W8XAuqp0gp4noyGxJgs+YObiW36KKHD0ToTm1hmQ8HE2PPkzHNcD IZnF620y2LBvRxqPVQNSA== X-UI-Out-Filterresults: notjunk:1;V01:K0:N12vKjU3q7Q=:Y5jU4mLygy4TNlMpf4EN1e 74lbFdJqRHYvnsN6l9JtyFYuIqIFSYFVc45/tI/gj4BvMd1hy3FxgIuf1LC8M27QpsyiBkfPt qKR42hJMGDTBtyyS0g0f8PMZfInWNNZN9cdw2Yk0YBob73pNjIoxMeez8SXYRbQi5BSAN/LiK 6bPrUgodCFG/DEr/XRDp7QStjgLYDiGmnRGCJ0tA42Trk0pz2z5WDysavuT+DVv47BRWGXPi0 pYcmVTU7jTpvY/fc2lU30qXttxLS6DoV7UEubCaVqyM8P/yiUefHgg0kmL9ANR81TDic0pypz 3rXwmV96krKZxfVjaJ8k5k9nLcttTSVgXxVdWHlKkygh0ylFXJJmAjMGCeYPcXwKVeNBr52hr B+HXksaFwdu5kD+Kdz3vFUXsIuxWsyJKOQjgOvAz6wEwp6dx4BqLY3UgAo/YYUHLGWAmkaMV7 o3nse7xOW/uJ8CO3epa41vYVHTbZYnQxuZx/WLsPiWdsgQNZBqr4yl4dd1lfw6a3zW3x3wekX KhjioteMA7JseFLmoyHbw/qYtZXxpk4L9V8uRScjkruOuPFl2T6IL7EDUkuh4kj5Pn0Jxhsp8 GA7p82wwpQTU6hqxeLJkX02QhtwEB+3415G2PDF7LCiUU7PrwftxCE2FIvtgEvHmJs6J8fuyB eEIVjUL5er17f/bNBRBwYNT1SnYlBpbna6N68OwIVj7ukO3Gnqrx9FCMF23b78iTNhYs= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.130 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:210036 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wvWFWbTjcfIdwu6QwLGtfElFmoe7wtuQD Content-Type: multipart/mixed; boundary="gc9Etmq01aILp0VnKwomw948vVJw5CwgT"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: Eli Zaretskii Cc: emacs-devel@gnu.org Message-ID: <233f14a0-7542-5d0c-d8da-209e7e5e54f7@gmail.com> Subject: Re: bug#24514: 24.5; Lispy backtraces References: <20160922231447.GA3833@odonien.localdomain> <98fbb582-3da4-bd83-a2e9-e341dd7f6140@gmail.com> <20160923075116.GA612@odonien.localdomain> <82e39377-f31b-698c-5a9a-343868686799@gmail.com> <20161202005226.GA4215@odonien.localdomain> <0a69afa7-e9e6-e75f-8e90-6438683db98d@gmail.com> <53ba4534-1ec3-4e4f-d929-1a72f79c1abe@gmail.com> <83mvgblniy.fsf@gnu.org> <143c480c-a9db-7053-4b70-175633197981@gmail.com> <83a8cbl94w.fsf@gnu.org> In-Reply-To: <83a8cbl94w.fsf@gnu.org> --gc9Etmq01aILp0VnKwomw948vVJw5CwgT Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2016-12-04 15:41, Eli Zaretskii wrote: >> Cc: emacs-devel@gnu.org >> From: Cl=E9ment Pit--Claudel >> Date: Sun, 4 Dec 2016 14:27:59 -0500 >> >>>> The C implementation of backtrace-frame seems to be linear in the in= dex of the requested frame, so a Lisp implementation of backtrace would b= e quadratic in the depth of the stack trace. Would a new function backtr= ace-frames that returns all frames at once be acceptable? >>> >>> But such a backtrace-frames function would have to be implemented in >>> C, right? And you wanted to move the implementation of "backtrace" t= o >>> Lisp, AFAIU. So it sounds like we will be replacing one C primitive >>> with another, or did I miss something? >> >> I think you're correct. It would seem good to have the flexible primit= ive backtrace-frames available, and it must be in C; then we can move bac= ktrace itself to lisp. >> >> The idea is that enumerating frames must be done in C, but printing th= em doesn't need to be done there. >=20 > So would it perhaps make sense to rename 'backtrace' into something > like 'backtrace--internal', and make it accept one more argument, the > function to apply to each frame, which is now hard-coded as 'prin1'? > Would that allow you to implement 'backtrace' in Lisp and also > implement whatever application you had in mind, by calling > 'backtrace--internal' passing it your own function instead of 'prin1'? Quite possibly! Are you worried about the cost of allocating a list conta= ining all frames?=20 IN any case, that would be consistent with the style of maphash, for exam= ple. And a variant of backtrace taking a callback would definitely make b= acktrace-frames easy to implement on the lisp side :) There's no big hurry on this, anyway: it's just that we recently added a = neat option to backtrace, and there were mentions of making the backtrace= buffer more useful in various ways, too. Cl=E9ment. --gc9Etmq01aILp0VnKwomw948vVJw5CwgT-- --wvWFWbTjcfIdwu6QwLGtfElFmoe7wtuQD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYRJVOAAoJEPqg+cTm90wjx4gQAJeQ/hF1VUZpYD/g5/lDLcI9 0gfwGp0sbeQ7iYlf1vLCxKRZDRED+0M9rSlzT+viObk9jBHbZ1z6hyxCd9nL3qjM Kw2scml2cUA2uoqrkeZL6izxHQo1pqGJq8cie5rOKuaw3JYj5ckBDZxj0Yld0isE 7WtwBspyKjavW3OQ+EOWIX764Mo1eej3FnMQReOSL2+CZ7zctPFJDHKM6pB95SfE knZCLcB0/9TgwQNYMeRDosKNLLqcqxnA2eew4PNSgwYq0Yf/JKqeBOVBHGQZDWP3 N1HcI3rW6r+4Wyl3SAKIJ4epugW3RhS2l1xojD5YROi2o8cyfCAEmR53fYzgPaEL s0WozZJpsQdvFm/q2DVfjWlx5zY82natFhhz4hYMX1zikxNX5w5Mb20NpnGBZJxE 4LlTSt14+6Y+4G0rbdJdsksVyPhJ8dH6P+0e++PH9jmDhJV2bhNjpJ9VKBad/LyU LeWViSV0GN9hQwfXZy65y1q0E/WgRS61FGqjmPuraS6Vb9JO/LwzlsK8/qynNAo/ jVWDw0UWXmt2LhqQgklDNDHULrlAyGKnPUJZoJThfF/JSf9WqpTPVe0X8h2I/s8a kl3zdSuCI0yMjcZOwrRdW3IXizhHrVs5NBZKHO6OVe4eauOJpwAzx6ZnmbcVPphA BzNilY6Y7tpM8j5y44WM =PALs -----END PGP SIGNATURE----- --wvWFWbTjcfIdwu6QwLGtfElFmoe7wtuQD--