|
| 1 | +# 3. Prefer Python, Go, and Typescript (in this order) |
| 2 | + |
| 3 | +Date: 2025-10-31 |
| 4 | + |
| 5 | +## Status |
| 6 | + |
| 7 | +Accepted |
| 8 | + |
| 9 | +## Context |
| 10 | + |
| 11 | +We have many Bash scripts, often they are inline scripts embedded in Dockerfiles. |
| 12 | +This is hindering code reuse, and makes using good software engineering practices difficult. |
| 13 | + |
| 14 | +The current team self-reported that they are comfortable with Python, Go, and (to a lesser degree) TypeScript. |
| 15 | +Use these languages in preference to Bash. |
| 16 | + |
| 17 | +## Decision |
| 18 | + |
| 19 | +The team has agreed to use Python, Go, and Typescript, in this order. |
| 20 | + |
| 21 | +For any new development, we should use the most appropriate language out of these. |
| 22 | +Old code should be gradually migrated to one of the preferred languages. |
| 23 | + |
| 24 | +Avoid using Bash for anything more complicated than a `RUN dnf install -y ... && dnf clean all`. |
| 25 | + |
| 26 | +### Python |
| 27 | + |
| 28 | +_The language of AI._ |
| 29 | + |
| 30 | +Pytest as the currently most popular test discovery and execution tool. |
| 31 | + |
| 32 | +Rewriting Bash scripts to Python is verbose. Library to help with this is [sh](https://github.com/amoffat/sh) and others. |
| 33 | + |
| 34 | +The indentation-based syntax is obnoxious, multiline lambdas are not available. |
| 35 | + |
| 36 | +### Go |
| 37 | + |
| 38 | +_90% Perfect, 100% of the time._ [Brad Fitzpatrick, 2014](https://go.dev/talks/2014/gocon-tokyo.slide), [slide #36](https://go.dev/talks/2014/gocon-tokyo.slide#36) |
| 39 | + |
| 40 | +Good performance, creates native executables, first class library support for dealing with Kubernetes. |
| 41 | + |
| 42 | +### TypeScript |
| 43 | + |
| 44 | +_The language of the web._ |
| 45 | + |
| 46 | +Playwright has best support for TypeScript, other language bindings are a bit of a second class citizen. |
| 47 | + |
| 48 | +We will consider using full-stack TypeScript in preference to having either a Python or Go backend to a TypeScript frontend. |
| 49 | + |
| 50 | +## Consequences |
| 51 | + |
| 52 | +Less duplication of code due to easier maintenance, and testing of Python code, which should promote reuse. |
| 53 | + |
| 54 | +Simple scripts will be more verbose in Python, but this is a trade-off we can make. |
0 commit comments