Just because a language has a GC, doesn't mean it doesn't have language features to have more fine grained control over how memory allocation takes place, or even when the GC has to run if at all.
Re:Rust in 2018: easier to use
by littlestymaar on Sunday January 14, 2018 @07:31AM
(#16143991)
In that case it's no different from Rust, Rust has a GC option (ref counting). It's limited and opt-in then you still carry the cognitive burden of memory management, you have to think when to use it. But if you need that level of control, you'll need to think about memory anyway.
And in my experience, it's way easier to reason about allocations in Rust that it is in Java (automatic type erasure if you want to use generic code) or Go (how will escape analysis behave in that case ?) for example. Rust traits are way better than C++ interfaces in that regard also.
Java and Go are just two examples, and surely not those that I had in mind.
Rather languages in the Oberon and Modula family, D, Nim, Eiffel, C# as of 7.2, Common Lisp, and a few MLs.
If you do RC everywhere, using library types, it is slower than a tracing GC, and still not as productive.
Re:Rust in 2018: easier to use
by seanmcdirmid on Sunday January 14, 2018 @09:40AM
(#16144414)
UWP has ref counting, garbage collection (via C#), and stack allocation. It does native compilation to boot, unfortunately it isn’t quite universal.
And is built on an improved COM, thus requiring first class support for it, by any language targeting UWP.
Re:Rust in 2018: easier to use
by seanmcdirmid on Sunday January 14, 2018 @11:02AM
(#16144778)
Ya, that’s right. But I think this is only C++ and C# at the moment.
JavaScript on Chackra's engine, VB.NET, C# and C++. F# support is still to be done, due to how .NET Native handles MSIL.
Borland was in the process of doing it for Delphi and C++ Builder, but I don't know the current state. Originally they were only replicating the Metro UI, back on Windows 8.
Re:Rust in 2018: easier to use
by trumpsamerica on Sunday January 14, 2018 @12:05PM
(#16145020)
Isn't it universal windows? :)
But that's not the only constraint. If you want to save memory, due to the environment you run on, or your workload, a non-GC runtime can be pretty awesome.