Conclusion

Copy semantics VS move semantics

LanguagesParadigm
Ccopy semantics + pointers
C++copy semantics by default + move semantics possible + pointers
Rustmove semantics by default + copy possible if mentionned + pointers
Pythonpointers only

In C, C++, assignments in general make copies by default.

x = y;`

Such a small instruction can be very cooooostly!

In Rust, assignments make move by defaut:

x = y;
//impossible to use `y` anymore!

except for types that implement the Copy trait, e.g. integers:

y = 5;
x = y;
//still possible to use `y`

In Python, variables are pointers!

x = y:

Memory managements

LanguagesData location
Cstack & heap
C++stack & heap
Ruststack & heap
Python/Java/Javascript etc.Pointers to data in the heap
LanguagesParadigm
Cdo it yourself
C++do it yourself + RAII encouraged
RustRAII
Python/Java/Javascript etc.Garbage collection

Type systems

LanguagesParadigm
Cweak, static, no genericity
C++strong, static
Ruststrong, static + lifetime
Pythonstrong, dynamic (+ static gradual typing)

I hope...

  • that the C part will be useful for you in the architecture & system course in L3S2!
  • that the Python part will be useful for you in the compiler course in M1S1!
  • that you understand more C and Python for agregation
  • that you are more fluent in programming languages for:
    • your internship
    • your research and/or teachr career!

Happy christmas!