Maybe, but you could make the same argument about anything artificial.
13,789 karma · joined February 28, 2014
Maybe, but you could make the same argument about anything artificial.
Also: 5. Async/await is a necessarily evil that allows for extremely high concurrency (10s of millions of concurrent tasks) where stackful coroutines and threads wouldn't practically scale.
Implicit thread safety across async blocks of course break if you introduce actual shared multithreading in the language, while if you have atomic blocks at least you can build transactional memory on top.
With stackful coroutines, the custom validator can transport the error to the original call site, handle it and resume back into the validation library if the error was recovered, or abandon the validation (as with exceptions) if unrecoverable.
With HKTs, the validation library can be agnostic on the specific return type of the custom validator.
Checked exceptions are a form of coloring, while unchecked aren't. But Java (which has checked exceptions) has an escape into unchecked land in the form of RuntimeError, most async languages do not, short of spawning a background thread (for sync->async) or force blocking (async->sync).
Interestingly, Result<T,E> based error models are semantically (and even syntactically, mostly, except for the call-site annotation) equivalent to checked exceptions. Usually these languages have enough abstraction capabilities (HKT for example) to make coloring not an issue, or, again, an escape into unchecked land (for example panic in rust or Go, although the latter hardly counts as having Result-like error handling).
Some statically typed languages (I believe both Haskell, ocaml) have powerful type system that allow abstracting over function types and function colors. Color is not an issue here.
Some other statically typed languages (C#, rust, and C++ (at least with the built-in stackless coroutines)) can abstract over types but not over colors. This is a problem.
Some statically typed languages (Go) do not encode async-ness statically, so it is not an issue[2].
Some dynamically typed languages (scheme, Lua, lisp) also do not encode async-ness statically. Everything is fine.
Finally there are some dynamically typed languages (python, js) that, eskew static types but for some reason still decide to encode async-ness statically. For me this is the most bizarre decision, especially as some of the justifications for static async-ness (performance, memory usage) are less relevant.
[1] for example, a litmus test is being able to implement an higher order function that inherits its color from one of its parameters. Essentially this is the problem of generically turning an internal iterator to an external one.
[2] fundamentally in these languages continuations are first class values that can be passed around, so the asyncness is naturally not bound to the function that created a continuation.
Edit: you can in principle abstract away color in any async language by simply assuming that any function call is async and await it. Then sync functions can trivially be made async. But at this point async annotations no longer convey any useful property: the language might as well implicitly await any function and require call-site annotations for diverging control flow or reentrancy requirements. More practically as languages with async evolve and grow asyncness becomes pervasive and pushes away any sync component.
It is a very generic shape for sure!
The canonical MtG lore is not exactly deep and refined anyway.
To improve error messages, not so much.
(only slightly tongue-in-cheek, I do believe that removing silly things is worthwhile).
enum op_t{ add, mul };
int exec(op_t op, int a, int b) {
if(op == add) { return a+b; }
if(op == mul) { return a\*b; }
}
c = exec(add, a,b);
Should be the compiler be prevented from inlining exec and constant-propagating op and removing the mul branch? What about if a and b are constants and the addition itself is optimized away?Packed structs are dangerous. You can do unaligned accesses through a packed type, but once you take the address of your misaligned int field, then you are back into UB territory. Very annoying in C++ when you try to pass the a misaligned field through what happens to be generic code that takes a const reference, as it will trigger a compiler warning. Unary operator+ is your friend.
Bounding UB would be a nice idea, or at least prohibiting time-traveling UB (and there is an effort in that direction). But properly specifing it is actually hard.
I would say that both A and B would claim to be X and have the "continuous"[1] experience to be X while agreeing that they are distinct persons. I think that the question of whether A or B, both, or neither is the true X, is not a scientific question, and as a philosophical question, a fairly empty one.
Regarding the challenge, I would expect that the consciousness would be forked: there is a "me" that would awake inside the machine and would be very glad to be alive, while the "me" outside would experience dying. This seems to go against the exclusiveness of the experience of being themselves, but assuming the existence of the magically perfect duplication, both would be valid experiences and again neither could make a claim about being the real me. I don't find this to be a contradiction.
An interesting question would be whether consciousness can be reunited after being forked.
But all of these scenarios have been explored extensively. Are you familiar with the Egan's "Permutation City"?
edit: I was not familiar with the functionalist position, but for the little I read, it seems to me that it is just a variant of the monist position. You could say I'm a functionalist I guess. Also I believe that we are fundamentally in agreement and we might just disagree with definitions of words.
[1] what does "continuous" even mean? Do one have a "continuous" experience of being yourself after a night's sleep? After anesthesia? After a coma?
I think that C had members, so members that are functions just became that. But then again, members that are types are usually called nested types.
Transpose.
How's that a problem? They would both be distinct selves with a common past.
> It says "something" survived the utter complete destruction of the physical body and was "put back in it" once it was reassembled. If "it" survived the complete physical destruction of the body, it must be somewhere else, detached from the body.
The information of how to put your body and mind back must have survived somewhere, in the alien mind for example or the machine they used. But the information would still be in (a medium in) this universe and bound to this universe physical laws. I would say this is still a monist position.
A true dualist believes that consciousness survives outside of a medium in this universe.
And it is given that not all requirements will have been discovered before a development start or that they may change during development.