Picking a language is picking a library
When somebody asks me which language to use, the honest answer is: choose the library first, the language follows. You are not going to write a video encoder from scratch, and you are not going to train a language model. You use what already exists — and what already exists is usable from one or two languages, not from all of them.
So the real question is not "which language is nicest" but "has somebody already solved this, and what did they write it in". Choosing by taste here means rewriting, by hand, something that took other people ten years.
Each layer takes the language of the strongest library it needs
- Interface: TypeScript, running in the browser. That is not a choice — the browser understands one language, and the whole interface ecosystem lives there. TypeScript rather than plain JavaScript because the front end of a working tool holds a lot of state, and types are the cheapest way to catch mistakes before anything runs.
- Orchestration: Python. This layer decides what runs first, what waits, and which step comes next. It sits right next to the heavy engines, so the distance between the two is close to zero.
- Heavy engines: Python calling down into libraries written in C and C++. Nobody rewrites a video encoder in Python, and nobody writes the scheduling part in C. The heavy work runs below, the arranging runs above.
- Configuration: not a programming language at all, but structured data. Video templates, product lists, status labels — none of that belongs in code, because you want to change it without installing anything.
The interface is not written in Python, because it would end up glued to the long-running process
A common way to do this is to build the interface in the same language as the heavy part and open it in a browser. It saves you one language and charges you three things.
First, every bit of interface state takes a detour through a server, so the interface is only as fast as that server. Second, the interface becomes a page the server redraws step by step, not an application you can click through quickly.
Third, and heaviest: changing one button means touching the code of a process that runs for hours. The interface and the renderer are glued together, and the failure boundary disappears.
Being polyglot costs five things, and the dearest one is not in the code
- Two sets of tools to install. Two version systems for libraries, two vulnerability checks, two different ways for installation to fail on a fresh machine.
- The boundary between two languages has to be data, not function calls. The two sides exchange only data structures with a defined shape, and somebody changing a field has to change it on both sides — with no compiler to remind them.
- Types do not cross the boundary. One side believes a field is always there, the other can return it empty, and the error only shows up at runtime. So every value crossing the boundary has to be checked by the side receiving it.
- Hiring is harder. One person has to read both sides, and that person costs more than someone who only knows one.
- Boundary bugs are the hardest to find. When something works on one side and misbehaves on the other, the fault is usually not in the code but in an assumption the two sides read differently.
I refuse to add a language to speed up a step that is already fast
Another language should only come in when it opens something you cannot do any other way. I refuse to add one to speed up a step that is already fast, to rewrite a library that is already good, or to use a tool only a handful of people know. All three sound reasonable, and all three cost you one more boundary, one more set of tools, and one more person who has to understand it.
The one place I do accept an extra language is the engine layer — and there I am not writing, only calling. The difference between calling a library written in another language and writing a layer in another language is enormous: calling is not maintenance, writing is maintenance forever.
Four questions that filter languages out before you add one
- Which language is the best library for this job written in? That answers 80% of the cases.
- Will anyone else have to read this layer? An interface gets edited constantly; the orchestration layer much less. The layer that changes most should be in the language that is easiest to read and change.
- Will the new boundary pay for itself? If a layer only forwards data from A to B, it has not earned its own language.
- Could you rewrite it in a week? If the answer is no, the layer is too big to be a layer.
In the end, being polyglot is not a manifesto, it is a consequence. You pick the best library for each job and then notice you are standing in three languages — and at that point the work is to make those three boundaries clear, not to force everything back into one language because it is easier to talk about.
Frequently asked questions
Which languages does the product use?
Three groups: TypeScript for the interface that runs in the browser, Python for orchestration and for calling engines, and libraries written in C or C++ for the heavy jobs like video encoding and speech. You do not need to know any of that to use it.
Why not write everything in one language and keep it simple?
Because the libraries that do the heavy work — video encoding, speech, language models — only exist in a few languages. Writing everything in one language means rewriting those libraries yourself, and then maintaining them forever.
Does being polyglot make the software slower?
Not measurably. The boundaries between layers exchange small pieces of data, not video streams. The slow part of the pipeline is encoding, not the language change.
If I want to add a feature myself, which language do I use?
Whichever layer the feature touches. If it is something you see on screen, it is the interface layer; if it is a step in the video pipeline, it is the orchestration layer. The rule is to follow the layer, not your favourite language.
Automate the repetitive part
AutoReel does most of what these articles describe: reads the product, writes the script, builds the video, then publishes it to Shopee Video and Facebook/Reels. Rent it from $6.99 a month, or buy it once and keep it.