The current hand-written recursive-descent parser is relatively slow and is the main bottleneck of the `prepare` function. The parser should be rewritten using a tool that produces more efficient code, such as https://github.com/antlr/antlr4.
*** Bug 189014 has been marked as a duplicate of this bug. ***
It takes 2.5 hours to compile the standard library. 95% of the time is spent parsing.
One way to do this is by using a parser generator. Another way of doing this is with testing. Another way is via inspection.
<rdar://problem/44403020>
Migrated to https://github.com/gpuweb/WHLSL/issues/101