You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A local Harper service that other programs on the machine can use
#4828
Hello, I maintain the Slovak data for Harper (sk-spell/harper-sk, #3658) and use Harper every day in Firefox, Chrome and Thunderbird and harper-ls in Kate (and I am trying to do something for Sonnet in KDE). Now each application is basically its own Harper and I am running into a resource problem that I think is worth discussing before actually doing anything.
Every integration today loads its own copy of Harper and its dictionaries. That seems to be fine for English, but the Slovak dictionary takes about 400 MB of RAM and four to five seconds to load and I assume other languages (if they come) will have the same problem. With three browser extensions and an editor open, I already have that cost several times over. KDE applications check spelling through the Sonnet framework, which loads a backend plugin inside every application process. A Harper backend for Sonnet that carries its own copy would mean one copy per open application.
My idea is a single Harper process that runs in the background, holds the dictionaries once and answers requests from other programs over a local socket. It would need two levels of requests. A simple one works word by word (is this word correct, what are the suggestions, add it to the user dictionary), which is all Sonnet asks for. A richer one checks a whole text and returns the full set of lints, which editors, LibreOffice (#1427) and Qt Creator (#3253) could use. The personal dictionary and the settings would then be shared by every program on the same machine, and later it could also run as a network server shared by several machines.
I looked at what exists. harper-ls in TCP mode accepts a single connection, and LSP works with whole documents rather than single words, so it does not fit as it is. Harper Desktop is much closer: its main process already owns the shared state (lint config, user dictionary, dialect, ignored lints) and the highlighter process talks to it over a small JSON protocol. Extending that main process into the service described above looks more natural to me than building something separate. It could also help Harper Desktop come to Linux, which #2316 asks for, and make system-wide checking (#4795) less dependent on each application.
I would like to know whether this is a direction you want for Harper, and if so, whether it should grow out of Harper Desktop or be a separate small program that Desktop and other integrations can use. If you see it fitting, I am happy to work on it upstream rather than keep it in my fork.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hello, I maintain the Slovak data for Harper (sk-spell/harper-sk, #3658) and use Harper every day in Firefox, Chrome and Thunderbird and harper-ls in Kate (and I am trying to do something for Sonnet in KDE). Now each application is basically its own Harper and I am running into a resource problem that I think is worth discussing before actually doing anything.
Every integration today loads its own copy of Harper and its dictionaries. That seems to be fine for English, but the Slovak dictionary takes about 400 MB of RAM and four to five seconds to load and I assume other languages (if they come) will have the same problem. With three browser extensions and an editor open, I already have that cost several times over. KDE applications check spelling through the Sonnet framework, which loads a backend plugin inside every application process. A Harper backend for Sonnet that carries its own copy would mean one copy per open application.
My idea is a single Harper process that runs in the background, holds the dictionaries once and answers requests from other programs over a local socket. It would need two levels of requests. A simple one works word by word (is this word correct, what are the suggestions, add it to the user dictionary), which is all Sonnet asks for. A richer one checks a whole text and returns the full set of lints, which editors, LibreOffice (#1427) and Qt Creator (#3253) could use. The personal dictionary and the settings would then be shared by every program on the same machine, and later it could also run as a network server shared by several machines.
I looked at what exists. harper-ls in TCP mode accepts a single connection, and LSP works with whole documents rather than single words, so it does not fit as it is. Harper Desktop is much closer: its main process already owns the shared state (lint config, user dictionary, dialect, ignored lints) and the highlighter process talks to it over a small JSON protocol. Extending that main process into the service described above looks more natural to me than building something separate. It could also help Harper Desktop come to Linux, which #2316 asks for, and make system-wide checking (#4795) less dependent on each application.
I would like to know whether this is a direction you want for Harper, and if so, whether it should grow out of Harper Desktop or be a separate small program that Desktop and other integrations can use. If you see it fitting, I am happy to work on it upstream rather than keep it in my fork.
All reactions