Vale Server v1.8

Client updates, an action re-write, and more LanguageTool integration improvements.

Joseph Kato
3 min readSep 15, 2020

The latest development cycle for Vale Server focused almost entirely on in-editor performance with the specific goal of improving the on-the-fly linting experience.

Actions get a re-write

The first change you’ll notice in v1.8 is that the action-processing engine has been completely re-written from Python to Go, incorporating many performance enhancements along the way.

A comparison of action response times between v1 (Python) and v2 (Go).

Overall, the re-write allowed Vale Server to see an average decrease in response time of around 80.6%.

In addition to the performance gains, the new action-processing engine is going to see a number of general purpose feature additions in the next few releases — including the ability to manage Vale versions on a per-project basis and the introduction of a brand new “document score” metric.

Context-specific linting

Vale Server’s client implementations for Visual Studio Code, Sublime Text, and Atom all saw recent releases that introduced a new “context-specific” linting mode.

The new mode allows users to opt into only having Vale Server run on the active paragraph.

Vale Server’s settings page in VS Code.

It also allows the user to define what exactly a “large” file is for themselves according a specific number of lines, meaning that they can choose to use a combination of linting strategies: complete linting on most files and contextual linting on particularly large files.

Re-thinking the LanguageTool integration

Since its initial release, Vale Server has included the ability to incorporate results from LanguageTool, a popular open-source grammar checker. The latest release takes this integration to the next level.

LanguageTool and Vale Server complement each other quite well:

  • LanguageTool provides a large (over 4,000) library of English grammar rules, but lacks any out-of-the-box understanding of markup syntax;
  • Vale Server provides a high-level API for creating custom style-focused rules while also offering sophisticated understanding of many popular markup formats (Markdown, AsciiDoc, reStructuredText, DITA, HTML, etc.)

In past releases, the biggest problem with this integration was LanguageTool’s performance on large files (which is significantly slower than Vale’s). For example, consider these processing times on a 2,800-line file from the open-source book You Don’t Know JS:

Processing time of Vale vs. LanguageTool using typical configurations using a MacBook Pro (2.9 GHz Intel Core i7; 16 GB 2133 MHz LPDDR3).

Of course, this isn’t to say that LanguageTool is poorly designed; its grammar-focused rules require much more intensive processing than Vale’s style-focused rules. But the problem remains: 30 seconds is way too long of a wait in an on-the-fly linting environment.

A managed server

Vale Server’s new ‘Extensions’ page

The latest Vale Server release includes the ability to run an instance of LanguageTool’s HTTP server in the background. The major difference between this and the previous integration technique is that we’re able to show results incrementally. The idea behind this is pretty simple: instead of waiting for LanguageTool to do all of its work prior to showing any results, we show Vale’s results first and then show LanguageTool’s when they become available.

The exact behavior of this functionality can be controlled with a new configuration option, ProcessTimeout, which controls how long Vale Server will wait for results from its extensions before moving them to the background.

In general, the default value of two seconds should work well for most files: averaged-sized files will show all results nearly instantaneously, while the largest files will show Vale’s results immediately and then all results shortly thereafter.

Going Forward

The next development cycle will shift the focus from the local environment to the web, with a number of improvements and enhancements planned for the Google Docs and Chrome extensions, as well as the built-in dashboard.

Stay tuned for details!

--

--

Joseph Kato

An open-source software developer with interests in natural language processing, data science, and collaborative writing. More @ https://github.com/jdkato.