From f7e862a8fdc2f5592c56076b82d587d75fd10b6c Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Mon, 4 Jul 2022 12:44:40 +0200 Subject: [PATCH] d o c --- Cargo.lock | 88 ++++++++++++++--------------- Cargo.toml | 2 +- doc/crapderive.adoc | 6 +- doc/src/04_solution_strategy.adoc | 4 +- doc/src/05_building_block_view.adoc | 48 ---------------- src/interpret.rs | 2 - 6 files changed, 50 insertions(+), 100 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43a24f5..01f2915 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,16 +26,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "asm-thing" -version = "0.1.0" -dependencies = [ - "ariadne", - "dbg-pls", - "insta", - "logos", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -94,6 +84,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "crapderive" +version = "0.1.0" +dependencies = [ + "ariadne", + "dbg-pls", + "insta", + "logos", +] + [[package]] name = "crc32fast" version = "1.3.2" @@ -105,9 +105,9 @@ dependencies = [ [[package]] name = "dbg-pls" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f28b65c59b1830ac65640335cf2ebef868e8c9982d1cbab01ce843ebe74d37a" +checksum = "50e8bb7470a10e67fb07347d044987e38a7d28ede5a2febfea112626145d885d" dependencies = [ "dbg-pls-derive", "itoa", @@ -123,9 +123,9 @@ dependencies = [ [[package]] name = "dbg-pls-derive" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18ad0d32e09e083b0bf764cc9c2f1956518afb16b6ae0e1110c909d056f8271f" +checksum = "cec2fcd181de78b524aec9f40127b2a49d8d0aa8347594fb4d6e17f02b9fc9ff" dependencies = [ "proc-macro2", "quote", @@ -156,15 +156,15 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" [[package]] name = "indexmap" -version = "1.8.2" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", "hashbrown", @@ -172,9 +172,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.14.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc3e639bcba360d9237acabd22014c16f3df772db463b7446cd81b070714767" +checksum = "4126dd76ebfe2561486a1bd6738a33d2029ffb068a99ac446b7f8c77b2e58dbc" dependencies = [ "console", "once_cell", @@ -219,9 +219,9 @@ dependencies = [ [[package]] name = "linked-hash-map" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "logos" @@ -278,9 +278,9 @@ checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" [[package]] name = "onig" -version = "6.3.1" +version = "6.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ddfe2c93bb389eea6e6d713306880c7f6dcc99a75b659ce145d962c861b225" +checksum = "1eb3502504c9c8b06634b38bfdda86a9a8cef6277f3dec4d8b17c115110dd2a3" dependencies = [ "bitflags", "lazy_static", @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "onig_sys" -version = "69.7.1" +version = "69.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd3eee045c84695b53b20255bb7317063df090b68e18bfac0abb6c39cf7f33e" +checksum = "8bf3fbc9b931b6c9af85d219c7943c274a6ad26cff7488a2210215edd5f49bf8" dependencies = [ "cc", "pkg-config", @@ -320,9 +320,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.1.11" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28f53e8b192565862cf99343194579a022eb9c7dd3a8d03134734803c7b3125" +checksum = "9e1516508b396cefe095485fdce673007422f5e48e82934b7b423dc26aa5e6a4" dependencies = [ "proc-macro2", "syn", @@ -330,18 +330,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" dependencies = [ "proc-macro2", ] @@ -386,18 +386,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" dependencies = [ "proc-macro2", "quote", @@ -406,9 +406,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" dependencies = [ "itoa", "ryu", @@ -441,9 +441,9 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "syn" -version = "1.0.96" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" dependencies = [ "proc-macro2", "quote", @@ -495,9 +495,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" +checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" dependencies = [ "itoa", "libc", @@ -506,9 +506,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" +checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" [[package]] name = "unicode-linebreak" diff --git a/Cargo.toml b/Cargo.toml index 601ac24..5500d7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "asm-thing" +name = "crapderive" version = "0.1.0" edition = "2021" diff --git a/doc/crapderive.adoc b/doc/crapderive.adoc index 3dee586..647e420 100644 --- a/doc/crapderive.adoc +++ b/doc/crapderive.adoc @@ -25,9 +25,6 @@ endif::backend-html5[] // configure EN settings for asciidoc include::src/config.adoc[] - -include::src/about-arc42.adoc[] - // horizontal line *** @@ -86,3 +83,6 @@ include::src/11_technical_risks.adoc[] include::src/12_glossary.adoc[] +*** + +include::src/about-arc42.adoc[] diff --git a/doc/src/04_solution_strategy.adoc b/doc/src/04_solution_strategy.adoc index be07ebe..d17ca42 100644 --- a/doc/src/04_solution_strategy.adoc +++ b/doc/src/04_solution_strategy.adoc @@ -6,7 +6,7 @@ |Quality Goal|Approaches |Ease of implementation| Simple language with not too many features. Many features out of scope, like static data. |Interpreter UX|Keeping track of source locations throughout the compilation/interpretation process, usage of the crate `ariadne` (https://crates.io/crates/ariadne) for displaying diagnostics. -|Performance|Written in the native compiled language. Internally, the AST is compiled into a lower level IR, where jump labels are resolved to instruction offsets. +|Performance|Written in a native compiled language (Rust). Internally, the AST is compiled into a lower level IR, where jump labels are resolved to instruction offsets, and span information is kept separately to improve cache locality. |=== [plantuml] @@ -14,4 +14,4 @@ [Compiler] --> [Interpreter] : Resolve labels [Ariadne] --> [Output] : Diagnostics ----- \ No newline at end of file +---- diff --git a/doc/src/05_building_block_view.adoc b/doc/src/05_building_block_view.adoc index 3c4fdff..322f315 100644 --- a/doc/src/05_building_block_view.adoc +++ b/doc/src/05_building_block_view.adoc @@ -28,51 +28,3 @@ The compiler compiles the AST into the IR, resolving labels. ==== Interpreter `interpret.rs` The interpreter interprets the IR and interacts with the outside world through standard input and output. - - -=== Level 2 - - - -==== White Box __ - - - -__ - -==== White Box __ - - -__ - -... - -==== White Box __ - - -__ - - - -=== Level 3 - - - - -==== White Box <_building block x.1_> - - - - -__ - - -==== White Box <_building block x.2_> - -__ - - - -==== White Box <_building block y.1_> - -__ diff --git a/src/interpret.rs b/src/interpret.rs index 36a0a46..aee327f 100644 --- a/src/interpret.rs +++ b/src/interpret.rs @@ -228,9 +228,7 @@ impl InterpretCtx { } } -// tag::interpret[] pub fn interpret(stmts: Vec) -> Result<()> { - // end::interpret[] let mut ctx = InterpretCtx { memory: vec![0; MEMORY_SIZE], registers: [0; 16],