The more complex programs I wrote the harder I realized that I am not fluent the way I would like to be. No matter how focused I was, how much I knew about the language, there was always either a cryptic syntax, missing feature just for my safety, or some kind of legacy design. Eventually I realized I was at the point I cannot any longer happily dive into new project because I could foresee all the struggle with this or that language. And how much fun is rewriting for the n-th time the same helper functions, because I did some web developing and now I have switched to statistics? Programming is no longer a joy for me — a passionate programmer — as it used to be!
You want something done, do it yourself — I had to design my own language.
I read several books about compiler design, in theory I could just start writing a compiler, but the truth was — I had no idea how to start. I could write anything, but I didn’t know what. Even such simple examples (simple now) like the one given in classic Wirth’s “Algorithms + Data Structures = Programs” were pure magic for me — how it was conceived? Where was it going? The pile of compilers books on my bookshelf was getting bigger, the list of features I wanted to have was longer and longer, but I didn’t make any real progress. Until Coursera happened — thanks to “Compilers” course by Prof. Alex Aiken (I cannot praise this course enough, enroll now) and his COOL language the spell was broken and I finally connected the dots.
At last I had the will and the skill (well…).
At first I rewrote entire COOL framework and compiler from Java to C#. But there was a catch — I couldn’t find any good lexer/parser suite for C#. It slowed me down, but not stopped for sure — I wrote my own suite. From this point I started changing working COOL compiler into working Skila translator — and this work continues as you read these words.
Since I cannot devote myself solely to Skila development I go with minimal plan — instead of writing pure compiler, I decided to write translator first. Here are the steps I envision:
- adding new features and writing translator to PHP at the same time (in progress),
- replace PHP translator with real machine code compiler.
All this should be done with as little philosophy as possible (see:
break in Scala). Same goes with cheap compatibility (see: C# arrays).
I hope the only time you find an obstacle in Skila is when you are about to write an incorrect program — besides that Skila should offer you nothing else but helpful, common-sense, features. You have the idea, you write it down in readable English, work done. The flow of the human mind is more important to me than toasting the CPU. I would like to have a language that could be used safely after 14 hours of non-stop work — there should be no room for stupid mistakes, and all the risky features should be available only if asked explicitly.
I don’t have a blueprint in my hand, what I do is scavenging. I took C# as the base language and removed all the parts that annoyed me while adding the ones I took from the other languages. And I let Skila evolve…