From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: How to tame compiler? Date: Sat, 1 May 2021 19:19:48 +0300 Message-ID: References: <875z03th9b.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24018"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.6 (2021-03-06) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 01 18:24:35 2021 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 1lcsPz-00068H-Lc for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 01 May 2021 18:24:35 +0200 Original-Received: from localhost ([::1]:57852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcsPy-0007Mf-NV for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 01 May 2021 12:24:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcsPL-0007JA-Ov for help-gnu-emacs@gnu.org; Sat, 01 May 2021 12:23:56 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:48073) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcsPD-0000z3-GN for help-gnu-emacs@gnu.org; Sat, 01 May 2021 12:23:55 -0400 Original-Received: from localhost ([::ffff:154.231.162.22]) (AUTH: PLAIN securesender, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000046239.00000000608D8090.00006725; Sat, 01 May 2021 09:23:44 -0700 Mail-Followup-To: Stefan Monnier , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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:129286 Archived-At: * Stefan Monnier [2021-05-01 16:39]: > > I have to understand it in this example: > > > > The HTML template is following and it is string: > > > > > > > > ⟦ xml-escape title ⟧ > > > > > >

Today is one US dollar this many euros: ⟦ usd-eur 1 ⟧

> > > > > > I think the way I'd attack this is similar to what was suggested > recently. I think I'd introduce a macro (call it `xml-template`) which > you'd use maybe as follows: > > (xml-template > (html > (head (title ,title)) > (body (p "Today is one US dollar this many euros: " ,@(usd-eur 1))))) > > where `,` is used to insert a random chunk of plain text, > whereas `,@` is used to insert a chunk of XML. Approach is known to me from, is it Scribilo? https://www.nongnu.org/skribilo/ and Skribe https://www.nongnu.org/skribilo/#self I use similar approach for CGI document generation. My system does allow such inclusion as I can introduce any type of document. But let me think: - HTML template would need to be converted into sex-pressions; (don't stone me); it would increase the startup time of preparing the template, there are just 127 templates in the database; - then Markdown documents, what I do with it? Maybe all of 4057 should be converted into sex-pressions... with very careful attention to detail; - then Markdown is not any more Markdown, it would still need to be expanded by Emacs Lisp; - then everything expanded embedded into HTML as Emacs Lisp; Problems with the process: - it is not readable any more; - becomes tiresome, much more work is involved to write simple text; HTML template preparation alone involves programming skills; not easily scalable; - it becomes very much error prone, one mistake and all page will not interpolate; - author, who only slighly was thinking about the markup, has now to go back into thinking harder about the markup, instead of just writing text, author has to mark it up with (p "something") or similar; author is not any more in the "lightweight" markup as described here: https://en.wikipedia.org/wiki/Lightweight_markup_language That approach would be definitely usable for: - specific pages where large need arise for interpolation; - with complex code where a lot of interpolation is taking place -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns Sign an open letter in support of Richard M. Stallman https://stallmansupport.org/ https://rms-support-letter.github.io/