Skip to content

Commit 3bf3c3b

Browse files
Update bytecode-initial.md
1 parent edc8dfe commit 3bf3c3b

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

notes/bytecode-initial.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,23 +178,24 @@ struct Module {
178178

179179
|type|any |tag| | |
180180
|----|--------------|---|-----------------------|-----------------------------|
181-
|JSON|false | 00| | |
182-
| |true | 01| | |
183-
| |null | 02| | |
184-
| |number | 03|u64 | |
181+
|JSON|null | 00| | |
182+
| |number | 01|u64 | |
183+
| |false | 02| | |
184+
| |true | 03| | |
185185
| |string | 04|String | |
186186
| |object | 05|Object | |
187187
| |array | 06|Array<Any> | |
188-
|DJS |bigint+ | 09|BigUInt | |
189-
| |bigint- | 0A|BigUInt | |
190-
| |local_ref | 07|u32 |consts[i] |
191-
|FJS |undefined | 08| | |
192-
| |arg_ref | 09|u32 |args[i] |
193-
| |function | 0A|Function |the last constant is a return|
188+
|DJS |bigint+ | 07|BigUInt | |
189+
| |bigint- | 08|BigUInt | |
190+
| |local_ref | 09|u32 |consts[i] |
191+
|FJS |arg_ref | 0A|u32 |args[i] |
192+
| |undefined | 0B| | |
193+
| |function | 0C|Function |the last constant is a return|
194+
| |... | | | |
194195

195196
## Architecture
196197

197-
Because FunctionalScript is a subset of JavaScript, we can use third-party JavaScript engines to bootstrap our parser, which is written in FunctionalScript, without circular dependencies. In Rust we only need to implement a generic byte code deserializer, that reads byte code and invokes VM API functions.
198+
Because FunctionalScript is a subset of JavaScript, we can use third-party JavaScript engines to bootstrap our parser, which is written in FunctionalScript, without circular dependencies. In Rust, we only need to implement a generic byte code deserializer that reads byte code and invokes VM API functions.
198199

199200
`Deno` is a good candidate because it's written on Rust and can be added as `DevDependency`: https://crates.io/crates/deno
200201

0 commit comments

Comments
 (0)