Cj - a new programming language
Everyone stood waiting, what kind of idea? The idea is to write your own programming language!
A sigh of disappointment, 99% threw their computers out the window, but for those who stayed, I will continue.
I have always been interested in various areas and the web, I want to sell mobile and desktop and something server ready to write, I’m also interested in AI, games, robots, cryptocurrencies ... And at the same time, I would like to write all this in one language).
I looked towards C ++, C #, Java, Javascript and even Python, but everywhere I didn’t like anything ...
So, everything is decided, I am writing my own programming language. Combine powerful C ++ with lightweight Javascript and call it Cj!

We begin to come up with the syntax of the language
When describing variables, I propose to give the possibility of immediately indicating the type of a variable in C ++. To describe an automatic variable, we use, as in C ++, the word auto, or do not specify, as in Javascript, the data type at all.
int a;
auto b;
c = 5;The same rules apply to the description of functions:
int sum() {}
auto sub() {}
mul() {}See how convenient and concise! If the name has brackets (), then this is a function, you do not need any functions, as in Javascript, but it is not necessary to specify the return type!
So far enough, the full specification for the language can be found here: sitev.ru/post/163
Choosing a tool for writing a compiler
Of course, I immediately ran to read articles about LLVM. But after reading a couple of statues, I became bored and sad. The brain was tired, since it was time to sleep. Waking up in the morning, I already knew the solution to this problem: no 4 letters, I write strictly in C ++! I’ll write my lexer, parser, etc. ... I’m so interested, and in addition, at the output we get our simple analogue of LLVM!
Syntax diagrams for Cj
I tried to write the code immediately according to the specification, but I was constantly confused, rewriting. Yes, and why? If there are syntax diagrams of Wirth. It is necessary to describe the syntax visually, and then translate it into code. Let's quickly sketch these diagrams.
A program is a block of code that consists of statement (instructions).

The main code main_block_code is different from the nested {}. There will be different charts for them.

Function processing is a function call and description. The call is simpler: the

description is a bit more complicated:

And yes, we forgot about the variables and how they and the functions will participate in the expression:

It remains to write the compiler
Evil languages will start to ulcerate: well, well, write now your compiler. But I already wrote (generates a source for JavaScript).
An example in Cj: And here's what it turns out in Javascript:
int my_func1(int p) {
int a;
a = 5;
}
my_func1();function my_func1(p) {
var a;
a = 5;
}
my_func1();Of course, the language has only implemented the most basic features. What can I say, it does not even describe the if statement! And the compiler will most likely crash. But still ahead, as they say: dashing trouble began!
I uploaded the source code to Github , but the binary .
We look, test, join the writing of a new programming language Cj!