-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Hirevo/feature/bytecode-compiler
Added a bytecode-based SOM interpreter
- Loading branch information
Showing
64 changed files
with
5,262 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
[package] | ||
name = "som-interpreter" | ||
name = "som-interpreter-ast" | ||
version = "0.1.0" | ||
description = "An interpreter for the Simple Object Machine" | ||
authors = ["Nicolas Polomack <[email protected]>"] | ||
edition = "2018" | ||
publish = false | ||
license = "MIT OR Apache-2.0" | ||
|
||
[lib] | ||
path = "src/lib.rs" | ||
|
||
[[bin]] | ||
name = "som-interpreter" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
# internal | ||
som-core = { path = "../som-core", version = "0.1.0" } | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions
10
...erpreter/tests/basic_interpreter_tests.rs → ...eter-ast/tests/basic_interpreter_tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[package] | ||
name = "som-interpreter-bc" | ||
version = "0.1.0" | ||
description = "A bytecode compiler for the Simple Object Machine" | ||
authors = ["Nicolas Polomack <[email protected]>"] | ||
edition = "2018" | ||
publish = false | ||
license = "MIT OR Apache-2.0" | ||
|
||
[dependencies] | ||
# internal | ||
som-core = { path = "../som-core", version = "0.1.0" } | ||
som-lexer = { path = "../som-lexer", version = "0.1.0" } | ||
som-parser = { package = "som-parser-symbols", path = "../som-parser-symbols", version = "0.1.0" } | ||
# som-parser = { package = "som-parser-text", path = "../som-parser-text", version = "0.1.0" } | ||
|
||
# CLI interface | ||
structopt = "0.3.14" | ||
|
||
# error handling | ||
anyhow = "1.0.31" | ||
|
||
# consistently-ordered hashmaps | ||
indexmap = "1.4.0" | ||
|
||
# big integers | ||
num-bigint = "0.2.6" | ||
num-traits = "0.2.11" | ||
|
||
# random numbers | ||
rand = "0.7.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
The SOM Interpreter | ||
=================== | ||
|
||
This is the interpreter for the Simple Object Machine. | ||
|
||
It is AST-based, in that it works by recursively traversing and evaluating nodes from the Abstract Syntax Tree from **`som-core`**. | ||
|
||
Resources are managed and tracked through reference-counting (using Rust's **`Rc`**/**`Weak`** types). |
Oops, something went wrong.