3 ms·
That depends on whether you find having to manage memory more of an impediment, or whether you find not having easy access to imperative constructs more of an i
by nicoburns 6y ago
That depends on whether you find having to manage memory more of an impediment, or whether you find not having easy access to imperative constructs more of an impediment.
- pjmlp 6y agoPeople keep forgetting that GC enabled languages like F#, Haskell, D, C#, OCaml, also provide mechanisms to fine tune memory allocation, its location on the stack and global memory segments besides GC heap, and even native heap. Additionally some of them, like Haskell being discussed here, are also extending their type systems to provide Rust like guarantees for resource management, for the 1% uses cases where it really matters. As for my short experiments doing graphics programming with Rust, it is naturally an impediment, that proves the point that Rust place is as systems programming language filling the same role as C++ on Android, UWP or Apple platforms, the low level drivers, compiler toolchain, windows system compositor.
- nicoburns 6y agoIt definitely depends on your domain. For web servers I've found there's little to no overhead for doing it in Rust.
- pjmlp 6y agoIt is still something that everyone using the language have to deal with, regardless how little it is. Whereas with automatic memory management languages, if and only when it becomes an hurdle, the performance expert can pick up a profiler and only optimise what is required. Using .NET as example, then one can think about struct vs class, new vs stackalloc vs Marshal.AllocHGlobal, direct arrays vs Span<>. Or based on experience, already pick the right data structure and memory location right from the start.
- nicoburns 6y agoMy point is that there are other things in other langauges that you similarly always have a to deal with. For example, in Haskell writing impetative code is a pain. Not impossible, but difficult. In C# there are no Sum Types, so expressing an "or" data structure is difficult. Which of these things you find to be more of an impediment is somewhat subjective.
- pjmlp 6y agoExcept that .NET is a polyglot runtime, F# is also an option with the same low level programming capabilities as C# to do C like low level programming, and it has sum types. I just gave one concrete example, among many possible ones.
- deleted 6y ago[deleted]