I'm a college student and I have homework in C++.
My professor wants separate hpp and cpp files for each C++ class. And it just didn't feel good how much I had to type, and how much I had to click to create two new files for every class.
I haphazardly put together a simple Python script that would read a single file and generate all the needed classes (the easy stuff like class name, list of members, and list of things to #include I sprinkled with syntactic sugar, but the hard stuff to parse like typenames and function bodies I copied and pasted for the most part, except my script pokes around in a very primitive way to qualify method signatures with the class name when it generates the implementation file).
And I felt pretty good about it.
But I realized, that if a lot of other people had worked on a similar problem in the past, they probably could have done it better.
I know that Chicken scheme translates to C, and so does vala and genie, but from what I understand, with these sorts of translators, you don't really have full control over the C output.
Do you know of any translators that output C++ that largely keeps the semantics of C++ intact, so that the output C++ files look handwritten, but the source language is just loaded with wonderful syntax that makes life easier? Maybe even have the language mess with the body of functions so that if I typed something like
vector<int> v = [1,2,3,4,5] it would become
vector<int> v; v.push_back(1); v.push_back(2); .. in the generated source? Maybe have braces automatically inserted based on indentation? Have newlines serve as semicolons?