Showing posts with label Rust. Show all posts
Showing posts with label Rust. Show all posts

April 09, 2026

Warum Python in der Spieleentwicklung Rust überlegen ist

 Die Rust Community behauptet eine Allzweck programmiersprache geschaffen zu haben die für alle Aufgaben von low level bis high level empfohlen wird. Und folglich ist es nur eine Frage der Zeit bis veraltete Programmiersprachen wie C++, Java oder Javascript durch Rust ersetzt werden.

Es gibt jedoch berechtigte Kritik an der Rust Sprache die kurz erläutert werden soll. Moderne Softwareentwicklung basiert zwingend auf der zuhilfenahme eines Large language models, und sei es nur um Fehler im Code zu finden. Der Nutzer postet ein Codesnippet in das LLM seiner Wahl und erhält anders als bei Stackoverflow unmittelbar die korrekte Antwort und muss nicht erst 2 Tage warten.

Large Language modelle sind zwar technisch in der Lage in jeder Programmiersprache den Code zu erstellen, aber ihre Datenbasis wurde mit einer unterschiedlichen Menge an Beispielcode gefüttert. Mainstreamsprache wie Python oder C# werden von LLMs am besten verstanden weil die Menge an Beispielcode von github und die Menge an Tutorials am größten ist. Die These lautet dass jene Programmiersprache die beste ist, die die größte Verbreitung hat, so ähnlich wie English die beste Weltsprache ist, weil es von den meisten Sprechern verwendet wird.

Rust fristet zahlenmäßig ein Nischendasein, es gibt zwar durchaus beispielcode bei github worin gezeigt wird, wie man ein Tetris spiel inkl. grafischer Oberfläche programmiert, für das selbe Problem gibt es in der Sprache jedoch hunderte oder sogar noch mehr Respositorien. Ein weiteres Problem bei Rust ist dass wegen der Neuheit sich die Syntax laufend ändert und die Sprache selber Gefahr läuft durch modernene Forks wie Rue ersetzt zu werden. Das mag hilfreich sein bei der Weiterentwicklung einer modernen Allzwecksprache die über einen eingebauten Memory checker verfügt, macht aber über Nacht den vorhandenen Sourcecode bedeutungslos und fragmentiert das Ökosystem weiter. Das kann bei Python und C# nicht passieren. Die Menge an Beispielcode ist riesig und wächst konstant.

Hier mal einige Zahlen.

- Anzahl Stackoverflow Fragen für Rust: 45k
- Anzahl Stackoverflow Fragen für Python: 2.2 Million

April 07, 2026

Introduction to the Rust Programming Language: Safety, Speed, and Sovereignty

 The landscape of systems programming is undergoing a generational shift. For decades, C and C++ were the undisputed kings of performance, but they carried a heavy burden: memory unsafety. Most Common Vulnerabilities and Exposures (CVEs) in modern software are caused by memory leaks and "use-after-free" errors in legacy C/C++ code. Enter Rust, a language designed to provide the performance of C with the safety guarantees of a managed language.
Origins and Philosophy

Rust was created by Graydon Hoare (who also contributed significantly to the development of Apple’s Swift). Because of this shared lineage, developers often notice a familiar, modern syntax between the two languages. Unlike languages that rely on a Garbage Collector (GC)—a process that periodically scans and removes unused memory—Rust introduces a revolutionary Ownership Model.

In C, developers must manually manage memory using malloc and free, often relying on external tools like Valgrind to hunt down leaks. C++ improved this with smart pointers, but Rust takes it a step further at the compiler level.
The Power of Ownership

The heart of Rust is its ownership system, governed by three strict rules:

    Each value in memory has a variable that’s called its owner.

    There can only be one owner at a time.

    When the owner goes out of scope, the value is automatically dropped (cleared from memory).

This prevents memory leaks and ensures that a "use-after-free" error is physically impossible to compile. This level of safety is why giants like Microsoft are planning to transition significantly to Rust by 2030, and why even the Linux Kernel has begun integrating Rust code (currently sitting at roughly 0.3%).
Ecosystem and Tooling

The developer experience in Rust is centered around Cargo, its highly praised build system and package manager.

    Project Initialization: Use cargo init --bin to start a new project.

    Dependency Management: Simply edit the Cargo.toml file to add a "crate" (Rust's term for a library).

    Execution: Run cargo run to compile and launch your application.

Rust is also being used to build entire operating systems, such as Redox OS. Redox is a Unix-like OS written entirely in Rust, featuring its own display server called Orbital and supporting the NetSurf browser.
Learning Through Graphics and Games

Many developers find that the best way to master Rust's strict compiler is through visual projects. The Piston engine is a long-standing choice for game development, but for those seeking simplicity, Macroquad is an excellent library for 2D/3D graphics.

Developer Note: If you encounter errors like "floating point arithmetic is not allowed in constant functions" while using Macroquad on Linux Mint, ensure your compiler is up to date by running rustup update stable.
References and Further Reading

- From C# to Rust: A 42-Day Challenge https://woodruff.dev/from-c-to-rust-a-42-day-developer-challenge/
- Microsoft: Rust to Replace C/C++ by 2030 https://www.martinsfeld.de/blog/microsoft-rust-ersetzt-c-cpp-2030/
- Game Development in Rust with Macroquad https://mq.agical.se/
- The Rust Programming Language (Official Book) https://doc.rust-lang.org/book/
    
  

April 04, 2026

A closer look into the Rust programming language

 Rust is a very new programming language available since 2015. The main problem with Rust is, that its harder to learn than C/C++. Let us describe the situation in detail.

Before the invention of the Rust language, the programming world was divided into beginners languages like Python and Java on the one hand and expert languages like C++, Haskel and Assembly.

A programming language like Python is called a beginner language because its interpreted but not compiled, because there are no datatypes and because the code is easy to read. The disadvantege of Python is well known but for creating prototypes Python is perhaps the best programming language ever invented.

Creating production ready code was mostly done in C++ which is a very efficient language but is hard to write. Rust can be seen as twice as complicated as C++ because it introduces many new concepts and is very different from existing languages like go, java or C#.

The main reason why Rust has become popular is because its newer than the C++ standard. It doesn't provide endless amount of outdated principles but was designed from scratch for productive tasks. So its soem sort of rewrite of the D Language which was also started as a C++ replacement.

In contrast to former C++ replacements like nim, golang and objective c, the Rust language has become more popular. It seems that the demanding learning curve results into efficient software projects which can compete and outperform C++.

The main reason why Rust hasn't replaced C++ yet is because its very new and different, Programmers have to unlearn former knowledge and start from scratch which is a huge obstacle. 


July 20, 2019

Will Rust replace C++?


The Rust programming language looks like a promising candidate which simplifies programming. In contrast to C++ the language was designed from scratch and has many powerful features. Even the performance can be compared with C++. Unfortunately these features are not enough to compete with C++. The problem with C++ is, that the language is nearly perfect, which means there is no need for new kind of language. The reason why C++ has pointers is because a computer is working with pointers, and the reason why so much libraries are available in C++ is because so much programmers have written it. It's simply not possible to invent programming from scratch and make everything much better.
The future of C++ isn't Rust, but the future is a layered software development workflow in which the prototype is written in Python and the production code in C/C++. That's the best practice method in producing high quality software which runs on major operating systems. It's true that there is need for additional language apart from C/C++ but not with the aim to replace it but to extend it.
The funny thing with programming is, that writing code isn't very hard. I've never heard of a programming project in which the programmers where not able to create an array and fill it with values. The reason why software projects fails has to do with coordinating programmers, decide which kind of program has to be written and because the users doesn't like the application. Converting a specification into executable binary code is the easy part in a software project. If somebody is in the comfortable position, that he can type in C++ sourcecode into an IDE the project is on the right track.
Software engineering can't be revolutionized with new programming languages but with new collaborations tools like atlassian jira, wikis, github and so forth.