Story
Psdc meets a need. That of automating the tedious task of translating programs between different programming languages.
During my BUT Informatique training, I learned algorithms with Pseudocode, a pseudo programming language invented for the needs of the IUT of Lannion. Inspired from Pascal, Pseudocode allows an algorithm to be stated in a language closer to that of humans than to that of computers, while keeping the exhaustive aspect of any programming language.
During our practical work, we very often had to translate pseudocode programs to C. This task is quite daunting, hence my desire to automate it. And that’s what led me to discover compiler design.
As an example, here’s a simple pseudocode program that prints Hello
to the screen:
programme AfficherBonjour c'est début
écrireÉcran("Hello");
fin
Here is an equivalent program in C:
#include <stdio.h>;
int main() {
printf("Bonjour\\n");
return 0;
}
How do you automate this transformation? Well, it’s actually not that complex. The Crafting Interpreters book[1] metaphorizes the problem as climbing a mountain:

Let’s start with the original source code, at the foot of the mountain. As the steps go by (scanning, parsing, analysis), the representation of the code becomes more and more high-level, that is, it focuses more on the expressed semantics than on implementation details.
Once the top is reached, we are halfway through the compilation. We have a breathtaking view of the semantics of the code, that is, the meaning that the user gives it through the syntax of our language.
So let’s begin our descent. Let’s successively convert our high-level representation into forms that approximate our final goal: the machine language, which will be executed directly by the processor.
I only discovered Crafting Interpreters quite late in the project. I originally based it on the playlist Creating a Compiler[2] by Pixeled on YouTube, where we see the design and implementation of a compiler for a language ex-nihilo called Hydrogen. The compiler transforms the code into assembly, then uses NASM to generate the machine code.
It is in these videos that I learned the basics of lexical analysis[3], formal grammars[4], or syntactic analysis[5]. It is really interesting and I’ve learned a lot.
This project is far from being done — many features are yet to implemented, notably for VS Code integration with a language server.
