Skip to content

Commit ecadcc5

Browse files
authored
Merge pull request #152 from markus-gsf-seidl/feature/132-use-compiled-languages
Using Complied Languages rather than Interpreted Languages #132
2 parents 123d72c + 22d0ce9 commit ecadcc5

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
version: 1.0
3+
submitted_by: markus-ntt-seidl
4+
published_date: TBD
5+
category: cloud
6+
tags:
7+
- cloud
8+
- role:cloud-engineer
9+
- size:small
10+
- programming-language
11+
12+
---
13+
14+
# Use compiled languages
15+
16+
## Description
17+
18+
Interpreted languages need to be parsed, compiled and executed when the application starts or a workload arrives. This tends to be more energy heavy then when a compiled language is used. The compilation is then only done once, saving on resources.
19+
20+
## Solution
21+
22+
Use compiled languages (like Go, Rust, Java or others) whenever possible or compile interpreted languages.
23+
24+
25+
## SCI Impact
26+
27+
`SCI = (E * I) + M per R`
28+
[Software Carbon Intensity Spec](https://grnsft.org/sci)
29+
30+
Concerning the SCI equation, use compiled languages will impact as follows:
31+
32+
- `E`: Running compiled binaries is more energy efficient and uses less energy which outweighs the energy consumed in compiling it to binary upfront
33+
- `M`: The embodied carbon emissions will be reduced, as compiled binaries tend to be smaller then the sources they are compiled from
34+
35+
## Assumptions
36+
37+
- There is the assumption that the execution environment allows usage of compiled languages, this is not always the case (for example web browsers)
38+
- Use benchmarks to determine if the application use case benefits from using a compiled language.
39+
40+
## Considerations
41+
42+
- Some interpreted languages provide ways to be compiled into binary (for example GraalVM for Java, Python and more)
43+
- Consider factoring in compile time when doing benchmarks
44+
45+
## References
46+
47+
- [One Carbon intensity benchmark](https://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf)
48+

0 commit comments

Comments
 (0)