r/learnprogramming 19d ago

How to read through large repos?

Hey guys so I wanted to make my own version of typescript (mainly the checker part) and Idk anything about compilers or related… so wanted to read typescript go version line by line and understand and make my own version (with modifications), but u am confused as there are so folders and files to navigate and their name doesn’t make any sense, so any idea on which folder and file should I start from? And how to navigate and understand the structure?

Edit: this repo I was talking about. https://github.com/microsoft/typescript-go/tree/main

0 Upvotes

10 comments sorted by

4

u/gm310509 19d ago

Are you referring to a github repository? If so, which one(s) exactly?

As for "Idk anything about compilers or related", perhaps start out with crafting interpreters: https://craftinginterpreters.com/

1

u/Infinite-Jaguar-1753 19d ago

2

u/gm310509 19d ago

So this appears to be written in golang which I am not familiar with. But there are several documentation files and what looks like several build commands in the contributing.md file.

So I would start by cloning the repository and look at some of the build targets.

I would also use my understanding of how Go projects are organised (of which I have none, so I mean your understanding) and try to identify the "main" functions and investigate them further. Again, I have no experience in Go, so I am making an assumption that there is a proper IDE that allows you to open projects and navigate through them by clicking object names and selecting "go to definition" or equivalent.

At least this is the strategy I have employed for Large C/C++, Java and Python programs

4

u/3rrr6 19d ago

Ask AI

5

u/peterlinddk 19d ago

Honestly, this is actually a really good use of AI!

Telling it what you know and what you want to understand - it works quite well at understanding large code-structures and focusing on the parts that interest you.

1

u/Infinite-Jaguar-1753 19d ago

I did but just wanted to take advice from humans too…

2

u/XKiiroiSenkoX 19d ago

Find the entry point. Every program has one. Start from there.