I don’t believe a persistent interpreter should be implemented in kak.
There are just too many out there, all with their own special version of hell.
Imagine a persistent lua interpreter and how to stop each script/expansion snippet from trampling over each other’s global state.
The problem of “having to escape {}” is solved by kak itself, IMO: %sh{...}
, %sh(...)
, %sh[...]
,%sh|...|
are all the same to kak.
Simply pick one that does not conflict at the time.
The beenfits of declare-expansion
I see are:
- Efficiency
- Semantic clarity
Although, as said, I am not yet sure, both those benefits are large enough to warrant changing kak’s code.
I am not sure I understand the benefit here.
Would that mean, that files in PATH are not accessible anymore in shell expansions?
Is this to keep the plugin ecosystem clean?
Otherwise, where is the difference to an environment variable KAK_PATH
, that I manage myself?
Another idea to mitigate the “escape craziness” in kak meta-commands (commands emitted in shell expansions) is for us to only use the long string syntax (%{...}
, %#...#
) in those meta-commands.
That way one could always resolve conflicting escape characters *1.
It doesn’t help, that the %
is already meaningful in printf
, but hey … it is manageable.
@eraserhd Thanks for providing thoughtful push back. I appreciate the attitude of being careful with the accretion of features. Your suggestion reminded me of a blog post where someone outlined an idea of a programming language, that would basically store its state (stack, program counter, variables,…) as directories and files. 250bpm
*1: Except, when you write shell expansions, that return commands, that use shell expansions …