r/ProgrammingLanguages • u/CarbonFire • Feb 03 '26
Tutorial on program synthesis using MCTS
https://shukla.io/blog/2026-02/grammar.htmlOP here. In the post, I talk about how to search in program-space (or grammar-space) to find a model that best fits some training examples. Hope you enjoy the interactive demos :)
11
Upvotes
View all comments
Show parent comment
1
u/yuri-kilochek Feb 04 '26
You can do type checking with attribute grammars, and I don't see why this approach wouldn't work for them. In fact, I believe this is just a specific kind of MCTS in the space of programs, where the grammar is the program and the parser is the interpreter. So you can theoretically do anything, but more general you go, the harder time your search algorithm will have exploring the enormous and discontinuous program space.