Skip to content

Add ctiny (C99) code generator and tests#16

Open
emmapowers wants to merge 6 commits into
modernize/4-cpptiny-optimizationsfrom
modernize/5-ctiny-codegen
Open

Add ctiny (C99) code generator and tests#16
emmapowers wants to merge 6 commits into
modernize/4-cpptiny-optimizationsfrom
modernize/5-ctiny-codegen

Conversation

@emmapowers

Copy link
Copy Markdown
Owner

Summary

  • 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

Test plan

  • C tests pass (34 tests)
  • C++ tests still pass (34 tests)
  • Chat example builds and runs (both ctiny and cpptiny clients)
  • bakelite gen -l ctiny produces valid output

@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bb1c317c-227e-4818-bea9-2ecef23ebec4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

@emmapowers emmapowers force-pushed the modernize/4-cpptiny-optimizations branch from 27a0b44 to 930aade Compare April 14, 2026 14:46
@emmapowers emmapowers force-pushed the modernize/5-ctiny-codegen branch from 205f68a to 2801c4b Compare April 14, 2026 14:46
@emmapowers emmapowers force-pushed the modernize/4-cpptiny-optimizations branch from 930aade to 8026e44 Compare April 14, 2026 14:53
@emmapowers emmapowers force-pushed the modernize/5-ctiny-codegen branch from 2801c4b to 3e6d258 Compare April 14, 2026 14:53
- 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
@emmapowers emmapowers force-pushed the modernize/4-cpptiny-optimizations branch from 8026e44 to abfab0e Compare April 14, 2026 15:34
@emmapowers emmapowers force-pushed the modernize/5-ctiny-codegen branch from 3e6d258 to 6140430 Compare April 14, 2026 15:34
@emmapowers emmapowers force-pushed the modernize/4-cpptiny-optimizations branch from abfab0e to 65938fb Compare April 14, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant