emacs-devel
[Top][All Lists]
Advanced

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

Re: Info: No GIL Multithreading strat for Python


From: Konstantin Kharlamov
Subject: Re: Info: No GIL Multithreading strat for Python
Date: Mon, 04 Mar 2024 19:30:32 +0300
User-agent: Evolution 3.50.4

On Mon, 2024-03-04 at 14:44 +0200, Eli Zaretskii wrote:
> > From: Arthur Miller <arthur.miller@live.com>
> > Lisp programs
> > can modify, introduce and remove shared state, and that is what
> > they do all the
> > time; and so can Python programs. I am not sure I following;
> > honestly, I am
> > probably thinking of something different than you there.
> 
> In Emacs, we have the current buffer and the selected window, and all
> of the global variables and symbols that exist in Emacs from the
> get-go.  A Lisp program cannot remove that state.

I'd like to just point out that a state that a program does not use is
not interesting in context of the comparison to Python. Python too has
an unsolicited global state a program may modify. In a module with no
imports you have __name__, __doc__, __builtins__… And you can modify
all of that.

What matters though is whether the code accesses that. An ELisp program
`(print "hello")` does not access anything, so buffers and stuff being
available doesn't matter.

P.S.: I sometimes wish Emacs had more functions avoiding mutating the
state. E.g. there's a frequent pattern of checking a regexp and
indentation at previous line, and every time it has to be wrapped to a
`(save-excursion …`, because you have to `(forward-line -1)`.



reply via email to

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