Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

Programming Language decision

Jochen Saalfeld edited this page Jan 17, 2019 · 3 revisions

Identifying usable Programming Languages

With the oppertunity to delete all old code and start from scratch, a decision has to be made what programming language should be used to program the backend. We have to consider some side-notes while choosing the language for the backend.

  1. The backends mainly hardware foundation will be to run in a virtualized environment and to manage that environment. Most of these environments are paid by usage of RAM and CPU, so the idle and overall usage of those parameters should have a relatively small footprint.

  2. We already have knowledge in the core-teams with some programming languages, which will make it easier (faster, more secure and robust) to develop in those languages. Additionally the entry-level for other core-developers will be lower, since they are already familiar with the concepts of the language.

  3. The technolgies that should be used (kubernetes, helm, prometheus...) are all written in one programming language. The bindings in the same programming language are naturally more recent and robust than in other programming languages.

With point 2 and 3 in mind, there are 3 programming languages to consider: TypeScript, Python, and Go.

About TypeScript

TypeScript is used in the OpenSlides-Client. As a server based application it is run with a NodeJS server.

Attributes:

  • It is extendable with many packages from npm (relevant packages for the backend approach are available and seem to be relatively up to date with the used software)
  • TypeScript is a very object oriented
  • unstrict programming language
  • Due to the NodeJS server it is not very hardware- or system-close
  • Due to the NodeJS server there is additional resource overhead

About Python

Python was used in the openslides-multiinstance-backend Version 1 and is used in the server-side of OpenSlides.

Attributes:

  • It is extendable from pip (relevant packages for the backend approach seem to be a bit outdated and not fully feature complete)
  • Python is very object oriented
  • Python can be used functional
  • unstrict, imperative, reflective
  • strongly typed
  • Due to interpreting the Python files in runtime, it is not hardware- or system-close
  • Due to interpreting the Python files in runtime, there is additional resource overhead

About Go

Go is used to program the software used in future in the backend by kubernetes, helm, prometheus and others in the virtualization field that will be used.

  • It is extendable from go packages (relevant packages for the backend approach seem to be really stable and up to date)
  • go is more procedural than object oriented
  • strict, functional and concurrent
  • statically typed
  • other then Python and TypeScript, go is compiled
  • due to compilation, gois more hardware- and system-close
  • due to compilation, go has a smaller resource overhead

Decision

When matching the above mentioned attributes of the programming languages with the attributes the backend should have, the decision for a programming language is more of a decision between Python and go. TypeScript rules itself out with the big software-overhead of NodeJS and the missing security in many fields like strictness of the language and the deep dependency issues with npm. But TypeScript will most likely to be used in the http://github.com/OpenSlides/openslides-multiinstance-frontend/.

Python is known by more developers in the OpenSlides-Community (which is a big plus) and go is for most of the core developers a "Neuland". But with the attributes of those languages one has to decide, that go is the programming language which fits the needs for this environment in the best way possible,