From 31165b1519d416fc9fc10872720cbd61080868fe Mon Sep 17 00:00:00 2001 From: Shane Liesegang Date: Sat, 26 Oct 2024 11:53:43 +0800 Subject: [PATCH] overview as I dust this off --- .gitignore | 1 + docs/dev/todo.md | 22 +++++++++++++++++++++- docs/introduction.md | 2 +- docs/protocols.md | 2 ++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b4a008f..a58d253 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ __pycache__ *.egg-info /out/* +/build /.vscode !/**/.gitkeep diff --git a/docs/dev/todo.md b/docs/dev/todo.md index 2efcb02..13bf109 100644 --- a/docs/dev/todo.md +++ b/docs/dev/todo.md @@ -1,7 +1,27 @@ This file is a rough todo list for the tool itself. +* dustoff notes + + linter complaints + - Go writer: + - adding extra nil check when reading struct; compiles but the linter is unhappy + - TypeScript writer: + - ProcessRawBytes tries to push null to the message list if it encounters an unexpected MessageType + - FromBytes + - should not set `da` to null initially + - should not return null + - WriteBytes + - should not set `da` to null initially + + testing + - go: ✅ + - csharp: ✅ + - rust: ✅ + - swift: ✅ + - typescript: ✅ + - c (both gcc and clang): ❌ + - 8 failed, 39 passed + - complaints about mixing declarations and code; shouldn't be a problem post C99? -* immediate todo +* "immediate" todo - make multiple message stream a bit smarter (below) - docstrings in various languages - add "IsValid" function to languages where it makes sense: diff --git a/docs/introduction.md b/docs/introduction.md index 7618544..8a443c8 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -41,7 +41,7 @@ BinaryWriter bw = new BinaryWriter(m); pos.WriteBytes(bw, true); ``` -The code that handles creating the buffer and making a writable stream from it are particular to the .NET system libraries that C# uses, but every language that Beschi targets has some similar kind of functionality. The important thing is that final call, where the data is written into the buffer. Once you have that buffer, you can do whatever you want with it -- send it across a network, write it to disk, etc. +The code that handles creating the buffer and making a writable stream from it is particular to the .NET system libraries that C# uses, but every language that Beschi targets has some similar kind of functionality. The important thing is that final call, where the data is written into the buffer. Once you have that buffer, you can do whatever you want with it -- send it across a network, write it to disk, etc. You can create more complicated data types and messages, too; this was a very simplified example. For more information, look at the [protocol documentation](./protocols.md). diff --git a/docs/protocols.md b/docs/protocols.md index 3356fa8..70316de 100644 --- a/docs/protocols.md +++ b/docs/protocols.md @@ -72,6 +72,8 @@ The following are the base data types that everything else is built from: You can specify that a data member is a list of values by enclosing the type in brackets like so: `[uint64]`. This will get translated to whatever list or array functionality the target language has. You can also have lists of structs like `[Color]` so there is a lot of room to express many different kinds of data. +(Note that a `[bool]` does not do any packing and still uses a single byte per element. Use an integer and bitwise operations like your programming forebears.) + ## Messages