3 ms·
Well Rust also has certain aspects of “automatic resource management”. You can run into execution deadline issues with allocation or reallocated (drop) in Rust.
by elcritch 2y ago
Well Rust also has certain aspects of “automatic resource management”. You can run into execution deadline issues with allocation or reallocated (drop) in Rust. The patterns to avoid this in critical areas is largely the same in any of the languages you listed.
Though I like using effect systems like in Nim or Ocaml for preventing allocation in specific areas.
- pjmlp 2y agoYou can even run into execution deadlines with malloc()/free(), that is why there are companies that made business out of selling specialized versions of them, and nowadays that is only less of a business because there are similar FOSS implementations. The point is not winning micro-benchmarks games, rather there are specific SLAs for resource consumption and execution deadlines, is the language toolchain able to meet them, when the language features are used as they should, or does it run out of juice to meet those targets? The recent Guile performance discussion thread is a good example. If language X does meet the targets, and one still goes for "Rewrite XYZ into ZYW" approach, then we are beyond pure technical considerations.
- throwaway2037 2y ago> The recent Guile performance discussion thread is a good example. Sounds very interesting. Can you share a link?
- itishappy 2y agoOptimizing Guile Scheme https://dthompson.us/posts/optimizing-guile-scheme.html https://dthompson.us/posts/optimizing-guile-scheme.html https://news.ycombinator.com/item?id=41600903 https://news.ycombinator.com/item?id=41600903
- redman25 2y agoMost GC languages give you limited control over "when" garbage collection or allocation occur. With non-GC'd languages you can at least control them manually based on data structure choice (i.e. arenas), lifetimes, or manual drops.
- throwaway2037 2y agoDo you count Python, where the ref impl (CPython) uses reference counting, as a GC language? If yes, you have a better idea when GC will occur compared to non-deterministic GC like Java/JVM and C#/CLR.
- neonsunset 2y ago.NET has a few runtime knobs to control GC behavior at runtime: GC.TryStartNoGCRegion - https://learn.microsoft.com/en-us/dotnet/api/system.gc.trystartnogcregion https://learn.microsoft.com/en-us/dotnet/api/system.gc.tryst... GCSettings.LatencyMode - https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/latency https://learn.microsoft.com/en-us/dotnet/standard/garbage-co... The latter is what Osu! uses when you load and start playing a map, to sustain 1000hz game loop. Well, it also avoids allocations within it like fire but it's going to apply to any non-soft realtime system.
- neonsunset 2y agoThese are not mutually exclusive. In some GC-based languages these techniques are immediately available and some other languages take more abstracted away approach, relying more on the underlying runtime.
- pjmlp 2y agoAll of those options are available in Swift, D, C#, F#, Linear Haskell, OCaml with effects. Only pointing out the ones relevant in 2024, and not the whole CS history.