From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: Sv: Sv: Christmas wish: Literate Elisp Date: Tue, 17 Dec 2019 05:06:45 -0600 Message-ID: <87r213qkhm.fsf@alphapapa.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="169024"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 17 12:07:32 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ihAhM-000ho8-Bk for ged-emacs-devel@m.gmane.org; Tue, 17 Dec 2019 12:07:28 +0100 Original-Received: from localhost ([::1]:39076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihAhK-0000H1-S3 for ged-emacs-devel@m.gmane.org; Tue, 17 Dec 2019 06:07:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39729) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihAgu-0008JN-PH for emacs-devel@gnu.org; Tue, 17 Dec 2019 06:07:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihAgt-0007mR-KV for emacs-devel@gnu.org; Tue, 17 Dec 2019 06:07:00 -0500 Original-Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:57172 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ihAgt-0007mC-Dt for emacs-devel@gnu.org; Tue, 17 Dec 2019 06:06:59 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1ihAgp-000hDh-W4 for emacs-devel@gnu.org; Tue, 17 Dec 2019 12:06:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:243435 Archived-At: arthur miller writes: > It is true, that keeping directives in comments does not break the > existing parser, but then it is not so much of literate programming, > is it? Literate programming is not a matter of syntax. For example, this summary in the Wikipedia article seems to describe it well: Literate programming is a programming paradigm introduced by Donald Knuth in which a computer program is given an explanation of its logic in a natural language, such as English, interspersed with snippets of macros and traditional source code, from which compilable source code can be generated. The literate programming paradigm, as conceived by Knuth, represents a move away from writing computer programs in the manner and order imposed by the computer, and instead enables programmers to develop programs in the order demanded by the logic and flow of their thoughts. Literate programs are written as an uninterrupted exposition of logic in an ordinary human language, much like the text of an essay, in which macros are included to hide abstractions and traditional source code. Literate programming (LP) tools are used to obtain two representations from a literate source file: one suitable for further compilation or execution by a computer, the "tangled" code, and another for viewing as formatted documentation, which is said to be "woven" from the literate source. While the first generation of literate programming tools were computer language-specific, the later ones are language-agnostic and exist above the programming languages. None of that requires un-prefixed comment syntax. Consider examples of actual, full-scale literate programming projects, which are written in a variety of languages and source code formats. > If we would just use directives in comments then we already have org + > babel. But I think 4 extra lines of C code to enable this feature in > eval-loop was a trivial price to pay :-). Changing the canonical parser of a widely used language would have effects reaching far beyond the parser's native software. Consider all other software which parses Elisp, e.g. syntax highlighting tools outside of Emacs, which would not correctly highlight these un-prefixed comments you propose. As well, consider other implementations, like Guile's, which would also have to be adjusted. Then consider all the code linting tools which would likely need fixing. It's not merely a matter of 4 lines of code in an Emacs source file. As has been mentioned, benefits such as outlining are easily achieved with existing tools, some of which are even built-in to Emacs (e.g. outline-minor-mode for simple outlining in Elisp files, and org-mode for prose-first, noweb-style source files). Are you really so concerned about omitting a semicolon at the beginning of top-level comment lines that you want to change the Elisp parser?