Better HN
topnewbestaskshowjobs
Log inSign up

kobebrookskC3

84 karma · joined Apr 15, 2021 (5y ago) · 98 submissions

Submissions

comment 5mo ago · link · parent

china seems to be doing fine. what are you gonna do, tariff the country that makes all your stuff? 100% tariff on iphones and macbooks?

comment 6mo ago · link · parent

> Constructing an invalid pointer in rust is UB

no, it is dereferencing, not constructing, an invalid pointer, that is UB. there is even a safe function provided to construct an invalid but non-null pointer: `https://doc.rust-lang.org/stable/std/ptr/fn.dangling.html`

comment 6mo ago · link · parent

is the fact that CHERI works better with C/C++ because of C/C++'s "anything goes" attitude, or simply that any hardware design that didn't support C/C++ well was discarded?

comment 7mo ago · link · parent

> simply by adding the formal verification that proves the safety which will work automatically

"simply" and "formal verification" are usually oxymorons, never mind "automatically"

comment 9mo ago · link · parent

i was responding this claim

> It would be perfectly possible to design a variant of Rust that gets you to 80-90% of Rust's usability, with the same safety, without macros.

i then present an api that i think relies on macros to expose a safe api

> Of course macros are good for encapsulation and abstraction, but that's a different subject.

no it's not. exposing safe abstractions is pretty much rust's raison d'être

comment 9mo ago · link · parent

but without macros, how would you expose a safe interface?

  fn pin(x: T) -> Pin<&mut T> { ... }
would move the value

comment 9mo ago · link · parent

no, you just missed my point. expanding the implementation is not a safe abstraction. show me how you'd implement the functionality of the pin macro as a safe abstraction.

comment 9mo ago · link · parent

yes, but the code inside is unsafe. the pin macro is like a safe function.

comment 9mo ago · link · parent

the macro uses unsafe inside, so that's another instance of unsafe you'll need to check, whereas the pin macro is like a safe function

comment 9mo ago · link · parent

how would you implement https://doc.rust-lang.org/stable/std/pin/macro.pin.html without macros? a macro is used to shadow the original variable so that you can't move it (safely) after you pin it

comment 10mo ago · link · parent

isn't that more like optimistic concurrency control?

comment 1y ago · link · parent

> and you dont really have the choice - every society you could choose to be in, with the exception of yourself being a dictator, will have such people

in ancient times, you could banish people from the village

comment 1y ago · link · parent

> engineers are expected to read the data sheet

even if you know what the data sheet says, it's easier said than done, especially when the tool gives you basically no help. you are just praying people will magically just git gud.

comment 1y ago · link · parent

in my mind it would be doing what fil-c does for c to unsafe rust: a hypothetical memory safe implementation of unsafe rust using the same methods fil-c does e.g. gc

comment 1y ago · link · parent

what would fil-rust do that miri doesn't?

comment 1y ago · link · parent

> With non-deterministic tests I would always wonder if it's going to fail randomly after the code is already in production.

if you didn't use property-based testing, what are the odds you would've thought of the case?

comment 1y ago · link · parent

it seems like the clean syntax makes the type checker's life harder and so performance is unacceptable. would you rather have clean syntax or acceptable compile times?

comment 1y ago · link · parent

そんな暇ねぇよ

comment 1y ago · link · parent

if it was in c, who knows how many memory corruption bugs would be found before they stumbled upon this...

comment 1y ago · link · parent

they are memory safe

comment 1y ago · link · parent

swift and rust?

comment 1y ago · link · parent

in this example, aren't the scoping rules for c pretty much the same?

what do the annotations for the tool look like? is the analysis local, in that it doesn't look into the bodies of other functions? if it is, surely you would have to have lifetimes and be generic over them.

how much c code satisfies the tool? if there's hardly any c satisfying the tool, there might actually be a larger ecosystem of rust code to use.

comment 1y ago · link · parent

> there are products that offer memory-safety proofs for C

what does the c checked by this tool look like? for an example like https://play.rust-lang.org/?version=stable&mode=debug&editio... , does the tool accept the assignment with f and reject the assignment with g?

comment 1y ago · link · parent

stomping on in-bounds data might result in "nondeterminism", but bounded and not ub, which is unbounded.

comment 1y ago · link · parent

because setting up and using anki is a pain? using and configuring anki is not intuitive. if you're just starting, you'll probably need to find a good premade vocab deck. once that's done, you'll need to make cards. making cards manually is a pita, i would probably not make any if i didn't have a good mining setup (yomitan/ttsu reader/asbplayer). i've spent countless hours getting my mining setup just right (setting up anki and yomitan, tweaking card fields/templates). yomitan probably works well because japanese conjugation is so regular. i imagine for languages with less regular conjugation, it wouldn't be so nice.

comment 1y ago · link · parent

not if the app blocks screenshots

comment 1y ago · link · parent

what happens when the legacy code is migrated to the new java, which is supposedly easier to upgrade post java 8? who will pay for long term support if upgrading is so easy?

comment 1y ago · link · parent

wouldn't byte in rust be more like MaybeUninit<u8>, to account for uninit and pointer fragments?
1234