digitalmars.D.announce - Very short article with with manual memory management in C++ and D.
- Paulo Pinto (15/15) Feb 06 2013 Hi,
- MattCoder (3/5) Feb 06 2013 Paulo, can you tell why you chose to keep the D code much as the
- Paulo Pinto (9/15) Feb 06 2013 Languages with stronger type checking, and GC capabilities are
- MattCoder (3/5) Feb 06 2013 I get it! Just one more note, would you have done any benchmark
- Paulo Pinto (3/9) Feb 07 2013 Not really, it is very simple code to be worth doing any
Hi, long time ago I wrote a short article about doing manual memory management from C++. http://www.progtools.org/compilers/tutorials/queue/article.html This was based on a job offer I saw in a games magazine. Eventually I ported the solution to D, while keeping the code as close as possible to the original C++ version. http://www.progtools.org/compilers/tutorials/queue/queue.cpp.html http://www.progtools.org/compilers/tutorials/queue/queue.d.html Since these type of small exercises are the only area where I might use D occasionally, are there any issues on the D version that could be improved, while keeping the code as close as possible to the C++ version? Thanks, Paulo
Feb 06 2013
On Wednesday, 6 February 2013 at 09:36:32 UTC, Paulo Pinto wrote:Eventually I ported the solution to D, while keeping the code as close as possible to the original C++ version.Paulo, can you tell why you chose to keep the D code much as the same the C++ version?
Feb 06 2013
On Wednesday, 6 February 2013 at 10:13:49 UTC, MattCoder wrote:On Wednesday, 6 February 2013 at 09:36:32 UTC, Paulo Pinto wrote:Languages with stronger type checking, and GC capabilities are usually looked down by some hardcore C++ developers. I just wanted to show that the pointer tricks for memory management are not an exclusivity from C and C++. Maybe I should present two versions, the current one which mimics the C++ version and an improved version. -- PauloEventually I ported the solution to D, while keeping the code as close as possible to the original C++ version.Paulo, can you tell why you chose to keep the D code much as the same the C++ version?
Feb 06 2013
On Wednesday, 6 February 2013 at 13:16:45 UTC, Paulo Pinto wrote:I just wanted to show that the pointer tricks for memory management are not an exclusivity from C and C++.I get it! Just one more note, would you have done any benchmark test on between both versions?
Feb 06 2013
On Wednesday, 6 February 2013 at 21:35:12 UTC, MattCoder wrote:On Wednesday, 6 February 2013 at 13:16:45 UTC, Paulo Pinto wrote:Not really, it is very simple code to be worth doing any benchmarks.I just wanted to show that the pointer tricks for memory management are not an exclusivity from C and C++.I get it! Just one more note, would you have done any benchmark test on between both versions?
Feb 07 2013