How should I structure a multi-language coding project from scratch?
Asked by
MellowKite42
I have an application idea that I'd like to turn into a proof of concept. I know Python, C, and OCaml, and I'm studying mathematics and computer science, but most of my coursework has been theoretical rather than focused on building complete applications.
For the first version, I want to work mainly on the backend. It would involve Python code, Lean files, and calls to AI APIs. I'm unsure how to organize the directories, connect the different parts, manage dependencies for each language, and make sure another developer can reproduce the same setup.
I'm also new to Git and GitHub. I know Python projects can use tools such as virtual environments, but I'm not sure what the equivalent approach is when one project contains several languages. What would be a sensible way to begin, and are there any resources or tools you would recommend?
Answers
Break the idea into small pieces rather than treating it as one huge project. Build and test each piece independently, then define a simple interface between them, such as command-line arguments, generated files, or a small HTTP API. If the first connection fails, that failure will show you what the interface needs to provide. A tutorial or existing project with a similar design can also give you a useful starting point.
Reply to this answer
Learning the basic Git workflow early will save you a lot of trouble: git add, git commit, git push, git pull, and eventually branches and merges. Start with a small practice repository so the commands feel familiar before the project becomes important. For dependency reproducibility, document the required tool versions and commit each languageโs dependency or lock file when the ecosystem supports one.
Reply to this answer
For a proof of concept, try not to design the perfect architecture in advance. Create a small directory, get one useful end-to-end workflow working, and let the structure evolve as you learn what the components actually need. You can also inspect a few similar open-source projects for ideas, but avoid copying a complicated setup before you need it.
Reply to this answer
A very simple starting point could be a Python entry point that calls the AI API, with Pythonโs subprocess module used to invoke Lean when necessary. Use a Python virtual environment for the Python dependencies and Leanโs Lake tool for the Lean project. Keep API keys in a local .env file, add that file to .gitignore, and commit an example configuration file without the actual secrets. That is usually enough for an initial prototype.
Reply to this answer
Add your answer
Answers are reviewed before publication.
MellowKite42: That makes sense. Iโll practice the basic workflow on a small repository first and then use the same approach for the prototype.