all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: arthur miller <arthur.miller@live.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Sv: Sv: Christmas wish: Literate Elisp
Date: Fri, 20 Dec 2019 15:50:29 +0000	[thread overview]
Message-ID: <VI1P194MB0429710752459DBA3082F614962D0@VI1P194MB0429.EURP194.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <jwvy2v7oxlw.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 5181 bytes --]

I really understand the concern, but I must ask how would one change the
elisp itself without re-implementing much or some of of elisp parser if it would
be done externally?

The read-eval loop is not exposed to elisp, so one would need to implement
own? Or am I missunderstanding? As I understand the elisps read-eval loop
is part of C runtime core, so if one would implement another parser on top of
it, it would mean some kind of preprocessor to preprocess elisp before it is
handled into elisp parser. Thisis only for read-eval loop.

I believe it would mean lots of work, and maybe less efficiency since it might
impose some extra copying/reading? I don't know, as I noted before I am not
that very wellacquinted with Emacs internals so I can't tell for sure. Personally
I don't care in which way it is implemented as long as the result is the same.

Just as a note about the C change and hooks and runtime support: the flag I
used lets me completely bypass the change to the "old" parser. Skipping
comment lines is hard coded into read-eval loop, so I have just hacked around
it, but if one would introduce some kind of modifiable read-eval loop with hooks
or I don't know what then it would probably need more C changes than waht
I did. Byte compiler would also need some change since comments are
hardcoded there as well. Also if one not introduce any change in byte compiler
and read eval loop, it might mean one would preprocess elisp source in some
hook, which might need extra loop through source file which is less effecient.

At least that is how I am reading the code, but I just started to hack it, so I might
be missing something. If one added a buffer-local flag instead of as I did a global
flag, then this could be that support in runtime to make it possible/easier to
support this. I don't know, I might be wrong, just as I see the code as of the
moment.
________________________________
Från: Stefan Monnier <monnier@iro.umontreal.ca>
Skickat: den 20 december 2019 16:00
Till: arthur miller <arthur.miller@live.com>
Kopia: emacs-devel@gnu.org <emacs-devel@gnu.org>
Ämne: Re: Sv: Christmas wish: Literate Elisp

Of course, this decision is not up to me, but I'll point out that
I think I don't think we should change the C code to or the
byte-compiler to directly support this new format.

I'd welcome changes that add hooks to make it possible/easier to support
such a format (and other formats like Org-mode), OTOH.


        Stefan


arthur miller [2019-12-20 00:55:29] wrote:

> Here is a little prototype to test my idea with literal Elisp.
>
> I have patched read-eval loop as stated in previous mail, in lread.c.
> It is probably possible to implement that in Elisp, but I don't have
> enough knowledge of either Emacs internals nor Elisp to do this in some
> short time. It would took me a lot of time to look up all the
> things I would need. Anyway, C code turned to be rather trivial, and also
> completely by-passable if so desired, so I have introduced a user-customizable
> variable 'emacs-lisp-allow-literal-comments', which is by default nil.
>
> I wasn't sure in which elisp file to introduce this variable, so I have used
> 'simple.el' found in lisp directory of Emacs source distribution. That file
> seems to have some other user customizable variables that affect elisp so I
> thought it might be appropriate place.
>
> For the byte compiler I have patched bytecomp.el, in rather brutish way, but it
> seems to work. It wasn't very difficult either, but I think I have done it rather
> ugly. Someone might wish to refactor that code. Anyway, it is less then
> twenty lines of code, and it is by default bypassed as well. The variable
> that controls it is also user customizable and found  in same file,
> named 'byte-comp-allow-literal-comments'.
>
> I have attached also a small trivial elisp file for illustration purpose.
>
> It is just a test of an idea, and small prototype to show that it might work.
> It needs more thorough testing and can probably be implemented in some better
> way.
>
> I have tested on GNU/Linux and Windows. Emacs was able to compile it's own
> elisp as well as external packages I use.
>
> As a note, the change in C is completely backwards compatible. No logical
> change to elisp parser happens when 'emacs-lisp-allow-literal-comments'
> variable is nil.
>
> ________________________________
> Från: Emacs-devel <emacs-devel-bounces+arthur.miller=live.com@gnu.org> för
> Jean-Christophe Helary <jean.christophe.helary@traduction-libre.org>
> Skickat: den 19 december 2019 02:50
> Till: emacs-devel@gnu.org <emacs-devel@gnu.org>
> Ämne: Re: Christmas wish: Literate Elisp
>
>
>
>> On Dec 19, 2019, at 9:42, chad <yandros@gmail.com> wrote:
>>
>> There is a large body of existing software which will be totally unaware of your changes.
>
> Although I think the premise of your comment is absolutely valid, I'm not so
> sure about the "*large* body of existing software".
>
>
> Jean-Christophe Helary
> -----------------------------------------------
> http://mac4translators.blogspot.com @brandelune


[-- Attachment #2: Type: text/html, Size: 10579 bytes --]

  parent reply	other threads:[~2019-12-20 15:50 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 15:45 Christmas wish: Literate Elisp arthur miller
2019-12-12 17:29 ` Stefan Monnier
2019-12-14  4:40   ` Sv: " arthur miller
2019-12-14 14:08     ` Stefan Monnier
2019-12-15  8:37       ` arthur miller
2019-12-16 12:01       ` Sv: " arthur miller
2019-12-16 13:41         ` Stefan Monnier
2019-12-16 14:02           ` Sv: " arthur miller
2019-12-16 16:07             ` Jonathan Leech-Pepin
2019-12-17  2:09               ` arthur miller
2019-12-17 11:06                 ` Adam Porter
2019-12-18 16:29                   ` Sv: " arthur miller
2019-12-18 18:49                     ` Adam Porter
2019-12-18 20:04                       ` Sv: " arthur miller
2019-12-18 23:18                         ` Adam Porter
2019-12-18 23:53                           ` Sv: " arthur miller
2019-12-20 15:58                             ` Unknown
2019-12-18 21:18                       ` Sv: Sv: Sv: " Stefan Monnier
2019-12-18 22:43                         ` Christmas wish: Literate Elisp (Intro) VanL
2019-12-19  0:05                           ` Sv: " arthur miller
2019-12-18 22:59                         ` Sv: Sv: Sv: Christmas wish: Literate Elisp Adam Porter
2019-12-18 23:18                           ` Sv: " arthur miller
2019-12-18 23:52                             ` Adam Porter
2019-12-19  0:02                               ` Sv: " arthur miller
2019-12-19  0:42                                 ` chad
2019-12-19  1:50                                   ` Jean-Christophe Helary
2019-12-20  0:55                                     ` Sv: " arthur miller
2019-12-20 15:00                                       ` Stefan Monnier
2019-12-20 15:50                                         ` Stefan Monnier
2019-12-20 15:50                                         ` arthur miller [this message]
2019-12-20 16:17                                           ` Sv: " Stefan Monnier
2019-12-20 16:34                                             ` Eduardo Ochs
2019-12-21  1:18                                               ` Sv: " arthur miller
2019-12-21  5:24                                                 ` Eduardo Ochs
2019-12-21  5:52                                                   ` Sv: " arthur miller
     [not found]                                                   ` <VI1P194MB042965777086C4466B7FF5EC962C0@VI1P194MB0429.EURP194.PROD.OUTLOOK.COM>
2019-12-21 15:29                                                     ` arthur miller
     [not found]                                             ` <VI1P194MB0429A123183C15AF8EC3956B962C0@VI1P194MB0429.EURP194.PROD.OUTLOOK.COM>
     [not found]                                               ` <jwv7e2pln3s.fsf-monnier+emacs@gnu.org>
     [not found]                                                 ` <VI1P194MB0429F37A29A2720037CAD9F9962C0@VI1P194MB0429.EURP194.PROD.OUTLOOK.COM>
2019-12-22  7:01                                                   ` Sv: " arthur miller
2019-12-20 16:51   ` Phillip Lord
2019-12-21  1:16     ` Tim Cross
2019-12-21  4:24       ` Sv: " arthur miller
2019-12-21  6:41         ` Tim Cross
2019-12-21  9:39           ` VanL
2019-12-21 14:17             ` Sv: " arthur miller
2019-12-14  4:16 ` Richard Stallman
2019-12-14  5:05   ` Sv: " arthur miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1P194MB0429710752459DBA3082F614962D0@VI1P194MB0429.EURP194.PROD.OUTLOOK.COM \
    --to=arthur.miller@live.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.