The future of the Vult language
In 2014 I started developing the Vult language. This was not my first attempt to develop a language/compiler for my audio experiments. Before that, I developed other projects that I never released but served as basis for the current language. Six years after, the Vult compiler is one of my most powerful tools that I use to create all my software and hardware projects.
The language, in my opinion, is very simple, easy to learn, and very convenient. It does help me to write concise code with less errors. But as with many open source projects, it lacks documentation what makes it a bit more difficult to adopt. The compiler has a few users that are doing cool things. One of those users is Hora Music who, as far as I know, has developed some of his projects using the Vult compiler.
This six years of development have been very interesting. I have expanded the language according to my needs. It often happens that I need a specific feature and I quickly add it in order to finish my current task. One of the problems that emerges (in practically all software) is that, when you write code in a hurry, sometimes the design choices one makes are not the best. My current code base is not pretty but it is fairly tested and it works. However, in my code design, I have taken a few shortcuts that have started to fire back.
To be clear, I'm pretty happy with Vult language. What has been giving me problems is the compiler code.
The compiler is written in my favorite programming language: OCaml. OCaml is a very nice language that provides a lot of features that help to write robust code. By robust I mean that the program runs without producing unexpected results, like crashes, errors or undefined behaviors. The OCaml compiler is so nice that it even helps you find bugs before running your program. The guys at Facebook have ported big parts of the Messenger code to Reason (an alternative syntax of OCaml) and they reported the following statement some time ago:
Messenger used to receive bugs reports on a daily basis; since the introduction of Reason, there have been a total of 10 bugs (that's during the whole year, not per week)!
If you are curious, OCaml (and Reason) definitely worth taking a look at.
Now going back to the Vult language.
I have hit a wall with my current code base. So instead of trying to fix the problem, I decided to start rewriting the Vult compiler.The result of this rewriting should be a simpler and safer code base that will help me to safely implement new stuff. So far, I have rewritten the new parser and it is looking sweet.
On the Vult language side, very few things are going to change. I'm aiming to have full backwards compatibility.
Some of the new (and planned features)
One of the parts that Vult language lacks is the availability of "complex" data types. This was a limitation I imposed at the beginning and now I'm starting to lift. At the same time, I'm making the type-checker (one of the most important features) a bit more flexible. The lack of composed types was covered in part by the Vult function system. Here you can see the new way of declaring types compared to what I needed to do before.
Both ways have advantages and disadvantages that I'm not going to discuss here. But it's nice having both alternatives available.
Other feature I want to add is the possibility of automatically capture and serialize/deserialize the state of my plugin. In the case of VCV Rack, serialization is used when the patch is saved. If the compiler can create the function automatically it would be great. In the example below, I'm marking the variable 'x' with the 'state' tag. When saving my patch, all the state values would be serialized. When loading the patch, the state values will be restored.
I have a long list of small things that I want to add. These are the ones I need in a shorter term.
How can you help
As I mentioned above, one of the big problems of the language is that my documentation is a bit sparse and incomplete. Currently there exists:
- Basic tutorials in the page: http://modlfo.github.io/vult/tutorials/
- References in the wiki: https://github.com/modlfo/vult/wiki
- A bunch of videos in my youtube channel: https://www.youtube.com/c/leonardolagunaruiz
I need help expanding the documentation. If any of you would like to help and at the same time, learning to use the Vult compiler please let me know. I can help you with that.
It is time to bring the Vult compiler to version 1.0.