Use Rust

INFOVALUE
DATE2023-03-10
AUTHORAmir H. Alesheikh amirhossein.alesheikh@gmail.com
PROPOSERAmir H. Alesheikh amirhossein.alesheikh@gmail.com
DECIDERAmir H. Alesheikh amirhossein.alesheikh@gmail.com
CONSULTEDNONE
STATUSaccepted

Decision:

use Rust as the main language

Context

  • What should be the main language for implementation of soapberry?

Decision drivers

  • Speed of development
  • Type-safety
  • Expressiveness
  • Tooling
  • Runtime-Error proneness

Considered Alternatives

Go

  • Considering Go's mark-and-sweep garbage-collection strategy and the memory intensiveness of Event-Sourcing, Go potentially can cause a considerable headache in scale.
  • Go's type-system is very small and lacks many features which is neccassary for a good compile-time gurantee of correctness. To be specific, lack of sum-types means type-casting at runtime.
  • Go also lacks a mature generic support which makes the anything more than the most basic generic functions to be exponentially less-readable.

Other languages

  • All the languages with mark-and-sweep garbage collectors are suffering from the GC problems mentioned.
  • All the languages with manual memory-management (c, c++, and even zig) are making a trade-off that I would not and need not wanted to make.

Consequences

Pros

  • More correctness gurantees.
  • No concerns over future memory problems.
  • Very expressive and condence code.

Cons

  • Finding the right abstraction takes more time.
  • Compilation-time and LSP speed lacks when compared to Go.