Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Unfortunately none of my users run IBM or Unisys mainframes (as far as I'm aware at least).


What about Windows/Linux/macOS with CLR, or Android with ART?


The task would involve compiling three big and complex C++ libraries (that have no equivalent in other languages) to the respective bytecode formats, and my past experiments (from the time before Emscripten was a thing) were not very successful. Maybe that has improved in the meantime, maybe not.

Nothing beats clang's wasm output in that regard (e.g. both Emscripten's 'emcc' and Zig's 'zig cc' are drop-in replacements for a GCC-like toolchain which can produce WASM).


C++/CLI supports C++17...


But AFAIK that's only supported by the MSVC toolchain which in turn only runs on Windows (and I tried too often running MSVC on non-Windows operating systems via Wine, even if it works, the process there it's a mess).


But you could run the JVM. Which does the same thing also since decades.

The difference is: The JVM is already proven in production since a very long time.


JVM has it's own object model (which doesn't even have value type support when defining memory layouts), GC, etc. Bad level of abstraction for low level language target (although it has been tried many times).

Not to mention runtime is anything but lightweight and easily embeddable.


"NestedVM provides binary translation for Java Bytecode. This is done by having GCC compile to a MIPS binary which is then translated to a Java class file. Hence any application written in C, C++, Fortran, or any other language supported by GCC can be run in 100% pure Java with no source changes."

http://nestedvm.ibex.org/


I know - I've seen other tech like this, "nobody" uses it for a reason.


I mean, you just create an array of longs and that’s it? That’s pretty much what wasm does as well.

> Not to mention runtime is anything but lightweight and easily embeddable

There are more JVM implementations than Wasm ones, I’m sure there are plenty small, embeddable one. But arguably the best would have been a single, performant JVM built into the browser instead of the JS engine, allowing for both scripted usage and this “sandboxed compile target” one. (Applets failed more due to politics, than anything)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: