Ja und Nein, denn Rust ist im grunde sicherer aber auch das kommt darauf an wie mensch es umsetzt. Ich vertraue Rust mehr als anderes Coding, ich schau mir die Libs-Daten an.
»Speichersicherheit – Fast 20 Prozent aller Rust-Pakete sind potenziell unsicher:
Nach Angaben der Rust Foundation verwendet etwa jedes fünfte Rust-Paket das Unsafe-Keyword. Meistens werden dadurch Code oder Bibliotheken von Drittanbietern aufgerufen.«
@kubikpixel Sehr schade finde ich, dass der Artikel nicht darauf eingeht, dass viele der "unsicheren" Pakete tatsächlich nur Wrapper sind, die explizit diese eine Fremdbibliothek einbinden und evtl. abstrahieren - also tatsächlich eine zusätzliche Sicherheitsschicht, um diese Bibliotheken möglichst einfach aktualisieren oder auswechseln zu können.
Expand glob imports is an underrated feature of Rust Analyzer. It’s amazing how the black box melts away when you understand what your framework is bringing into scope.
Having beaten Windows .BAT files and FTP into submission on one laptop (thanks #WinSCP) while getting my #TauriV2 app to build for #Android on another, today I will be figuring out how to debug it with #AndroidStudio.
It almost works. I can call #RustLang from the #Svelte GUI, but my custom protocol handlers aren't being called. 🤔 #Tauri
I think there would be still space for systems programming language with a constraint from day zero that it would 1:1 compatible with plain C”s binary layout and memory model:
Roughly just .text, .bss, .rodata and ,data.
No symbol mangling at all.
All the memory safety etc. fancy features would be then designed within exactly those constraints.
#Rust is essentially a derivative of C++ when compiled to binary, which does not really make it a strong competitor for plain #C. It can substitute C in many cases for sure, just like C++ did, but there’s always need for minimal systems programming language, which also looks elegant in binary, not just in source code.
A compiled C program can be quite easily understood with a binary with no debug symbols at all if you understand the CPU architecture well enough. That is, and will be a strong asset for C.
@jarkko Safety is like a thread you start to pull, and pulls more and more stuff. You need collections for bound checks and robust realloc, but void* casts complicate verification, so you need generics for collections. To reduce bounds checks, you need iterators. Safe unions require sum types. Unsafe free() can be replaced with destructors, which need owned+borrowed pointers. You need thread safety too, etc.
There isn't much that can be removed from Rust without creating holes in the safety.
Started looking at hyper, warp, and axum, but loading a file at server startup and sharing that across handlers is a common source of friction. I may have to resort to lazy static, but https://docs.rs/axum/latest/axum/#sharing-state-with-handlers might be a cleaner solution.