top of page

Programming Language Showdown: Rust vs. C vs. C++ for Software Optimization

"Which programming language should we use?"


Embarking on a new project with a clean slate theoretically allows for the selection of any programming language. However, in practical scenarios, project choices are often constrained by factors like company standards and necessary integrations.


At Underspend, TypeScript is our go-to choice. But when we optimize libraries for companies, we work within the environment that company is already operating in. Still, there is some wiggle room when choosing a language to work with. The ideal language varies based on the situation:


In Java, the Java Native Interface (JNI) enables calling native applications and libraries in different languages. Yet, external calls through JNI are often performance-intensive. Due to a lack of built-in integration with native code, the choice of programming language does not impact performance.


In Node.js, WebAssembly (WASM) allows code in C/C++/Rust to be compiled and executed at nearly native speed. This capability enables writing performance-intensive sections of a Node.js application in any low-level language that compiles to WASM.


In Python, Cython provides a method to write inline C code, which is then compiled into the Python library. For optimizing Python applications, we leverage Cython to craft performance-critical code segments. In scenarios where the overhead of invoking external libraries is not a major concern, alternative languages may be considered, but C is often preferred for its performance advantages when integrated with Cython. A similar principle applies to Golang and its cgo feature.


Sometimes it's fun to build using a wide variety of languages. Other times you're reminded why people mostly no longer write code in C :)

Comments


Get a Demo
bottom of page