3 ms·
I just want to mention that it was delightful working with you. I would definitely recommend anyone invited to come on your show to accept the offer. I've becom
by AndyKelley 5y ago
I just want to mention that it was delightful working with you. I would definitely recommend anyone invited to come on your show to accept the offer. I've become a sponsor of the podcast and I invite others to join me :)
- ncmncm 5y agoMy only question is why nobody can seem to keep track of whether your name is Kelly or Kelley. Even in the podcast transcript it is both. Actually that's not true, I have another question. The single greatest strength of both C++ and Rust is the destructor: it makes them viable. Its lack is all that keeps me from thinking Zig is something I might want to use. Why doesn't Zig have an analog of the destructor / Drop trait?
- jdright 5y agoBecause there is people that think defer is a good solution (which it isn't).
- nusaru 5y agoComing from C, it's a bit better than nothing at all.
- ndesaulniers 5y agoHey hey hey, GNU C has __attribute__((cleanup(fn)))!
- ncmncm 5y agoCompile with a C++ compiler, and suddenly you have a great deal more than nothing. For free.
- flumpcakes 5y agoSome people who use C don't want a destructor like feature for performance reasons. They would prefer everything is cleaned up in some global context rather than each object in a chain of stack frames having to clean themselves up when an error somewhere buried deep in code. I don't have any benchmarks because I don't work on low level code all day, but apparently it can be slow enough that it puts people off using destructors. This isn't a joke. In fact, some people will not use new/delete. Some people will also go further and not even use malloc but prefer to use the syscalls for getting a block of memory directly from the operating system and managing it completely themselves. These are usually the people who don't use the standard library/libc.
- ncmncm 5y agoI do all that in C++: substantial allocations, like ring buffers, are mmapped with a MAP_HUGETLB flag or on /dev/hugepages. And, I use a destructor to unmap them. Suggesting destructors slow down execution really is a joke. The joke is on people who believe it. People will grasp at any straw to avoid need to learn anything new.