Remix.run Logo
theamk 4 hours ago

> Ü uses RAII for memory and resources management (no GC is involved), but manual memory management may be still used in unsafe code.

Saying "using RAII for memory management" is insufficient - with just RAII, you cannot even assign a class into a passed-in variable. The language designer _must_ make make more choices to get a useful language - maybe affine types, or linear types, or prohibit many C++-like idioms, or maybe just good-old refcounted shared pointers (but I'd argue this is a form of GC...)

> Ü is memory-safe and race-condition-safe, as long as no unsafe code is involved at all or as long as unsafe code is correctly written.

How is this achieved? The docs mention in passing that there is some sort of thread-safe immutable structs, but it is not really clear what's the overall picture and how they interact with non-trivial code. And the examples have nothing on thread.

TheCycoONE an hour ago | parent | next [-]

It reads like affine types to me https://panzerschrek.github.io/U-00DC-Sprache-site/docs/en/r...

They borrowed heavily from Rust here.

zabzonk 2 hours ago | parent | prev [-]

> Saying "using RAII for memory management" is insufficient - with just RAII, you cannot even assign a class into a passed-in variable.

What exactly do you mean by " assign a class into a passed-in variable"? Please post some code illustrating what you are talking about.

theamk an hour ago | parent | next [-]

     function make_widget(parent& x):
       w = new Widget()
       x.children.add(w)
RAII is not going to help you here, you need something else (move semantics or refcount-based GC are most common, but other choices exist too).

If this one is too easy, make function return "w" as well, or make it add a widget to two different lists

an hour ago | parent | prev [-]
[deleted]