| Crates.io | amvm |
| lib.rs | amvm |
| version | 0.1.0 |
| created_at | 2024-03-13 04:50:25.518153+00 |
| updated_at | 2024-03-13 04:50:25.518153+00 |
| description | Apika's My Virtual Machine. A virtual machine with Intermediate Lenguage |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1171385 |
| size | 76,781 |
AMVM aims to build a virtual machine that runs a custom bytecode. This project is vary pairy with Brayan-724/js-ast, it's a javascript tokenizer, parser and runtime. The goal is to convert javascript to this bytecode and make it more performant, and use this virtual machine to future project that needs a runtime.
String, some numbers u8..).+ - * /).if, for, while).Working on!
This project is very young, so it will be very things to change. If you want to collaborate (I appreciate it) you need to know the followings:
This is divided by two: lib.rs and main.rs.
There're more files that are not for main.rs, but are for lib.rs.
lib.rsHere's all about internals for parse, generate and run the bytecode, this will be published as amvm-core for share it around projects or have a close touch to the engine.
main.rsThis is where the final-user cli is found, so this pretends to have IO operations. Published as amvm to run the bytecode output files.
AMVM_HEADER = "\x08\x48\x30" // Arbitrary value for sign (0B4B30)
COMMAND_SEPARATOR = '\0'
CMD_DCLR_VAR = '\x01'
CMD_ASGN_VAR = '\x0D'
CMD_PUTS = '\x0E'
CMD_EVAL = '\x02'
VAR_CONST = '\x0B'
VAR_LET = '\x0C'
EXPR_VALUE = '\x03'
EXPR_VAR = '\x0A'
EXPR_ADD = '\x09'
VALUE_UNDEFINED = '\x04'
VALUE_STRING = '\x05'
VALUE_U8 = '\x06'
VALUE_I16 = '\x07'
VALUE_F32 = '\x08'
Declare a variable to the current context.
``