3 ms·
These are just experiments on the margins. In each case, the flagship languages are not implemented on top of GC'd runtimes or interpreters. Apple's Objective-C
by millstone 10y ago
These are just experiments on the margins. In each case, the flagship languages are not implemented on top of GC'd runtimes or interpreters. Apple's Objective-C and Swift runtimes are both C++. Microsoft's C# CoreCLR is C++. Google's V8 and Dart have runtimes written in C++. Oracle's HotSpot is C++. Go's core runtime is in a Go-minus-GC subset.
It didn't have to be this way - Swift could have been written atop the JVM, v8 could have been implemented via Boehm, etc. For whatever reason, when it counts, the stuff under the hood doesn't use garbage collection.
- pjmlp 10y agoThe question was "What interpreters did these orgs write in GCed languages?". It doesn't matter where those interpreters are being used, the fact is that they exist. > Microsoft's C# CoreCLR is C++. Yes, but they have moved their compilers to C# with the Rosylin project with MDIL and .NET Native moving more code to C# side. Also check the Phoenix compiler framework, a LLVM like project from MSR using C#. > Go's core runtime is in a Go-minus-GC subset. Of course, there needs to exist a Genesis for the GC, but once it is there, 99% of the remaining infrastructure makes use of it. If you take Nashorn engine running on Jikes, it is an 100% Java stack running a JavaScript interpreter. > For whatever reason, when it counts, the stuff under the hood doesn't use garbage collection. Most of the time it is just building on top of whatever already exists instead of starting from scratch. Taking Swift as an example bootstraping the language would increase the burden designing it, as they are still far from fully stable design. If they would throw away in man years invested into the LLVM, which happens to be written in C++, it would take ages before pure Swift compilers would ever manage to catch up. However these shortcuts open the door for those not savvy in compiler design to use as ammunition against secure languages.
- millstone 10y ago> Yes, but they have moved their compilers to C# A compiler is a different matter. GCed languages are very compelling for static compilers. Even gcc uses GC internally. The claim is that GCed languages make for poor interpreters - and also poor JIT compilers and runtimes. > If you take Nashorn engine running on Jikes, it is an 100% Java stack running a JavaScript interpreter Nashorn gets participation points, but it's not competitive with any of the major JS engines, all of which have C++ runtimes. > Taking Swift as an example bootstraping the language would increase the burden designing it, as they are still far from fully stable design. If they would throw away in man years invested into the LLVM, which happens to be written in C++, This still confuses the compiler with the runtime. The Swift compiler is indeed written in C++ using LLVM, but it could have easily been written in a GCed language without affecting much of anything. But the runtime is separate, and it also happens to be written in C++. It's possible to imagine the Swift runtime written in a GCed language, but that is not what Apple chose to do.
- pjmlp 10y ago> The claim is that GCed languages make for poor interpreters - and also poor JIT compilers and runtimes. Have you ever spent time with Graal, Truffle, PyPy? 30 years ago I used to take the flak for arguing about C++'s suitability for writing programming language tools in comp.compilers instead of C. Yet here we are praising C++ virtues over other languages for writing interpreters and JITs. One thing I learned in all those years reading compiler related papers, is that many times the main issues are actually human and not technical. The majority just want to have something running, and take the shortcut of using whatever works to achieve their goals, instead of taking the effort that might bring the technology forward but would delay getting everything to work.