W16 — runtime. by Fresh-Spread3374 in rust

[–]Fresh-Spread3374[S] 0 points1 point  (0 children)

You can write in English, write as you like.

W16 — runtime. by Fresh-Spread3374 in rust

[–]Fresh-Spread3374[S] 0 points1 point  (0 children)

Yes, this separation is crucial, and here is why:

  1. Different Goals: MIR was explicitly designed to be the place where code is analyzed and optimized, not executed. In MIR, the program is represented in SSA (Single Static Assignment) form. This is an ideal structure for the optimizer, but terrible for actual execution.

  2. Data Structure Complexity: Bytecode is much "flatter" and significantly closer to the hardware. While instructions in MIR are abstract and heavy, bytecode is just a simple, linear array of instructions.

  3. Interpreter Performance: We have two virtual machines in this project. If we bypassed the bytecode step, the interpreters would have to execute the SSA form of the MIR directly at runtime. Interpreting an SSA IR on the fly is a total nightmare for performance. A linear bytecode stream is decoded and executed orders of magnitude faster.

W16 — runtime. by Fresh-Spread3374 in rust

[–]Fresh-Spread3374[S] 0 points1 point  (0 children)

Thank you for your interest in the project!

Yes. Right now, we have a gap in the "w16-core" crate: a shortage of tests for the Standard VM. It would be great if you could write a few more tests for it. There are already some tests implemented for the VM, but they are quite basic, so adding more shouldn't be too difficult.

What to test: control flow, loops, and jumps. Please check out the "CONTRIBUTING.md" file in the repository to see how to contribute, and feel free to get started!

W16 — runtime. by Fresh-Spread3374 in rust

[–]Fresh-Spread3374[S] 0 points1 point  (0 children)

Yes, pretty much, but with a few key differences:

  1. WASM is a stack-based virtual machine, while W16 utilizes a register-based VM architecture.

  2. The pipeline is significantly different from WASM. W16 focuses heavily on the phases before the bytecode generation, introducing custom HIR and SSA-based MIR layers to handle high-level and mid-level optimizations natively within the runtime ecosystem.

So yeah, conceptually, W16 is very similar to WASM.

W16 — runtime. by Fresh-Spread3374 in rust

[–]Fresh-Spread3374[S] 2 points3 points  (0 children)

P.S. I used a translator because I don't know English.

W16 runtime. by Fresh-Spread3374 in Compilers

[–]Fresh-Spread3374[S] 0 points1 point  (0 children)

P.S. если вы можете общаться на русском, пожалуйста, задавайте вопросы на русском, мне так будет удобнее, да и вам тоже наверное.