From C ➡️ C++ ➡️  Rust @code_report
From C ➡️ C++ ➡️  Rust  @code_report
Uploaded December 2022 | Updated November 2026, 2 hours ago
In this video, I refactor a C function to C++ and then to Rust. I also show the equivalent Haskell code and show a comparison of number of assembly instructions generated at the end.

Links:
CodeAesthetic Video: youtu.be/CFRhGnuXG-4
Slides and Code: github.com/codereport/Content/tree/main/Talks/2022-12-YouTube/FromCtoCpptoRust
Godbolt Links: github.com/codereport/Content/blob/main/Talks/2022-12-YouTube/FromCtoCpptoRust/Summary.md
Behind the scenes video: youtube.com/watch?v=Vh3y1ela-_s

Chapters:
0:00 Intro
0:25 Motivation
1:19 C Code
2:10 C++ Code 1
2:43 C++ Code 2 - Reformatting
2:53: C++ Code 3 - views::iota
3:36 C++ Code 4 - views::filter
4:14 C++ Code 5 - std::accumulate
5:10 C++ Code 6 - ranges::accumulate
5:54 C++ Code 7 - Ternary Operator
6:50 Rust Code
8:30 Bug in C/C++ Code?
10:23 Haskell Code
11:30 Count of Generated Assembly Instructions Comparison
13:40 Outro

Follow me on Github: github.com/codereport
Follow me on Twitter: twitter.com/code_report
Follow me on LinkedIn: linkedin.com/company/codereport
From C ➡️ C++ ➡️  RustFrom Mathematics to Generic Programming - Ch 5 & 13 + Euler🟢🟡🔴 Jello 🔴🟡🟢 & 🪼 Jellyfish 🪼!Stepanov on sd::rotateThrust and the C++ Standard Algorithms - Conor Hoekstra - GTC 20211 Problem, 8 Programming Languages (C++ vs Rust vs Clojure vs Haskell...)
code_report |

From C ➡️ C++ ➡️ Rust

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER