I can use Ruby on Rails but I don't think an RoR app can handle thousands of comments per minute in an optimised way. I run a midsize app in Rails 5 and already having lot of scaling issues.
Iirc Reddit stopped open sourcing their code from 2017 and I guess understanding and running that 12 year old spaghetti code wasn't worth it anyway. I don't see anything useful on their github page too https://github.com/reddit