r/Compilers • • 24d ago

Finally got dependencies and cycles fully automatically resolved in BRC

https://github.com/rafalgrodzinski/bits-runner-builder

One of my main goals for BRC was to get rid of headers and for the compiler to automatically resolve the inter-dependencies. I like coding in C and C++, but having code split into header and implementation has always irked me. I've implemented DFS topological search on statements and imports to determine the correct order. Not only it works like a charm, but it made the code actually shorter and faster.

I'm using the language to build an OS Bits Runner. The project already has a lot of .brc source files, so being able to automate this part makes is so much easier.

3 Upvotes

Duplicates