Is it possible? Dumping preprocessor state at end of output so that preprocessing can be resumed?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing Boost.Wave's context state and preprocessing entry points, focusing on which state the issue proposes to represent as #defines or #pragmas. Determine whether that state can be dumped and restored for a later preprocessing pass; done means a documented feasibility result and usage path, or a clearly scoped implementation plan.
Written by the indexing model from the issue text.
Description
Context
A bit of context to what we're doing.
We have a header-only library of HLSL (shading language resembling C++), where we use Boost Preprocess (BOOST_PP) to get around some ecosystem issues (lack of variadic templates, injecting a bit of reflection, etc.) and most fundamentally the DirectX Shader Compiler being based off Clang 3.7 meaning the preprocessor implementation is really old (no VA_OPT etc).
The problem with shading languages is that nobody has really developed a linker, so every shader compilation is what one would call a "Unity Build".
Now Boost.Wave isn't exactly a speed demon, and using BOOST_PP certainly doesn't help.
We also spice it up even more, by exploiting the fact that HLSL is "almost syntax compatible" with C++ and we often write headers containing algorithms (lower bounds, upper bounds, FFTs) that compile both as C++ and HLSL.
This Nabla HLSL STL is about 16000 LoC.
Due to this insane combo, it loves to crash Intellisense because Intellisense's preprocessor isn't exactly C++20 compliant.
What we're trying to get
We're trying to make the equivalent of PCH but for preprocessing.
This is both to make the further HLSL compilation (including residual preprocessing) faster, but also to cut a break to language servers like Intellisense (especially important when code is shared with C++) and get an overall better source-browsing experience. For example see our nasty reflection-struct defining macro:
NBL_HLSL_DEFINE_STRUCT((MyStruct),
((a, float32_t))
((b, int32_t))
((c, int32_t2))
);
Wouldn't it be nice to actually see the code that generates?
Question
If it possible to dump all of Boost.Wave's context state in the form of #defines (and #pragmas if the state is more complex than can be represented with defines - but not that at least for headers we use guards) at the end of a file.
And if yes, how?
- Dominant language
- C++
- Stars
- 29
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/wave
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·