New parser for better code intelligence
GVls was developed time ago to provide plugins to source code editors, in order to improve the experience of Vala developers. One of the main issue was the libvala source parser, because it uses GStaticPrivate
, which is deeply used in the compiler and may be is a big a memory eater when used on highly threaded environments, like GVls's compiler running multiple times in different threads, each time eating more and more memory, until the main thread is done.
Also, when #688 was filed there is an interest on extensibility of the parser to help Vala to "learn" new code syntax, but the real issue here is how we can offer a compiler that can provide lot of information to Language Servers, to help code analytics, code indexing and more features rich new opportunities for Vala.
Vala is a powerful tool for GLib/GObject developers, because there is not any other language out there providing the same level of productivity, thanks to its syntax.
Create a new parser, may is out of the scope of Vala and libvala, because requires to develop a new parser with different architecture, potentially fat, but providing the following new features:
-
Thread save using GLib/GObject classes for code -
Code Indexing on writing -
Plugin system, to more powerful code analyzer, debugger, code indexing on databases -
Helper for Language Servers to provide more intelligence -
On line parsing/compiling, like a Python shell
The use of GStaticPrivate
is the main issue here, at least for GVls, because GVls' server was unable to parse on realtime the code written by the user, because it runs multiple threads to construct the code tree and indexing it, but the memory was increased each time CodeContext
is used to parse a new code change. Because this was too deep in the Vala's compiler code, is really hard to remove GStaticPrivate
deprecated dependency.
So I think a new parser should be developed to remove dependency onGStaticPrivate
and push ahead Vala code development to new levels, by helping to produce feature rich language servers.