News for hackers. Stuff that matters.
Re:An Introduction to Reflection in C++ by dasloop on Saturday April 15, 2017 @01:33PM (#14121749)
What I want is a language over C++, as typescript is over JavaScript, that keeps compatibility with C and C++ code (Qt, boost...) and provides a clear syntax and some advanced features (as reflection) even paying a price for it. This is it, no more zero cost abstraction.
Re:An Introduction to Reflection in C++ by mabynogy on Saturday April 15, 2017 @03:28PM (#14122382)
I'm doing that but it's more a CoffeScript than a Typescript (no semicolons and no commas).

An example:

    fn add(x1 x2)
    {
     return <x1+x2>
    }

    fn <main>(count:int arguments:<const char** const>):int
    {
     (<printf> "%d\n" (add 2 3))

     return 0
    }
Is converted to:

    auto add(const auto x1,const auto x2)
    {
     return x1+x2;
    }

    int main(const int count, const char** const arguments)
    {
     printf("%d\n",add(2,3));

     return 0;
    }
Everything inside the <angle brackets> is left as is in the C++ output.

I use S-expressions for function calls.

Re:An Introduction to Reflection in C++ by smitherfield on Saturday April 15, 2017 @03:37PM (#14122447)
Re:An Introduction to Reflection in C++ by DerDangDerDang on Saturday April 15, 2017 @05:31PM (#14122960)
The closest thing I can think of would be the subset of C++ used in Stepanov + McJones' Elements of Programming, with the addition C++11 stuff like lambdas and std::function, plus (hopefully) C++20 stuff like compile-time reflection, concepts and ranges.
Re:An Introduction to Reflection in C++ by NotSammyHagar on Saturday April 15, 2017 @02:06PM (#14121917)
That is a great idea and great metaphor to describe your new language.
Re:An Introduction to Reflection in C++ by lossolo on Saturday April 15, 2017 @01:46PM (#14121813)
Like D?
Re:An Introduction to Reflection in C++ by dasloop on Saturday April 15, 2017 @02:40PM (#14122105)
No, D is a separate language. A bit too much. Ideally you will be able to move between a version of the language or another at Class level to alllow a incremental migration of the code that must be "modernized".