Skip to content

Commit

Permalink
overview as I dust this off
Browse files Browse the repository at this point in the history
  • Loading branch information
sjml committed Oct 26, 2024
1 parent ac51e6f commit 31165b1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ __pycache__
*.egg-info

/out/*
/build
/.vscode

!/**/.gitkeep
22 changes: 21 additions & 1 deletion docs/dev/todo.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 2 additions & 0 deletions docs/protocols.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 31165b1

Please sign in to comment.