Why it is that C++ can be compiled to JavaScript bytecode that is WebAssembly (using EMSCRIPTEN), but it cannot be compiled to Java Bytecode?

This page summarizes the projects mentioned and recommended in the original post on /r/cpp

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • AECforWebAssembly

    A port of ArithmeticExpressionCompiler from x86 to WebAssembly, so that the programs written in the language can run in a browser. The compiler has been rewritten from JavaScript into C++.

  • Can somebody explain to me, why it is that C++ can be compiled to JavaScript bytecode that is WebAssembly (using EMSCRIPTEN), but it cannot be compiled to Java Bytecode? What is such a big difference between WebAssembly and Java Bytecode? I am asking as somebody who has built a compiler that outputs WebAssembly Text Format (https://github.com/FlatAssembler/AECforWebAssembly.git). It would be nice to be able to use Swing GUI from C++ and have cross-platform C++ executables that run wherever Java runs, wouldn't it? So, why cannot we have that?

  • lljvm

    Low Level Java Virtual Machine

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • WebGui

    An example demo of IMGUI (Immediate Mode GUI) on the web. Using only WebGL, GLFW and ImGui. Suitable for being compiled to web assembly (WASM).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts