Beta 4 Release Notes: Smart Ligatures and Performance gains

Smart Ligature support and increased performance

This release gets a significant performance boost for everyday code like modules, classes, functions, and tasks. It also introduces support for smart ligatures. Finally, it squashes a bug around macro usage. Read on for more details.

Smart Ligature support.

With this release we smartly support ligatures! Ligatures make your code easier to read at a glance by replacing multi-character combinations like >= or != with corresponding glyphs. It's more than eye candy it makes your code easier to grok.

For it to work you need to specific fonts that have multi width symbols added. Fortunately, JetBrains' IDEs support ligatures and ship with a compatible font called Fira Code.

Here is how smart ligatures look for SystemVerilog (Using the Pragmata Pro font). See intstructions below for how to enable ligatures!

Beta 4: Smart Ligatures, Performance gain and better macro parsing.

Ligatures work great for regular languages that use multi-character glyphs consistently. SystemVerilog uses the less-than-or-equal-symbol for both comparison and for nonblocking (and clocking) assignment. With this update, we suppress ligatures as needed for assignments.

JetBrains doesn't currently have an API to disable ligatures for code objects directly instead we, as suggested to us, trick the ligature engine to skip ligatures by making a non-discernable color change. Unfortunately, this means you need to do a one-time setup (for each color-scheme) to make it work.

So to enable please follow the ligatures setup instructions on our website

Performance

With this release, we focused on the performance when analyzing common code. The engine is three times faster than Beta 2 and 3 and over six times faster than Beta 6 when resolving statements as can be seen in the following example.

The most massive file we parse in regression is a generated 2.1MB, 53.000+ lines file from the Altera's tool suite. We use it to determine performance. The following table shows the time it took parsing the file for the different releases when running on battery power on a 2016 MacBook Pro. (Yes we support and like MacOs!).

Processing of ridiculous large file with 53.000+ lines of code on different releases. 

Processing of ridiculous large file with 53.000+ lines of code on different releases. 

The performance gain comes from optimizing the statement parser to find the correct rule faster. A problem with writing good code editors is that most of the time the source code is incomplete. With the code incomplete, it becomes essential to guess the intent and filter out other rules. With a large language like SystemVerilog, this is hard. With this update, we more aggressively combined similar statements rules into separate decision trees making it possible to reduce the number of possible rules faster.

Fixed macro argument issue.

Finally, we fixed an issue with macro usage parsing. Our engine would always parse for arguments even when the definition didn't have any. This lead to syntax errors. For more detail see the issue description.