Hello,

I'm interested in the possibility of concurrency as a well supported feature of 
Yi, since I view that as one the of primary limitations of emacs at present. I 
see there is https://github.com/yi-editor/yi/issues/513 which seems to indicate 
that there is some interest on the part of others. 

I'd like to hear if anyone has thoughts about what the semantics of such a 
thing would be. I am familiar with haskell generally but not concurrency 
specifically. 

The main issue that comes up in emacs discussions of proper concurrency (aside 
from dealing with legacy code and backwards compatibility) is how to handle all 
the heavyweight state of the editor (buffer contents, cursors, window-buffer 
relationships, etc).  Should they have exclusive ownership passed about between 
threads/coroutines, should they be totally open, free to mutate at your own 
risk? 

The benefits I see with some sort of ownership model is that it lets you write 
your code without that much mental strain, since if you have what you are 
interested in, then you can act on it freely. The issue (in Rust-ish 
situations) is controlling who has what when is just as complicated as the 
problem of safe shared access that you sidestep with ownership. 

The emacs-ish world of a single executing sequence that jumps between lines of 
work is generally fairly reasonable to make correct, but often leads to lag on 
the user end as typing a character has to wait for the current thread to yield, 
which it may not do immediately. 

Obviously pure computations can be done truly in parallel, but in my experience 
it's pretty rare that the thing you want an editor thread for is pure. Even 
switching to a different buffer to write some info (think display-time-mode in 
emacs) is enough to be noticeable in some cases. 

There might be some sort of happy medium where one allows data races on things 
like buffer contents, run concurrent things in parallel at least some of the 
time, and have each executor have its own cursor, active buffer, etc. That way 
at least if the user and the thread are typing in different buffers they should 
be largely unbothered (but info could appear when the user looks over at the 
other window, for example). 

Apologies for the ramble. Ill defined or not I've found myself wanting more 
than once for something like this in emacs (mostly in exwm), but the problem 
seems basically futile in a project that has that much inertia. Let me know if 
there is a model for this sort of behavior that would be reasonable, and if it 
is even remotely feasible in the current Yi code.

Thanks,
Thomas

-- 
Yi development mailing list
yi-devel@googlegroups.com
http://groups.google.com/group/yi-devel
--- 
You received this message because you are subscribed to the Google Groups 
"yi.devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to yi-devel+unsubscr...@googlegroups.com.
To view this discussion, visit 
https://groups.google.com/d/msgid/yi-devel/9hY-L3PpXFsqN9_BgkHLuHaiQ7LuUxlPrjCp3MMdayZ87oG-HmF4Bgfco1Rx8X0jF29gfnctna4uKEo7rZHvsclwpg6CEvcc2mtrzOUiDvQ%3D%40proton.me.

Reply via email to