From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: dynamic reload of dynamic module not dynamic? Date: Tue, 19 Apr 2022 13:08:21 +0200 Message-ID: <874k2pwct6.fsf@zoho.eu> References: <87o810mic0.fsf@zoho.eu> <22BE2D29-B50B-4164-B0AC-4BDFA62A20EC@gmail.com> <87lew3lb94.fsf@zoho.eu> Reply-To: Emanuel Berg Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16065"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:DsjzuZnaVrUjRlJ+BLIuXUduJN8= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 20 18:40:41 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1nhDNh-0003yS-4v for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 20 Apr 2022 18:40:41 +0200 Original-Received: from localhost ([::1]:51092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhDNf-000892-Op for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 20 Apr 2022 12:40:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nglim-0001cV-JX for help-gnu-emacs@gnu.org; Tue, 19 Apr 2022 07:08:37 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:52820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nglik-0001ct-Ed for help-gnu-emacs@gnu.org; Tue, 19 Apr 2022 07:08:36 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nglif-0006ia-9T for help-gnu-emacs@gnu.org; Tue, 19 Apr 2022 13:08:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 20 Apr 2022 12:24:51 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136973 Archived-At: tomas wrote: > This is not completely trivial. Parts of the application may > have become dependent on the loaded library. [...] I don't see how that is any different from eval'ing a Lisp function, if something else uses it and the new version don't do what the old did it sure won't happen (or fail, if you change the interface which you should always change with care anyway). Or introduce another bug. But how would it else be, dynamic update of code which only works when the updates makes sense? > Just imagine your application storing a pointer to some > function in that DL. You remove it, the address space > becomes free and is replaced by something totally different. > The above code calls into this pointer and... kaboom. > You literally pulled the rug from under your poor > application :-) What we are imagining is rather a change that made sense so the poor application can have its own rags to riches story ... > Now you would say you wouldn't ever hoard pointers to random > library functions, but that's exactly what the dynamic > loader is doing for you. You mean like this? https://dataswamp.org/~incal/emacs-init/random-urandom/random-urandom.c > Not saying it's impossible, but that it's trickier than it > seems. Most of the time you'll have to live with several > incarnations of "some functions" because your "old function" > refuses to die. Most applications choose to restart. Tricky but maybe it can be made simple, look 1. a uses b, what happens is b 2. b is edited (let's call it b' just to denote the change) 3. a uses b, what happens is b' ? -- underground experts united https://dataswamp.org/~incal