architecture-decision-record

Programming languages

Contents:

Summary

Issue

We need to choose programming languages for our software. We have two major needs: a front-end programming language suitable for web applications, and a back-end programming language suitable for server applications.

Decision

We are choosing TypeScript for the front-end.

We are choosing Rust for the back-end.

Status

Decided. We are open to new alternatives as they arise.

Details

Assumptions

The front-end applications are typical:

The front-end applications is likely to evolve quickly:

The back-end applications are higher-than-typical:

We accept lower compile-time speeds in favor of compile-time safety and runtime speeds.

Constraints

We have a strong constraint on languages that are usuable with major cloud provider services for functions, such as Amazon Lambda.

Positions

We considered these langauges:

Argument

Summary per language:

We decided that VMs have a set of tradeoffs that we do not need right now, such as additional complexity that provides runtime capabilities.

We believe that our core decision is driven by two cross-cutting concerns:

Honorable mentions go to the VM languages and web frameworks that we would choose if we wanted a VM lanauge:

Implications

Front-end developers will need to learn TypeScript. This is likely an easy learning curve if the developer’s primary experience is using JavaScript.

Back-end developers will need to learn Rust. This is likely a moderate learning curve if the developer’s primary experience is using C/C++, and a hard learning curve if the developer’s primary experience is using Java, Python, Ruby, or similar memory-managed languages.

TypeScript and Rust are both relatively new. This means that many tools do not yet have documentation for these languages. For example, the devops pipeline will need to be set up for these languages, and so far, none of the devops tools that we are evaluating have default examples for these langauges.

Compile times for TypeScript and Rust are quite slow. Some of this may be due to the newness of the languages. We may want to look at how to mitigate slow compile times, such as by compile-on-demand, compile-concurrency, etc.

IDE support for these languages is not yet ubiquitous and not yet first-class. For example, JetBrains sells the PyCharm IDE for first-class support for Python, but does not sell and IDE with first-class support for Rust; instead, JetBrains can use a Rust plug-in that provides perhaps 80% of Rust language support vis a vis Python language support.

We will aim toward ecosystem choices that align with these langauges.

For example, we want to choose an IDE that has good capabilties for these languages.

For example, for our front-end web framework, we are more-likley to decide on a framework that tends to aim toward TypeScript (e.g. Vue) than a framework that tends to aim toward plain JavaScript (e.g. React).

Our entire toolchain must support these languages.

We expect we may export some secrets to environment variables.

Measure twice, build once. We are prioritizing some safety over some speed.

Runtime is more valuable than compile time. We are prioritizing customer usage over developer usage.

Notes

Any notes here.