Re:Go channels, goroutines and GC available in Nim
by vvanders on Monday June 01, 2015 @08:14PM
(#9643067)
> Look at how game developers have demanded shared memory in JavaScript
Have a source for that? I find it pretty dubious.
If you're looking to multicore for performance with javascript then you're using the wrong language. Correct memory layout and access patterns will give you a real-world 50-100x win.
Re:Go channels, goroutines and GC available in Nim
by pcwalton on Monday June 01, 2015 @10:42PM
(#9643523)
Source: I work directly with people who interact with game developers who are asking for it.
Look for asm.js threads on HN: virtually every time it shows up someone brings up shared memory multithreading.
SharedArrayBuffer is the direct result of this popular demand: https://blog.mozilla.org/javascript/2015/02/26/the-path-to-p...
Of course, you shouldn't use shared memory unless you need it. But often you need it. Look at how game developers have demanded shared memory in JavaScript, for example. Modern multicore CPUs do a lot of work to make shared memory work, and work well.
> Most games use worker-queues(in which case you can use non-GC objects) to deal with architectures like the CELL and for better cache coherency.
I agree with you that GC is often not the best solution for shared memory concurrency. But I think you really need to design the language around "no GC" in order to make that really ergonomic relative to C++. The entire C++ language and library ecosystem is based around making manual memory management (relatively) easy to use; going back to malloc and free is a hard sell.