Add gnaw: a Rust stack language with built-in CTF byte transforms - #2
Open
warlyjr-cloud wants to merge 1 commit into
Open
Add gnaw: a Rust stack language with built-in CTF byte transforms#2warlyjr-cloud wants to merge 1 commit into
warlyjr-cloud wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! Adding gnaw — I think it fits the same slot as Kitten and Stabel on the list: it borrows Forth's model without claiming to be one.
What it is: a small concatenative language in Rust. Whitespace-separated words, a data stack,
: name ... ;definitions, a separate return stack (>r r> r@),if/else/then,begin/until, counteddo/loopwithi, and aseedisassembler that dumps a word's compiled bytecode. Lexer → single-pass compiler (jumps resolved with a stack of pending back-patches, no AST) → bytecode VM with a program counter.What it is not: ANS-compliant. No
IMMEDIATE/POSTPONE, noCREATE/DOES>, no vocabularies. I've tried to say that plainly in the README so nobody arrives expecting a standards Forth.Its actual angle: built-in words for the byte transforms that come up constantly in CTF and reverse-engineering work —
hex>bytes/bytes>hex,xorkey(repeating key),rot13,b64encode/b64decode, andbrute(all 256 single-byte XOR keys, filtered by a natural-language heuristic). They all share an( addr len -- addr len )shape, so they compose, andslurpreads a real file into that same shape. Decoding a challenge ends up as one line:There's a browser playground (WebAssembly, runs locally) if you'd rather poke at it than clone it.
Totally understand if it's out of scope for the list — thanks either way for maintaining it.