Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

constexpr is a subset of what you can do at runtime. So my way of debugging is

#define constexpr

Which makes all the code plain code that executes at runtime, then you can put your couts and use your debuggers.

Its orders of magnitude simpler than dealing with template meta-programming.

constexpr_printf is the feature I want most of all. There is actually a patch for gcc that implements this.

I dont know how Jinja works, but the idea here is you do templating at runtime, but your templates get compiled down to a tree like DS at compiletime



Jinja compiles to Python which is then compiled to CPython bytecode and executed by the CPython VM.


I see - here the compile time data structure is converted into a tree at runtime and rendered.

I decided to use a runtime DS to allow things like splicing and looping templates etc.

It's also possible to make the runtime render the compiled time DS directly, which should be even faster if your requirements are simple enough




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: