Velvet is a programming language and compiler written in C++ using LLVM. The project was developed with the primary focus of learning the technology behind compilers and contains a start to finish process of compiling a source file into an executable. The language contains features such as variable typing, loops, comments, functions, and multidimensional arrays. Additionally, the compiler can print LLVM IR when compiling a source file, allowing easy debugging and comparison between existing compilers. A few sample programs have been written in Velvet to showcase its features, including a gradient descent implementation and a linear system solver.
The project was written purely in C++, and the build setup utilizes CMake heavily to integrate LLVM. Additionally, a basic visual studio code extension was created to make working with velvet sources files much easier. The language syntax is heavily inspired by rust, where blocks themselves can end with an expression to represent the value of that block.