@@ -6,7 +6,7 @@ Built for experimentation with building dynamic languages.
6
6
This interpreter is very much under development and lacks support for a large part of the
7
7
javascript language.
8
8
9
- You can play around with the interpreter in your browser [ here] ( https://delskayn.github.io/toyjs/ )
9
+ You can play around with an previous version of the interpreter in your browser [ here] ( https://delskayn.github.io/toyjs/ )
10
10
11
11
## Features
12
12
- Register based bytecode VM
@@ -15,33 +15,42 @@ You can play around with the interpreter in your browser [here](https://delskayn
15
15
- Almost safe sweep and trace GC
16
16
- Minimal dependencies.
17
17
18
- ## Running
18
+ ## Current State
19
19
20
- In order to run the vm compile the ` cli ` binary with the following command:
21
- ```
22
- cargo build --release --bin cli
23
- ```
24
- This will produce a binary in the target directory which can execute javascript scripts as following:
25
- ```
26
- cargo run --release --bin cli ./script.js
20
+ The engine is currently undergoing a rewrite and is in a non-functional state.
21
+
22
+ But you can play around with the currently functional parts of the interpreter.
23
+
24
+
25
+ ## Running the interpreter
26
+
27
+ The VM is currently very bare-bones, with only a very small number of instructions implemented.
28
+ A simple example for the VM can ran with
29
+
30
+ ``` sh
31
+ cargo run --example vm
27
32
```
28
33
29
- Toyjs als implements a bunch of tools for debugging the runtime, like various tools which dump the
30
- intermediate representations of the to be run scripts.
31
- These binaries are:
32
- - ` dump_tokens ` which dumps all the tokens generated by the lexer.
33
- - ` dump_ast ` which dumps the generated abstract syntax tree
34
- - ` dump_bytecode ` which dumps bytecode to be executed by the vm.
35
- - ` toyjs_test ` a tool to run the ` test262 ` tests on the interpreter
34
+ All examples take either a file name or assume a script will be piped into stdin.
35
+
36
+ The interpreter has varies tools for printing data-structures and generated source information.
36
37
37
- # WASM
38
- The interpreter also compiles to wasm!
38
+ For printing a AST you can use
39
+ ``` sh
40
+ cargo run --example parse
41
+ ```
42
+ The lexer can similarly be run on code with
43
+ ``` sh
44
+ cargo run --example lex
45
+ ```
39
46
40
- You can play around with a simple REPL in your browser [ here] ( https://delskayn.github.io/toyjs/ ) .
47
+ A overview of symbol information produced by the compiler can be printed with
48
+ ``` sh
49
+ cargo run --example resolve
50
+ ```
41
51
42
- ## Crates
43
- The toyjs interpreter consists of various crates.
44
- The primary crate is ` toyjs ` crate in the repository root.
45
- This crate implements a 'safe', high level interface over the various functions of the interpreter, as well as the javascript runtime.
52
+ A script can be compiled and the compiled instructions can be dumped with
53
+ ``` sh
54
+ cargo run --example compile
55
+ ```
46
56
47
- The implementation of the interpreter itself can be found in the various crates under the ` crates ` directory.
0 commit comments