4 ms·
Great one, I must say I have laughed quite hard at solution, it is logical and simple. Good work. What does annoy me is that GC languages doesnt provide option
by stiray 7y ago
Great one, I must say I have laughed quite hard at solution, it is logical and simple. Good work.
What does annoy me is that GC languages doesnt provide option of allocations that are not handled by GC but still uses language primitives and/or privide option to deallocate them manually. Dev. could decide should they leave alocation to GC or handle them on their own. I would certanly love it, in most programs that I write I know exactly what the lifetime of objects is and I am leaving them to the GC just due to missing any other option.
- mister_hn 7y agoI think you might want to try modern C++ (C++17 and the soon to be released C++20), if memory allocation and lifetime is your major concern. The language has improved itself so much that it's now a better syntax and verbosity
- fileeditview 7y agoI think he wants a GCed language that also allows manual memory alloc/dealloc. Doesn't D offer both?
- mister_hn 7y agoyeah but what's the point of a GC when you want to do manually the operations?
- Dylan16807 7y agoSo that you can put the hottest 5% under [semi-]manual control and let the GC do the rest.
- stiray 7y agoExactly this. :) I am quite familiar with c++ (no expirience i D) but for fast little projects go is great, I wouldnt mind having more control over GC.
- kqr 7y agoC# is "a GC language" and generally has quite good support for explicit lifetime management, through stack allocated value types as well as memory pools and whatnot.
- manigandham 7y agoC# provides this now with all the new Memory and Span constructs to manage memory seamlessly. You can build your own memory pools and allocators to manage lifetimes.
- pjmlp 7y agoHere is a list of GC language that provide capabilities to handle allocations outside GC heap, Mesa/Cedar, Modula-2+, Modula-3, Oberon, Oberon-07, Oberon-2, Active Oberon, Zonnon, D, Nim, C#, VB.NET, F#, Standard ML (with MLKit), Eiffel, Swift. Just the list I tend to keep in mind, there are quite a few others.