4 ms·
> What if the interleaving was undesirable, would you like some way to be informed that it’s impossible That's like synchronised in Java or any other kind of a
by chrisseaton 5y ago
> What if the interleaving was undesirable, would you like some way to be informed that it’s impossible
That's like synchronised in Java or any other kind of atomic block or serialising block - that's already a thing.
- Retric 5y agoThat information is moving in the wrong direction. I don’t want the programmer to be telling a compiler what to do, I want the compiler to inform the programmer what it did.
- chrisseaton 5y ago> That information is moving in the wrong direction. You set the direction not me! You asked me 'would you like some way to be informed that [the interleaving is] impossible'. Yes... and the user gives me that information through a synchronised block. If they don't tell me they want an interleaving to be impossible then why should I not make it possible? There are countless other interleavings I make impossible or possible when I do any trivial compiler task such as scheduling. Should I consult the user on all of them? I don't think you'd like all the questions you'd get!
- Retric 5y agoInforming the user isn’t about what you did, it’s about the user having some way of knowing what you did. At least compilers give you assembly code to look at, CPU’s are little better than black magic from a programmers perspective.
- chrisseaton 5y agoThe user can dump the compiler output and intermediate structures if they want. Or they could program against the spec and not worry.
- kaba0 5y agoCheck the generated machine/byte code?