Contributing¶
We welcome all contributions! If you would like to contribute to VAlgoLang, please see the corresponding guidelines and our code of conduct.
For a worked example on how to contribute to our repository, please read on!
Contribution Case Study: Adding Lists¶
To give you an example of how you can contribute to the repository, here’s a worked example of how we added the List data structure to the language, just by extending the existing constructs. Our hope is that the core data structures we provide can be used as building blocks to create other more specialised data structures, reducing the amount of effort needed for a contributor to extend our language.
In summary, resizable Lists are simply an extension of Arrays, both within the compiler and also in the Python library (i.e., when translated into executable Manim code).
The way we implemented Lists are as follows:
Extended the grammar (both lexer and parser).
Created a type for Lists by extending the Array type, but with the methods
prepend
andappend
(as well assize
, like arrays).Extended Arrays in the Python library to be able to animate these new methods.
Extended the linear representation with instructions that can be used to generate the Manim code from Step 3.
Extended the virtual machine accordingly, using the instructions from Step 4.
And that’s it! By relying on the existing constructs, we were able to add a new data structure to our language with minimal effort.
Full details are available in the corresponding Pull Request on GitHub.
Technical documentation¶
For those interested in contributing, a good source of information is our technical documentation of the compiler, written using KDoc and generated by Dokka. This provides more detail on the classes and methods within each stage of the compiler.