help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to tame compiler?


From: Stefan Monnier
Subject: Re: How to tame compiler?
Date: Sun, 02 May 2021 18:29:44 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> I know I sound like a broken clock, but [...]
> I think you would sound more like an unbroken clock if you would shortly
> tell the disadvantages of using `eval', then people would be more open
> to alternatives.

Code always starts in the form of a string somewhere, i.e. data, and
somewhere along the lines it gets transformed into something that can be
executed, i.e. code.

`eval` is one way to do that, but it's a quite restrictive, because it
doesn't give any opportunity to do something useful with the data
representation of the code before we run it.  I.e. it makes it hard to
compile the code to make it more efficient, it makes it virtually
impossible to give feedback about problems in the code (except for those
problems which lead to "hard errors"), and for the same reason it makes
it hard to provide any other kind of help in writing the code (like code
completion).

In the current context of Emacs, places that use `eval` tend to presume
that variables have names and that those names are significant,
i.e. they presume dynamic scoping, and for the same reason that it's
hard to provide feedback about problems in code that is passed to `eval`
it's very hard (both for tools and for humans) to figure out what needs
to be done in order for the code to work correctly in the lexical-scoped
dialect of ELisp.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]