Skip to content

JPenuchot/poacher

Repository files navigation

poacher

C++ compile-time compiling experiments.

Objectives

Exploring arbitrary eDSLs in C++20, from parsing to codegen.

Poacher used to be a project aiming towards a compile-time parser generator that works in constexpr functions, but this need is almost fulfilled by ctpg. Several issues remain and make the ctpg incompatible with constexpr functions, but I'm also working on fixing that.

Yet I'm still working on handmade parsers (such as the Brainfog parser that is fully functional), data structures for ASTs, ways to go from value-based data to type-based data, etc.

For the record, here's the previous "objectives" narrative that was written a while ago:

constexpr computation is all the rage in post-C++17 world. Works by Hana Dusikova on compile-time regular expressions and some great pioneering by Jason Turner and Ben Deane show that parsing arbitrary data or langages from compile-time available strings is a very valuable technique.

Poacher has the goal to provide an extensible framework to easily define such constexpr parsers for arbitrary langages and to provide some well known langages ready-to-use compile time parsers.

Our goal is to implement a constexpr parser generator for LR(1) grammars. Such grammars can express complex languages such as OCaml, Haskell, or any other language recognized by a parser generated by programs such as Yacc, Menhir, or Happy.

Requirements

References

Discuss

Head over to our Discord and don't hesitate to mention me (@JPenuchot) if you have any question regarding the project.

Licensing

TODO

Releases

No releases published

Packages

No packages published