Yes that's python vomiting some pure C++. Why because i am lazzy AF

  • 2
    clion ftw!
  • 1
    does it make sense?
  • 2
    @IllSlapU currently it generates 900approx lines of code for a factory.. we refactor daily so class name refactoring require this factory to be updated... And obviously I don't want any errors...
  • 4
    @zubin10 any way for c++ factory that gives class instance by name ? We have a module and we frequently update it .. add new classes and refactor stuff .. now we have our own scripting language which we use to load classes and use them .. this python code helps me to save painful time of updating the factory class in branch merge ... And it's auto triggers..
  • 2
    Don't mind me, but, if you want your code to jump through hoops like this, consider a major refactoring so all this is unnecessary, or rewrite your code in a language that has better support for what you want to do (if extreme flexibility then allow me to recommend Haskell. With TemplateHaskell it can be bent and twisted in insane ways).

    Plus, are you sure that you can't do what you want with C++ templates, runtime type information, or some sort of custom type system?

    What you have right now sounds like a system that could break any time.
  • 2
    @RememberMe the whole framework runs on both Android and iOS ... And we develop natively on Mac and Linux... So c++ is only way with native perfomance for mobile and server platforms .. i am also thinking of a major refactoring .. will probably load instructions through JSON rather than dedicated class ..
  • 3
    @RememberMe most of the code is for real-time systems that runs processing code through GPU (using OpenGL es) and some classes are very complex pipelines of GPU instructions... It's kinda very complex filters you will get in shadertoy
  • 0
    @kunaldawn I use self registering templates for this
Add Comment