The Modern Tech Stack
Think of a large restaurant kitchen. The head chef speaks French, the pastry chef speaks Italian, the sous chef speaks Spanish, and the dishwasher speaks Mandarin. They all need to coordinate to get a single meal to the table. Without a shared communication system — a common order ticket format, a shared set of hand signals — the kitchen collapses into chaos. Modern software systems face exactly this problem.
In the early days of software, you might have built your entire backend in a single language — Java, or C++, or Python. Today, a single user request can travel through a chain of services written in completely different languages, each chosen because it is the best tool for that specific job:
- A Frontend in TypeScript/React — chosen for its rich ecosystem and type safety in the browser.
- An API Gateway in Go — chosen for its low memory footprint and high concurrency.
- A Data Science model in Python — chosen because the ML ecosystem (NumPy, PyTorch) lives there.
- A High-Performance image processor in C++ or Rust — chosen for raw CPU throughput and memory control.
This is a polyglot architecture — a system that deliberately uses multiple programming languages, each where it excels. The word "polyglot" comes from Greek: poly (many) + glōtta (tongue). The challenge is not choosing the right languages; it is making them communicate reliably and efficiently.
There are two fundamentally different scenarios for cross-language communication, and they require completely different solutions:
- Across a network (microservices): Two processes running on potentially different machines need to exchange data. They need a common data serialization format. The dominant solution here is Protocol Buffers (Protobuf).
- Within the same process (embedded libraries): One program wants to call a function from a library written in a different language, sharing the same memory space. The mechanism for this is a Foreign Function Interface (FFI).
Understanding when to use each approach — and the trade-offs each carries — is what this lesson is about.