Closed alexdovzhanyn closed 3 months ago
Targeting LLVM as a backend would allow the language to produce native code for all major architectures. LLVM can also compile to WASM, supporting both native and WASM VM options. With built-in code optimization, LLVM makes it easier to generate efficient code.
Targeting WASM as the backend simplifies code generation. Since the language is educational, high performance isn't a priority. WASM's built-in garbage collection (GC) and support for control flow structures make it a better fit for a high-level language. Compiling directly to WASM is also faster than using LLVM.
Pros:
Cons:
Pros:
Cons:
We will target WASM as the backend for the language. WASM allows the language to be more flexible and high-level, aligning with the project's goals. For native compilation, we can use tools like Wasmer to convert our WASM output to native code, maintaining flexibility and ease of implementation.
Investigate options for targeting WebAssembly as the language backend. Decide whether to use WebAssembly Text Format (WAT) or directly compile to WebAssembly binary (WASM). Additionally, explore the possibility of using LLVM as a target Intermediate Representation (IR) for compiling to WebAssembly.
Subtasks: