The other day, I found an old book (1988) with the title “LET’S BUILD A COMPILER!” by Jack Crenshaw. I loved the way it demystified the art of crafting a language from scrach. It’s like filling a gap between theoritical computer science papers and day to day programming.
So to cut the story short, I am thinking of making a language. Just for the fun of it. I don’t have illusions that this is going to be the next C#. I do this just to make me understand why some things in programming work the way they do.
So, which will be the characteristics that I would like this language to have? I have to admit that this is still kind of blurry in my mind. Let’s write one or two points to clear it out:
- It will compile into PHP! Strange thought, right? Well, I have my reasons. PHP is not only a language but also a virtual machine. Actually php files can be compiled into bytecode that will be executed by the engine. It’s like Java files are compiled into JVM bytecode or C# files are compiled into CLI bytecode. Except that there are many languages that target JVM (for example Scala) and many languages that target CLI (for example VB.NET, F# etc). PHP is a language with many flaws which is however ubiquitous. What if there was an alternative?
- It will be strongly typed. I have watched the battle between strogly and loosely typed languages for years and I see myself at the side of strolgly typed languages. My point of view is that, should there be a bug that the compiler can find, let it find it!
- It will have strong support on metaprogramming. I will explain that in a later post.
- I want to test things from an engineering point of view. I do not care either for performance or mathematical proofs.
- Syntactic sugar is importand. I want to make the language as DRY as possible.
Of course, all these are rather ambitious. All in all, I want to run my experiments and maybe gain some knowledge out of it.