Add ctiny (C99) code generator and tests#16
Open
emmapowers wants to merge 6 commits into
Open
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
27a0b44 to
930aade
Compare
205f68a to
2801c4b
Compare
930aade to
8026e44
Compare
2801c4b to
3e6d258
Compare
- Add 'bakelite runtime -l python' command to generate runtime files - Support --runtime-import flag for custom import paths - Rewrite Python template for black/ruff/mypy compliance - Use BLANK_LINE variable for clearer template formatting - Generated code uses temporary sys.path modification for imports - Update arduino example with new runtime generation
- Add async_= parameter to send(), poll(), and messages() methods - Use @overload decorators for proper type hints - Support both BufferedIOBase (sync) and StreamReader/StreamWriter (async) - Add messages() as the primary iterator interface for consuming streams
- Replace decorator-based API with dataclass base classes (Struct, BakeliteEnum) - Generate inline pack/unpack code instead of runtime interpretation - Batch consecutive primitive fields into single struct.pack/unpack calls - Simplify ProtocolBase to use class attributes for message mapping
- Replace dual read/write buffers with single shared buffer (~50% memory reduction) - Add zero-copy message<T>() and send<T>() API for packed structs - Add --unpacked flag for platforms without unaligned access support - Add compile-time static_assert to catch platform misuse
- Add ctiny code generator for pure C99 embedded systems - Add TCP chat example demonstrating ctiny and cpptiny interoperability - CMake integration for automatic bakelite code generation - Add ctiny documentation
- Add comprehensive ctiny tests (35 tests): serialization, framing, protocol - Extract shared COBS/CRC implementations to runtimes/common/ - Fix ctiny array codegen using GCC statement-expression extension - Fix ctiny enum unpacking (use temp var to avoid partial writes) - Update cpptiny/ctiny to use shared common code
8026e44 to
abfab0e
Compare
3e6d258 to
6140430
Compare
abfab0e to
65938fb
Compare
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.
Summary
runtimes/common/Test plan
bakelite gen -l ctinyproduces valid output