3 ms·
> Is there anything that can be done in C that can’t be done in unsafe Rust? Duff's device <https://en.wikipedia.org/wiki/Duff's_device https://en.wikipedia.or
by cesarb 5y ago
> Is there anything that can be done in C that can’t be done in unsafe Rust?
Duff's device <https://en.wikipedia.org/wiki/Duff's_device https://en.wikipedia.org/wiki/Duff's_device>.
- josephcsible 5y agoYou're mixing up a thing you can do with a way that you can do something. You can write Rust code with the same observable behavior as Duff's device in C.
- kaba0 5y agoAlso, Duff’s device is pretty terrible and a modern compiler will output much better code.
- LAC-Tech 5y ago> You're mixing up a thing you can do with a way that you can do something. I don't think they are. > You can write Rust code with the same observable behavior as Duff's device in C. Yes, turing complete languages can do that.
- pjmlp 5y agoA good example of cool tricks to impress fellow hackers that have no place in code bases that should meet certain quality levels of long term maintenance.