4 ms·
>Just like the JVM and CLR I guess. (List_of_JVM_languages, List_of_CLI_languages) I don't see JVM & CLR even with the dozens of language choices on top of the
by jasode 7y ago
>Just like the JVM and CLR I guess. (List_of_JVM_languages, List_of_CLI_languages)
I don't see JVM & CLR even with the dozens of language choices on top of the virtual machine runtimes as giving you ways to do "bare metal" programming. I guess one could arguably squint and say Java's JNI or C# P/Invoke and "unsafe{}" gets you some "bare metal" capabilities but that's a stretch.
I go back to the gp's sentence: "Imagine starting a project in an easy language, then migrating pieces to a faster "bare metal" language as needed in a super piecemeal way."
For example, JVM/Java doesn't have value types[1] (yet) and that's required for programmer's control of exact and efficient memory layout for many bare metal domains. It doesn't matter what flavor of JVM language you use because you're ultimately limited by the JVM's capabilities which causes excessive pointers to pointers which is inappropriate for some high-performance code.
In C#, some future tech like CoreRT might open up some more "bare metal" programming possibilities but that's not production yet[2]. I remember you couldn't even develop a Windows Explorer right-click menu shell extensions in C# because it was a bad idea to load up 2 different versions of the NET Framework runtimes (until NET 4.0). That's not even that low a level of programming and yet C++ had no such limitation.
I use C# as much as I can but I still have to do 50% my projects in C++ because JVM/CLR are not "bare metal" enough.
[1] https://en.wikipedia.org/wiki/Criticism_of_Java#Compound_value_types https://en.wikipedia.org/wiki/Criticism_of_Java#Compound_val...
[2] https://github.com/dotnet/corert#user-content-net-core-runtime-corert https://github.com/dotnet/corert#user-content-net-core-runti...
- pjmlp 7y agoSince when is WebAssembly bare metal?!? Apparently you missed the Windows 8, 8.1 and 10 train regarding your "bare metal" compilation from C# and VB.NET code. .NET 4.0 was released in 2008 and I have been able to use C++ as .NET language since 2001, so .... In fact one of my first .NET projects, in 2002, was to integrate C++ RPC library into Managed C++, long replaced replaced by C++/CLI with .NET 2.0 release. Going back to Java, IBM, Aicas, PTC, Gemalto will happily sell you Java compilers that generate AOT native code for embedded deployment targets, not to mention what is running on my phone, where 95% of the OS APIs are exposed only via Java and where your beloved C and C++ code needs to use JNI to access them.
- jasode 7y ago>Since when is WebAssembly bare metal?!? Not sure what that is referring to. >C++ as .NET language We seem to be talking about 2 different things. Using "C++" style syntax (C++/CLI) in a managed language with GC is not what many systems programmers call "bare metal". I thought it was clear from context that my mention of C++ is traditional "real C++" such as gcc/clang/MSVC and not the C++/CLI. >Going back to Java, IBM, Aicas, PTC, Gemalto will happily sell you Java compilers that generate AOT native code But that's not the JVM runtime though. The JVM is what you originally wrote and that's the scope of what I was replying to: ("Just like the JVM and CLR I guess. (List_of_JVM_languages ...)") The _JVM_ doesn't really give you low-level bare-metal programming and it doesn't matter what flavor of JVM-language you choose to run on top of it. And at the risk of further muddying up the discussion with the tangent subject of Java AOT... do any of those Java compilers give true value type semantics or is still references with pointer chasing? I'm not familiar with those compilers. >and where your beloved C and C++ code "beloved"?!? Can we tone down this down a bit? I'm just trying to clarify that JVM & CLR really don't span the entire spectrum of programming all the way down to "bare metal" in the way low-level programmers are typically using that phrase. I thought I was making a neutral and factual statement. I.e. I'm not interested in an emotional flamewar.
- AsyncAwait 7y agoIf I had to guess, I'd say OP meant that just like CLR or the JVM, WebAssembly couldn't be used to target bare metal and since Wasm is discussed in the original post, there's no practical difference between it and CLR/JVM for language intermixing at present - it's just another "common language runtime" if you will. But I agree that the tone used wasn't the best.
- pjmlp 7y agoMaybe the tone wasn't be best one, but I would like to know how WebAssembly is bare metal programming to start with. Also would like to know in what way compiling natively to machine code has to do with having value type semantics on the source language.
- 7y ago