[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs design and architecture. How about copy-on-write?
From: |
Emanuel Berg |
Subject: |
Re: Emacs design and architecture. How about copy-on-write? |
Date: |
Fri, 22 Sep 2023 23:14:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eli Zaretskii wrote:
> It is impossible in Emacs to write a useful Lisp program
> that doesn't rely on global variables and other parts of the
> global state. You can only write toy programs without that.
Lisp programs are not toy programs just because they don't use
global variables. One can reduce the reliance on global
variables to a huge degree with various methods. But that's
another discussion.
Because, if one is unallowed to break existing code
implementing an envisioned multi-threaded, multi-core model
one would have to deal with them, and it would then not matter
if they are few or if they are many in that regard.
But note that such a solution would favor any program that
would minimize their use, since those would have much less
overhead to deal with them, obviously. That, however, is
a good thing as it would favor a sound programming style that
minimize their use.
Again, first one would have to agree on a model how things
would work. Say that we go for the idea that each thread has
a superstructure of local variables, that would be accessible
as if they were globals. In a way, this would not be unlike
lexical `let'-closures which can also be used as if they were
globals, and that is one of the use cases of that method BTW.
Second, one would have to identify all Lisp constructs that
interact with the global state. Without changing how those are
used, one would have to think - what do they mean in the new,
thread model? Of many possibly interpretations, which ones do
not contradict how they were previously used?
This will have to be done on a case-by-case basis. One could
start with the most obvious cases, i.e. `setq', `setf', `let',
and so on.
It sounds like a lot but actually don't have to be that much.
Because first, there are a limited number of such constructs.
Second, even tho in terms of implementation it would have to
be done case-by-case, if one can identify a good way of
solving it for on such case, it is likely that method can be
brought over to the rest quite easily.
--
underground experts united
https://dataswamp.org/~incal
- Re: Emacs design and architecture. How about copy-on-write?, (continued)
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/20
- Re: Emacs design and architecture. How about copy-on-write?, Emanuel Berg, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Ihor Radchenko, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Ihor Radchenko, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Emanuel Berg, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, tomas, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Emanuel Berg, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?,
Emanuel Berg <=
- Re: Emacs design and architecture. How about copy-on-write?, Ihor Radchenko, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Ihor Radchenko, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Dmitry Gutov, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Dmitry Gutov, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Dmitry Gutov, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/20