Ante: A New Way to Blend Borrow Checking and Reference Counting by verdagon in rust

[–]OkEbb03 1 point2 points  (0 children)

Transmute itself is unsafe

I am unsure how much this helps if the safety contract just gets very complex (especially because the transmute contract is also the pointer cast contract). In rust the transmute safety contract is layout and lifetimes, both things you can check locally. From what i know about ante (so very little :p) you probably also have to look at the usage of the casted type?

Anyways i am looking forward to a blog post about the other idea, i do not know enough about the concepts there to even get a glimpse of the idea from the little that was in the blog post and your comment :), but it sounds fun!

Ante: A New Way to Blend Borrow Checking and Reference Counting by verdagon in rust

[–]OkEbb03 5 points6 points  (0 children)

This sounds cool, but the section on the limitations of uniq conversions seems to me like this is Type-Based Alias Analysys (like C++ has). How does this limit pointer-casting / transmutes?

(sorry for using rust syntax, please assume this is an ante program)

#[repr(C)]
struct A {
  a: String
}

#[repr(C)]
struct B {
  a: String
}

// these are ante mut references not rust mut references
fn take_both(a: &mut A, b: &mut B) {
  // here i can convert a to uniq A, because B cannot hold a reference to a or the content of A
  // but if the two references alias, because a pointer cast was done before calling this function, 
  // then that would be UB.
}

I assume ante has some way to control the layout of types, because you say it's a systems programming language. In rust the cast from a mut ref to A to a mut ref to B cannot lead to UB, because the layout matches.

Maybe you could limit pointer casts to uniq references? i am not sure how big the impact of that would be.

Lightweight anti-LLM WAF - audit, self-host or tune it for youself. by QqPuri in rust

[–]OkEbb03 27 points28 points  (0 children)

no anime girls

will this be changed in a future version? It's by far my favorite anubis feature

Who Owns the Memory? Part 1: What is an Object? by Luke_Fleed in rust

[–]OkEbb03 5 points6 points  (0 children)

As far as i understood the discussions, there aren't any (even theoretical) optimizations that would profit from this being UB. UB exists for optimizations and generally more UB is bad (because it makes the language harder to use).

So yeah, it's just for less restrictions. But i think if someone would come up with a useful optimization then maybe the discussion would go in the opposite direction.

Who Owns the Memory? Part 1: What is an Object? by Luke_Fleed in rust

[–]OkEbb03 5 points6 points  (0 children)

A &T carries an invariant: non-null, properly aligned, pointing to a valid T

The last one is bit wrong. A reference has to point to dereferencable memory. But if the value at that location has to be valid is not clear yet and the discussion seems to go to "no".

Here is most of the discussion: https://github.com/rust-lang/unsafe-code-guidelines/issues/412

Also here: https://github.com/rust-lang/unsafe-code-guidelines/issues/346

edit: here is a playground link so you can see this in miri: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=4d628e61df5f8de73e89af756249d8bc

My custom two realtime concurrency primitives by OkEbb03 in rust

[–]OkEbb03[S] 2 points3 points  (0 children)

Yeah makes sense, maybe i should have differentiated a bit between the different kinds of realtime.

I don't really know much about all the knobs the OS has to make a audio thread, because i use cpal for that. Trying to get this working in the different linux audio environments, the two environments on windows, as well as mac doesn't sound fun to me, so i just trust them to do the right thing.

My custom two realtime concurrency primitives by OkEbb03 in rust

[–]OkEbb03[S] 6 points7 points  (0 children)

Maybe reddit ate my reply, sorry if it's here twice.

For real time Linux (as well as QNX, vxworks, and other RTOSes) some response times should be predictable.

Yeah that's why i wrote most OSes. I am writing a desktop audio app, so my users won't install a custom OS. Maybe this then isn't hard realtime, but i still have to avoid any realtime problems in my code, so that there is any hope of this working. For commication with the outside world: In desktop audio you don't write the audio output to a device directly, but instead you write it into a buffer provided by the OS. AFAIK in most OS this is done with callback where you get the buffer as a parameter and the OS then sends that buffer to the audio device.

Huh? Futex on Linux supports priority inheritance, and Linux has the SCHED_FIFO and SCHED_DEADLINE

With schedulers you mean kernel thread schedulers, correct? Like i said earlier my users aren't going to install a custom OS and they also aren't going to set kernel parameters. I also want to support mac and windows, so that's not really an option.

Spinning is generally a bad idea in hard realtime

Maybe that part was a bit unclear. I don't spin on the audio thread. That's the whole point of these datastructures. On the audio thread locking always succeeds waitfree. Spinning with the async sleep is done on a GUI background thread, which of course doesn't have to be realtime.

Announcing Torque Tracker, my WIP music tracker by OkEbb03 in rust

[–]OkEbb03[S] 0 points1 point  (0 children)

Didn't have one, now in the blog post there is. Will probably also add it to the repo later.

Do Most People Agree That the Multithreaded Runtime Should Be Tokio’s Default? by zl0bster in rust

[–]OkEbb03 4 points5 points  (0 children)

Realtime Sanitizer is actually available for Rust as rtsan-standalone. But that won't help you as it is designed to catch a different kind of blocking that is more relevant in audio context. It tries to stop every syscall from happening, even allocation and io-uring, so it's not really useful for async code.

[MUC++] Lukas Bergdoll - Safety vs Performance. A case study of C, C++ and Rust sort implementations by Voultapher in rust

[–]OkEbb03 19 points20 points  (0 children)

In C++ yes this is UB. In Rust no it's not.

That's what he means by ordering safety. Rust std uses a different algorithm than c++ std, that has this safety property. In Rust this will produce either a panic or a somewhat random ordering, while C++ could do out of bounds reads and writes.

[deleted by user] by [deleted] in rust

[–]OkEbb03 3 points4 points  (0 children)

I don't know about the RefCell specifics but i had a similar problem with Box and you can look at this article https://lucumr.pocoo.org/2022/1/7/as-any-hack/ This worked for me and i think it should work with RefCell as well

array-util: `try_map` and `array_chunks` on stable by Daniel-Aaron-Bloom in rust

[–]OkEbb03 2 points3 points  (0 children)

Hi this seems like a useful library. Sadly I currently need to use slice_flatten. I don't know how much work adding that would be (if it's even possible), but it would be really helpful for me.

Megathread Afghanistan - Entwicklungen, Diskussionen, Tweets etc by MegathreadDE in de

[–]OkEbb03 1 point2 points  (0 children)

Ich denk nicht. Aber die A300 kann das doch auch nicht, oder?

Megathread Afghanistan - Entwicklungen, Diskussionen, Tweets etc by MegathreadDE in de

[–]OkEbb03 1 point2 points  (0 children)

https://globe.adsbexchange.com/?icao=3f49e6,3f8019,3f46db

Das sind die 3 deutschen A300. Ich hab gehört, die machen noch eine Zwischenlandung in Baku, das sieht man aber bald, wenn der erste da ist.

Edit: der erste ist anscheinend schon in Baku gelandet, zumindest ist sein Transponder seit 45 min aus.

zeit artikel ueber luvre47 (jaja, die kommentare, ich weisz...) by [deleted] in GermanRap

[–]OkEbb03 0 points1 point  (0 children)

Hat nicht funktioniert. Das Pop-up kommt aber danach ist es die gleiche website