6 ms·
I agree. The author seems to know quite a bit about Go and GCs, but doesn't seem to have much experience with Java. As a Java performance engineer, it sounds
by sam_bishop 5y ago
I agree. The author seems to know quite a bit about Go and GCs, but doesn't seem to have much experience with Java. As a Java performance engineer, it sounds like he is comparing Go to how he thinks Java works based on what he's read about it.
- pjmlp 5y agoAdditionally he doesn't seem to know that much about C#, which also has advanced GC, while allowing for C++ like memory management, if needed.
- bullen 5y agoIt's odd how most people that haven't used a VM with GC are amazed by Go (no VM) and WASM (no GC) but still fail to understand that with a GC _AND_ VM you can code something that doesn't crash even if you make a big mistake! And they haven't even bothered to try it out! To use anything other than JavaSE/C# on the server you really need very good arguments!
- pjmlp 5y agoOr being amazed by Go's compile speed, when Turbo Pascal and Object Pascal compilers were already doing that in the 1980's, or finding WASM innovative when polyglot bytecodes with no GC also go back to the early 1980's, like Amsterdam Compiler Kit EM as one example among many.
- vinkelhake 5y agoThe innovation in WASM is more about getting all the major players in the browser space to agree and support it as a first-class citizen in the web stack. That polyglot bytecodes existed in the early 1980's does nothing for the web.
- bullen 5y agoWhat a perfect example, have you even tried Java? I'm guessing you are coding for the client? C++ arrogance is the problem here. About the pipe dream of WASM there are 3 problems: 1) Compile times (both WASM and the browser) 2) If you thought Applets where insecure (btw they wheren't) wait until the .js (also a VM with GC...) bindings that you are forced to go through to reach anything from WASM securely gets attention! 3) If you build for the browser you have Intel, Nvidia, Microsoft and Google (do you work there, might explain things) to deal with on Windows. You DON'T want that... use C to build for linux on ARM/RISC-V has to be one of your options and then all that work you spent on getting WASM to work is wasted. (because you won't have the performace/electricity/money for the cycles you need in the long term) Edit: Please don't replace Python (that you should probably never have touched) with Go...
- thrashh 5y ago1) No one was realistically compiling C++ or Python to Java though. WASM is not new tech as the other poster said — it’s people coming together to support one compile target that also works on the web, which itself is the crowning achievement. 2) Building a secure VM is easy. You only need to give it access to things it should have access to. If a VM has only math instructions, it’s not going to access the file system. My computer can’t poke my nose because there is literally no machine instruction for it. Java did not build its VM that way. Instead, the JVM had full access to everything and individual functions were blacklisted within Java applications and this was enforced by Java code running in the same machine as the attacker’s code. Naturally every blacklist works like a sieve.
- bullen 5y agoWhen I think about it, the memory security is probably the weakest point of WASM and probably also the reason nothing of value has come out of that initiative yet. How does WASM protect memory? Or maybe there is something valuable made in WASM and I don't know about it, Figma is I think, but I'm not in the target audience.
- zerocount 5y agoI just wrote some Go last weekend and the compile time was very slow. It reminded me of Scala. Any way I switched to Ruby and didn't have to deal with it any more. Turbo Pascal really was fast, but I don't see that in Go.
- vips7L 5y agoScala and SBT are some of my biggest productivity killers. They murder my machine and take years to do compile.
- unscaled 5y agoNot to mention Turbo Pascal was compiling faster than Go, on a single-core, in-order 20Mhz PC...
- fnord123 5y ago> To use anything other than JavaSE/C# on the server you really need very good arguments! Haha! Quoting this so you can't delete it.
- mappu 5y agoMost programmers use PHP, Python, Ruby, Node.js which are all GC bytecode VMs. What language are you imagining as an argument here?
- omnicognate 5y agoC# makes it possible to do C (not C++) like memory management but it does not make it easy. Unsafe C# code is really, really, really unsafe, much more unsafe than equivalent C code, and does not compose well. It's improving, with Span/Memory, etc, but it remains an absolute last resort.
- legulere 5y agoThere's also ref which is almost like pointers and safe. Span/Memory do not remain an absolute last resort, they are becoming the standard way for string formatting/parsing/(de)serialization and IO.
- omnicognate 5y agoI didn't say Span/Memory are a last resort, I said C style memory management (AllocHGlobal/Free), despite being somewhat improved by Span/Memory, remains an absolute last resort. Span/Memory aren't primarily aimed at handling unmanaged memory, though they're useful for it.
- pjmlp 5y agoOf course C style memory management is a last resort, 99% of devs don't need it, and the 1% that actually need it, better learn to use V-Tune.
- pjmlp 5y agoC and C++ memory managements are alike, C# doesn't need reference counted library types. If you mean RAII, they can be easily done with IDisposable, using and Rosylin analysers that throw errors when usings are forgotten. And yes, manually memory management should be last resource, proven by profiler data.
- omnicognate 5y agoI do mean RAII, which is fundamental to C++. Memory management without it is not "C++ like". IDisposable is not a substitute for RAII, and C# has nothing that can manage ownership in equivalent ways as it lacks deterministic destruction. Implementing, for example, a data structure based on unmanaged memory in C# in such a way that it can be safely used by code outside the library without undermining the safety of the language (i.e. without introducing the possibility of programming errors outside the data structure implementation causing leaks or memory corruption) is an exercise in discipline and requires a thorough understanding of the runtime - eg. knowing that an object can be garbage collected while a method on it is executing. I know this because I've done it (as a last resort after extensive profiling and production use of various optimised, managed versions of the library).
- deleted 5y ago[deleted]