Example of why Contachit is needed.
In the two screen shots below, you will see why Contachit is so desperately needed. The C++ code doesn't do anything special, it's just an
example of how modern code might look like in a source file.
The screen shot on the right, has arrows to indicate when the next statement to be executed is NOT the next line in the file. Red arrows
indicate the path when a logic comparison is false, or for "break" statements. Black arrows indicated when the function ends and/or falls
through to some other part of code.
As you can see, the actual logic of a function can get quite complicated with only a few lines of code.
That same function, written and displayed in Contachit.
The end result of Contachit
is C++ code (by clicking on translate button). However there are differences.
-
The syntax is different (better in my opinion).
-
Memory management. Contachit has 2 custom "smart pointers". One "owns" memory, and the other "views" it. You will
learn more about this later, but one amazing feature of this, is that Contachit KNOWS exactly how to auto-generate "copy/move
constructors" and "copy/move assignments". This is a huge time saver!
-
Contachit code only needs a single file, unlike C++ which splits declaration and definition into two files (.h and .cpp). The
files have ".ibp" extension.
-
Valid Contachit code is ALWAYS formatted correctly. When you save a file, it's re-parsed. As long as the file has no parse errors, it
automatically adjusts the code to be formatted correctly. The consistant use of the same white-space rules, helps ensure reading someone
else's code is not a hassle.
Yes (but probably not 100%)! I've created the concept of a "fake function" and "fake object", which serve as aliases for C++
functions/classes. Doing so, makes the Contachit parser aware of function/classes outside of your code, and at the same time
enforces Contachit syntax.
I've tried this out, and it seems to work, but I don't want to say there's 100% compatibility because I haven't used it
enough to verify this.
Watch some
example videos, then when you're done, click on the other "menu tabs" at the top of the page to learn more about Contachit.