Can I "program" TeX using C/C++?

I have a fairly complicated TeX programming (not typesetting) task, and I've skimmed the manual on TeX programming. However, TeX's... clunky programming syntax is less than ideal, and I'm wondering if I can achieve the same result in C (or even Pascal).

Thanks.

• Welcome to TeX.SE! You can use Lua with LuaLaTeX/LuaTeX ... Sep 14 at 22:50
• I'm fond of using C++ to create LaTeX code for \input into a larger document. (See elfsoft2000.com/worksheets/index.htm for example documents). Sep 15 at 1:35
• There is a perltex package which may get you closer to a syntax you may find familiar... Sep 15 at 4:07
• your question isn't at all clear and the answer depends on what you mean by "programming" There is no particular connection between tex and C but you can of course generate the tex code in C++ or any other programming language, either specific fragments or the entire document. The manual you link to isn't a manual on tex programming, just notes on quirks of tex programming when using a specific function plotting package (pgfplots) so it probably has given you a distorted view of tex. If you gave an indication of what you want to do perhaps someone could offer more specific advice Sep 15 at 6:41
• It is indeed possible to run compiled C code inside TeX: avremu. I never tried it myself though. Sep 15 at 9:04