The Need For Speed: Getting the most out of intermediate languages.

Recently, I decided to extend my skillset by learning 3 new programming languages; X64 Assembly language, C++ GCC, and Rust. Sounds like quite the challenge doesn't it? That's what I thought at first too. However, I was pleasantly surprised by how easy I found it to learn the basics of C++ and Rust (the same can't be said for Assembly!).

Anyway, I set out to develop an application that is simplistic in nature but would perform the absolute best as possible; which is something I had never accomplished before with my code. To push myself to the limit of optimisation, I combined my new knowledge of C++ and Assembly to create a basic calculator entirely in C++ including the use of branchless programming. To do this, I looked into how my C++ code was translated into assembly code at runtime; leaving me with even further research to complete!

After all my research, I sat down and wrote the application and made the relevant optimisations after I was done with the basic outline. The result is what I would consider more than satisfactory and the entire solution comes in under 60 lines of code. You can check it out here: https://github.com/alexanderwalford-official/C-Plus-Projects/blob/main/Calculator.cpp

Comments