3 ms·
Or you can generate pieces of code with non-embedded Python scripts at the earliest stage of make and inline them with the host language's preprocessor. This w
by okaleniuk 8y ago
Or you can generate pieces of code with non-embedded Python scripts at the earliest stage of make and inline them with the host language's preprocessor.
This way you'll have the same functionality but with standard tooling for every language. This means conventional debugging, static analysis, testing etc.
And no extra dependencies, too.
- nedbat 8y agoI'm not sure what you mean by "standard tooling for every language." Cog will work with any text file. Or do you mean that cog itself is non-standard?
- okaleniuk 8y agoNo-no, I mean if generating code is in a separate Python file, then I can debug it with pdb, I can profile it with cProfile, I can run Pylint on it, - all the standard tools. I like the idea of everything sharing the same file, too, but it does make working with Python part a bit more difficult. Also, with keeping it separate, the "every language" part comes up. It doesn't have to by Python if it's a separate code generator. Whatever suits you will work. You can generate code for C in C++. Or assembly in Common Lisp. Everything in anything.