@antoniosarosi@kolemannix It's not specified. Most readers would presume you're talking about "Rust" over "Safe Rust". (I agree with your root interpretation fwiw)
@yarnf40580@sasuke___420 There may have been such restriction in zig's stage1 compiler from the past, but it's how everyone does it now: https://t.co/AzezORklXu
@yarnf40580 @sasuke___420 Zig vectors (not autovec) are gnu/llvm-vectors, have close codegen to platform-specific intrisics when llvm can detect what ur doing. If it cant LLVM provides intrinsics for that (asm restrict fusing/reordering) https://t.co/tpOheKLmYC But gotta use hacks cuz zig doesnt expose it
@carllerche I get this is bait, but Arc, task heap-alloc, deep poll-chains, etc. are concepts built around safe Rust & not how CPU/IO needs to work.
@carllerche@davidcrawshaw IMO, its the same behavior as threading - just a "promise" of cheaper overhead. Intra-task concurrency, fork-join, cancellation, etc. are all possible with threads. Separation seems only helpful if wanting to avoid mixing the two. Async-RT behind an interface hits the same issue
@owickstrom@tritlo Doing curve25519 stuff atm. Here are some good ones:
https://t.co/93E2QmEAc4
https://t.co/QrwTYfCrtF
https://t.co/khQqZDSUDW
https://t.co/KeqogOeJPm
https://t.co/e48mstxIuA
https://t.co/Pp3QG72Ov8
@owickstrom@tritlo Im getting a similar experience with cryptographic computing. The things ppl have done to sculpt the math to the computer is very fun to learn about
@__morse@nevgeniev@croloris Thinking for the lang itself rather than stdlib allocators. That pattern would need to indicate when ownership moves to know who destructs; for f(x: T) is x the owner? a non-destructive copy? what about f(x: *T) like in deinit() pattern - owner or mut-borrow?
@nevgeniev@croloris@__morse Dont lifetimes require a concept of ownership (for the shared xor mut aspect), then special casing for interior mutability (mutation thru shared ref : UnsafeCell)? Or can it be done simpler?
@ForrestPKnight@ippsav comptime isnt "rough" without traits or interfaces. Duck typing is only through `anytype`, which is optional. An error in a generic body will return a stack trace you can jump to & read. Other points are zsf leadership, but this reads as if u glanced at the lang but never used it
@eatonphil for disk, dispatching it off control plane is main benefit, ideally low cost dispatch: SQPOLL or ringbuf->another thread
for network, idk. Less syscalls, but is that better? Registered buffers vs mlock? Needs bench. Usually u just skip as much of kernel as u can instead e.g. XDP
Whatever your transactional database is, help me understand your use of it. This survey is run by @theconsensusdev, independent of any database or vendor.
RT or pass along to industry peers for broader representation
https://t.co/vFYyDTCNia
If you're not doing deliberate low-level code, can't seem to stop getting memory errors, or work on systems projects with a team of varying skill levels, Rust (or any lang with Refinement types + an optimizing compiler) is probably the better tool, I'd assume.
Unfortunately, I don't use Zig now. Every 1.5-5x human DX productivity boost from Zig features is eclipsed by the 100x boost from coding agents writing Rust:
Allocator interface:
This is my favorite Zig feature, you feel so galaxy brain using a specialized allocator to optimize a code path (e.g. arena, stack fallback etc). The problem in Rust used to be that there was no Allocator interface equivalent and if you wanted a Vec<T> that used a custom allocator you literally had to copy+paste the std version and modify it to use it (this is what Bumpalo did, look at the source). For a long while now there has been an Allocator trait in nightly, and it seems to be good now. Because it is a trait it is static dispatch, vs Zig's which is based on a vtable. Unlike Zig there isn't a community-wide convention of designing data structures to be parametric based on the allocator, but AI changes the game and makes it trivially to copy paste code and change that. I find it works well enough for my use-case.
Arbitrary bit width integers + packed structs:
Another beloved Zig feature of mine. It makes it so easy to do DOD-style CPU cache optimizations and stuff like tagged pointers, NaN boxing, etc. and even made bitflags really easy to make. You could always do this in Rust or any systems programming language but it was really ugly/unergonomic. The least worst option was using some crate like bitfield/bitflags which both rely on proc macro magic to work. Now, with coding agents I literally do not care how annoying it is to write the code by hand.
Comptime:
This is Zig's flashiest feature, no other programming language except maybe for obscure dependent-types langs have compile time evaluation as nice as Zig's. I thought I would miss it a lot, but I actually don't. For me, 95% of comptime usage is to create Zig's version of generic data structures with parametric types. Rust has a better designed type system IMO (see next section). In the remaining 5% of cases, not having comptime sucks. The only reliable way to reach an equivalent is through codegen. I'm making a game right now, and I have hardcoded hitbox geometry data generated from a tool that I want to bake into a data structure. Without comptime, I have to get Claude to write a script that generates the Rust file. However, I don't find myself needing compile time evaluation that much anyway.
Rust's type system:
I think I'd rather trade having comptime for Rust's better-designed type system, especially for bounded polymorphism (traits/typeclasses). Trying to do the equivalent in Zig is a nightmare. Also, I think that Rust's type system allows you to enforce more variants and prevent coding agents from making common mistakes. In my game I use the euclid crate which essentially allows you to not mix up coordinate spaces (very common problem in graphics programming) by creating specialized types for each coordinate space (e.g. Point<Screen> or Point<World>)
Not having to deal with memory issues:
With coding agents allowing 100x more code to be written, this also means you need to scrutinize 100x more Zig code for memory issues. Without formal verification, the surface area of the search space to enumerate to find bugs is just so much larger now. With the magnitude of code being generated now, Rust is even more attractive. Rust's tradeoff was always that it hinders developer productivity especially if you are unfamiliar with borrow checker, but this simply does not matter with coding agents anymore. And if you do use unsafe in Rust there's tools like miri which you can have the coding agent run the code against to make sure it doesn't cause UB or isn't violating Rust's aliasing rules when it comes to unsafe.
I still miss writing Zig and find it to be a great language but I like Rust more and coding agents work with better with it.
@AndrewGossage33 Makes sense. I write Zig for a dist. sys. company. Initial version used arenas where it could, but its a long-running service & most allocations were persistent / non-lexical (scope based) in their lifetime. Leaks were harder to detect there, esp. due to mixing allocator misuse
@ZEROX90LLC I agree. As per first bullet, Rust can express most everything that all the other systems PLs can (for the equivalent codegen). But IME, Zig & co. can just express them simpler.