When Zig is safer and faster than (unsafe) Rust

This page summarizes the projects mentioned and recommended in the original post on /r/rust

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • unsafe-code-guidelines

    Forum for discussion about what unsafe code can and can't do

  • Agreed! MIRI is so good, it still feels like magic to me. It also comforts me that the Rust team takes improving unsafe semantics seriously, with the past Unsafe Code Guidelines WG and today's operational semantics team (t-opsem).

  • rfcs

    RFCs for changes to Rust

  • Agreed! MIRI is so good, it still feels like magic to me. It also comforts me that the Rust team takes improving unsafe semantics seriously, with the past Unsafe Code Guidelines WG and today's operational semantics team (t-opsem).

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • zig

    General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

  • But the author's complaint about Miri and aliasing is something I worry about quite a bit, and I think the author of this has drawn the wrong conclusion, sadly. Miri implements a prototype aliasing model, which is more restrictive than whatever will eventually be stabilized. If your code passes Miri that should generate significant additional confidence (but not prove!) that it does not run into any aliasing issues. But nothing of the sort can be said for Zig. The Zig language has an aliasing model, and it has aliasing UB. It must, because of the way it is implemented on top of LLVM, which deeply assumes that some classes of aliasing optimizations are valid. It is almost but not entirely certain that Zig has less aliasing UB than Rust, because that would fit with the language's general aim of making unsafe code easier to get right. And yet, there is no checker for aliasing UB in a Zig program. There is nothing beyond reading the code that I can do to generate confidence that a Zig program doesn't run into aliasing UB. So migrating off Rust on the basis that it is hard to satisfy Miri and to a language that doesn't have any kind of checker for aliasing UB is, at least in part, sticking your head in the sand.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Linus Torvalds: Rust For The Kernel Could Possibly Be Merged For Linux 5.20

    4 projects | /r/programming | 21 Jun 2022
  • Why stdout is faster than stderr?

    2 projects | news.ycombinator.com | 10 Jan 2024
  • Progress toward a GCC-based Rust compiler

    8 projects | news.ycombinator.com | 18 Dec 2023
  • INSANE bug in my code from compiler optimization [Rust] [video]

    2 projects | news.ycombinator.com | 16 Dec 2023
  • Understanding thread-safety vs race conditions

    4 projects | /r/rust | 10 Dec 2023