From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Emacs design and architecture (was: Shrinking the C core) Date: Fri, 15 Sep 2023 18:10:50 +0300 Message-ID: <6357c74b-222b-9d80-2c58-ebf4c13f130d@gutov.dev> References: <873503y66i.fsf@yahoo.com> <87fs3ur9u8.fsf@dataswamp.org> <875y4moiiq.fsf@dataswamp.org> <83r0n4rj78.fsf@gnu.org> <83cyynpmvd.fsf@gnu.org> <838r99mh40.fsf@gnu.org> <83h6nwlmt4.fsf@gnu.org> <456d12ac-ecf4-3de4-56bb-a2440580777f@gutov.dev> <83a5tokmsv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1495"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: owinebar@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: Yuri Khan , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 15 17:12:25 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qhAUa-0000Dn-2X for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Sep 2023 17:12:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhATQ-0007Ad-4i; Fri, 15 Sep 2023 11:11:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhATD-0006kk-NM for emacs-devel@gnu.org; Fri, 15 Sep 2023 11:11:00 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhATA-0002cU-LJ; Fri, 15 Sep 2023 11:10:59 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 837045C0126; Fri, 15 Sep 2023 11:10:54 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 15 Sep 2023 11:10:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694790654; x=1694877054; bh=r99o5rBUIVsGv7ddsgHr8CuPuixU52aw1qB PE6C1g7s=; b=oGdOn7uhnbS7JHlHvxEsB8C+Da7+Sw2YdZXBeGocStHn2+kZfcZ HRTSIbjQWBbc+sXB5ktOaIb/ZMOKCb6JQ3gPuq82X7AN2ujEzbk0QX8smRvPy9xv WpRIfimzk7eGYSzSDqNm+Assxj18bdrdV2aX/lukTnI6rJCmYzAJqgFQF+ItPHvM 0K5iYgIjbu+SXdxrC1ddh+KwiVoHqVujn0NZu/hjEwsbiFz8NUpuD6+aeizE4Ge5 rD3UpEQOQQt68U9UBCwbSM0J9/Y/6kTfaivwQ3Am9Re6zxN7q47xcN9K3ztZ+KuJ zJxaDWnJkCA+2PY7BlP9bJPjBiPTN9p0lnA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1694790654; x=1694877054; bh=r99o5rBUIVsGv7ddsgHr8CuPuixU52aw1qB PE6C1g7s=; b=FIiDlWZAdEJKjIryBKbiTjv5zpIYVpnRItG3KJgLZd9dk7ZVL28 C2dEUiaiOHi6/NtTYBmKwMiQo7Z8qjbt05WxtQQlinjrIj9lgfHPYCil4NRnKCJ8 M4uBYXVDP03eIJUGFyF4fT8bwcHSuhQ53ytdOARl9bSNqoGVd41lRu3P0qLyKv9U P8CQQOdjbye/5ouRi7q15E1UuagXrgKjNURIY4mMpV0yZomE1CQ5l+gvGCclQQtK SyY9bPRSPYU1h1guQpCSBlsj4F78+LouQoENNm3CxI0zOLsdzTxsKIz0W5wYzf2n JcpfinQUaERfGngd4tlUp1v/X8ZyrCinvOA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejvddgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteeukeehtdevleejvdetlefhfeeigedtfeekveejgeetuddtheefudetvdeg vddunecuffhomhgrihhnpegvlhdrihhnnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 Sep 2023 11:10:52 -0400 (EDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=66.111.4.25; envelope-from=dmitry@gutov.dev; helo=out1-smtp.messagingengine.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.473, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310599 Archived-At: On 15/09/2023 09:51, Yuri Khan wrote: > On Fri, 15 Sept 2023 at 12:51, Eli Zaretskii wrote: > >> One of the important aspects to keep in mind in this regard is that >> Emacs must give Lisp programs dynamic control of how stuff is >> displayed, and should be able to exercise that control at high >> frequency (a trivial example: pulse.el). > > In CSS, this is solved in core with transitions. A style specifies > that a certain property will change gradually, provides its target > value, the transition duration, and a transition curve. The styling > engine does all the work about calculating the intermediate values and > re-layouting each intermediate frame; the page author does not have to > script carefully timed property changes, and is in fact discouraged > from doing so because doing that in Javascript incurs CPU and battery > usage overhead. There are different ways to do it, but the classical correspondence to what pulse.el does is to use JavaScript, which would trigger on a timer and modify the DOM tree, exactly how pulse is triggered on a timer and updates the overlays in a buffer. It's fast enough, and the JavaScript-based animations had reached more complexity than what we do with Emacs. It's just that the web sites have been getting more complex and complex over the years, that doing many of those animations is costly for battery and can bring the frame rate down (along with many other tabs being loaded at the same time). TBH, I can't think of many existing animations in Emacs that would be well-served by CSS animation instructions. Maybe just extra eye candy like exploding cursors. > The use case of pulse.el would be translated to a couple of styles > that say effectively “A pulsed span will instantly gain yellow > background” and “A non-pulsed span will linearly revert to whatever > background it had over the course of 200 milliseconds” and a small > function that sets the span to pulsed and then immediately to > non-pulsed. That's also an option, but that seems to depart from making a good comparison between systems. It's not like anybody is thinking of implementing animation instructions in the display engine, are they? The closest stuff to CSS that we have are stuff like 'display' and 'invisible' properties, as well as display specs like :width, :align-to, :height and (slice ...). > (Implementing a CSS engine over a character terminal is a nontrivial > matter though.) I don't know, if such engine is limited to a rectangular canvas of rows of characters, that would work more or less the same as it does not.