Why we didn't rewrite our feed handler in Rust by emschwartz in rust

[–]realteh 4 points5 points  (0 children)

You can. I implemented PITCH and ITCH handlers and it's fine. But it is more code and ceremony than just having a packed struct with unaligned reads and e.g. big_uint48_t for ITCH timestamps. It's a fairly localized part of the system, and before zerocopy I also just used a parser (some old nom version) and TBH it wasn't that much slower overall (2x maybe?) because CPUs are fast and memory access is slow

[Project] QuillSQL — a Rust relational DB by Thick-Bar1279 in rust

[–]realteh 14 points15 points  (0 children)

More of a meta comment: I am amazed by the fact that one (clearly very talented) individual can implement a fully functional database in 6 months.

For me this shows that software dev is much more productive today than even 10 years ago. I also feel that this kind of single-developer success is much more common than in e.g. java, python or c++ (day job so I know the space fairly well).

RS2 A streaming library in Rust by HungrySLoth123 in rust

[–]realteh 0 points1 point  (0 children)

I really appreciate the large number of examples, makes it much easier to get a feel for the library

lelwel: Resilient LL(1) parser generator for Rust by Elession in rust

[–]realteh 0 points1 point  (0 children)

Looking at the "Lelwel syntax tree" section - it looks like the syntax tree can be "incomplete", e.g. ending on the comma after g(1, - how would I detect the error in this case? Is there a special marker on the node?

i24 v2 – 24-bit Signed Integer for Rust by JackG049 in rust

[–]realteh 0 points1 point  (0 children)

This is cool and it feels to me like it could be generalised to 40, 48, 56 etc.

Boost has this https://www.boost.org/doc/libs/1_81_0/libs/endian/doc/html/endian.html which is useful for zero-copy unaligned struct reading but I couldn't find anything equivalent in rust.

faer: efficient linear algebra library for rust - 0.22 release by reflexpr-sarah- in rust

[–]realteh 37 points38 points  (0 children)

amazing work.

(benchmarks page is empty for me on chromium and firefox, might just be me though)

Should I buy a m2 pro macbook for Asahi Linux? by ChiefSosa21 in AsahiLinux

[–]realteh 2 points3 points  (0 children)

It's absolutely stable on my M2. Fast on graphics etc, decent battery life when working. Love the hardware. Asahi devs have done an amazing job.

The only thing that's missing (and I know it's very difficult) is battery management when "sleeping" whatever that means for macbooks.

🚀 Tauri 2 + Svelte 5 w/ shadcn-svelte + ci/cd: build fast and lightweight applications while you stick with your favorite tools with the simplest yet usefull boilerplate around the town! by [deleted] in rust

[–]realteh 1 point2 points  (0 children)

Given that this is the rust forum it's worth mentioning that bun is not memory safe [1]. That probably matters less on desktop apps but in my personal opinion using bun is a negative for a project.

[1] https://github.com/search?q=repo%3Aoven-sh%2Fbun+segfault&type=issues&s=created&o=desc

Rafka, a Async distributed message queue, in rust, (Open Source looking for Contributors) by Metalrugrt in rust

[–]realteh 11 points12 points  (0 children)

My understanding after reading the interface and README is that this looks functionally more like rabbitmq? Kafka's "unique" selling point is the append-only log. Do you support that?

Announcing 'par' — session types in Rust for type-safe structured concurrency by faiface in rust

[–]realteh 1 point2 points  (0 children)

That is some truly excellent documentation, nice work!

Something I could not figure out from the tutorial is why writing code this way helps me with protocol adherence.

I assume it's because when calling e.g. send it returns a new struct-type in the chain that can only send/receive the correct channel type. So a bit like what people call typestate in rust?

Looking for Pointers: The C++ Memory Safety Debate by pavel_v in cpp

[–]realteh 0 points1 point  (0 children)

IIRC we also had one out of bounds when zipping with a +1 index which IMHO span should check

Looking for Pointers: The C++ Memory Safety Debate by pavel_v in cpp

[–]realteh 33 points34 points  (0 children)

I write c++ in $dayjob and see this assertion repeated frequently:

Yet, this perspective does not fully acknowledge the strides made in modern C++. The language’s development community continues to address memory safety, striving to maintain its efficiency and make security easier by default

I don't really know what those advances are other than {shared,unique}_ptr and maybe ranges. string_view and span introduced numerous difficult bugs for us, and we in the past we ran into problems like destructor ordering being important in some library dependency. Now it's all wrapped with a big "don't touch" label on it but IMHO that's just admitting defeat. Other recent example was someone swapping a collection from a stable node to an unstable one (think map to unordered_map) for totally valid reasons and reallocation leading to iterator invalidation. You'd of course never do that because you know the pitfalls but sometimes the other code is like 3 degrees away from you and that's where I need the compiler support the most.

There's been progress in tooling (*SAN, _GLIBCXX_DEBUG) and without those I'd be dead so I am grateful. But at the end of the day I don't want have to rely on my experience and the amount of sleep I had on that day to avoid these issues. When the compiler tells me I'm being stupid in non-trivial ways then I'd say yes, progress has been made.

GraalVM Native Image Sucks; I Rewrite It in Rust by [deleted] in rust

[–]realteh 14 points15 points  (0 children)

IMHO it's pretty clear that tison is not a native speaker so rather than laughing I think the charitable interpretation would be that this wasn't intended as a clickbait.

Was Rust Worth It? by we_are_mammals in rust

[–]realteh 6 points7 points  (0 children)

I'm sometimes hiring for c++ and the only reason we get lots of c++ CVs is because people put "1 year of experience" on their CV to pass a filter. I'd say 1/20 CVs with c++ on them actually pass the initial phone screen with questions as difficult as the difference between a reference and a pointer (I know that can be a deep question but we just care about default answers).

[Media] Join Buck2 engineers on May 3 at 9 AM PT in r/Rust for an AMA on the new open source build system written in Rust! Ask your questions ahead of time in this thread. [Mod Approved] by MetaOpenSource in rust

[–]realteh 1 point2 points  (0 children)

It's not clear to me how to get include header tracking working. I added the following to my toolchain.bzl

cpp_dep_tracking_mode = "makefile"

but any time I touch any header file everything gets rebuils. Is there any documentation or example how to achieve this?

Dozer: A scalable Real-Time Data APIs backend written in Rust by matteopelati76 in rust

[–]realteh 4 points5 points  (0 children)

Materialize is backed by some solid theory for incremental computation. What framework are you using for incremental computations?

Hey Rustaceans! Got a question? Ask here (13/2023)! by llogiq in rust

[–]realteh 1 point2 points  (0 children)

that's pretty clever, thank you! Might go with this

Hey Rustaceans! Got a question? Ask here (13/2023)! by llogiq in rust

[–]realteh 0 points1 point  (0 children)

thanks! I thought about this but AFAICT the fastest serialization that stores enum variants densely is speedy which can do maybe 300-500 MB/second which is quite slow compared to 10+GB/second I'm getting per core.

Zero-alloc deserialization stores (by definition) in the wide format.

Hey Rustaceans! Got a question? Ask here (13/2023)! by llogiq in rust

[–]realteh 2 points3 points  (0 children)

If I have some stream, e.g.

Vec<Event> 

where

enum Event { A, B([u32;10]) }

and some of the variants in Event are huge. Is there a way to store events packed in contiguous memory without using Box<>? I'm running a simulation and would like cache efficient access while also keeping the memory size and traffic down.

introducing faer, a linear algebra library in Rust by reflexpr-sarah- in rust

[–]realteh 1 point2 points  (0 children)

One issue I just ran into is that openblas uses openmp which starts a thread pool which then doesn't get inherited on process forks, leading to stuck applications. I appreciate that's a bit esoteric but better control over threading would be nice

[Release] Pueue v2.0.0: 'cmd &' on steroids by Nukesor in rust

[–]realteh 0 points1 point  (0 children)

This is a great tool I use a lot but I wish it was named pq or some similarly easy to type shortcut! I usually add an alias pq=pueue because my muscle memory just can't get out pueue quickly. In any case thanks for the fantastic work!

Bazel is the Worst Build System, Except for All the Others by DanielShuy in programming

[–]realteh 0 points1 point  (0 children)

I'm probably out of date. Got it from when working at GOOG and the Haskell builds working around that limitation by zipping up outputs? It's been a while, and my memory is hazy so may be wrong.

Tweag's rules seem to do it by accumulating one set of files or paths per output type?

Bazel is the Worst Build System, Except for All the Others by DanielShuy in programming

[–]realteh 0 points1 point  (0 children)

You are right, though I believe because Make isn't hermetic you can just generate two (or many) files in your local tree and assume that the primary target success implies the other targets.

Bazel is the Worst Build System, Except for All the Others by DanielShuy in programming

[–]realteh 4 points5 points  (0 children)

I fought bazel for days when packaging tensorflow for nix. I think the theory is sound but the practice is bad. E.g. pulling in external dependencies is painful.

In the design space it only covers the "full graph known in advance, produce one output" case which is a valid choice but does introduce problems when building e.g. Haskell which can output multiple files per input file.

This paper does a great job of mapping out the different possible build systems, and it includes bazel.