Skip to content

Conversation

@GordonSmith
Copy link
Owner

No description provided.

@GordonSmith GordonSmith requested a review from Copilot October 11, 2025 10:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a comprehensive WIT (WebAssembly Interface Types) code generator tool that parses WIT files using ANTLR4 grammar and generates C++ host function bindings. The tool integrates with the existing cmcpp library to provide type-safe WebAssembly Component Model integration.

Key changes:

  • Adds ANTLR4-based WIT grammar parser with comprehensive test suite (95+ official WIT test files)
  • Implements wit-codegen tool that generates C++ bindings from WIT interface definitions
  • Enhances WAMR sample with generated code and helper functions for simplified host application development

Reviewed Changes

Copilot reviewed 40 out of 44 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vcpkg.json Adds antlr4 dependency for grammar parsing
tools/wit-codegen/wit-codegen.cpp Main WIT code generator implementation using ANTLR visitor pattern
grammar/Wit.g4 Complete ANTLR grammar for WebAssembly Interface Types specification
test/test_grammar.cpp Test suite validating grammar against 95+ official WIT files
include/wamr.hpp Enhanced with helper functions for context creation and memory management
samples/wamr/ Updated sample demonstrating generated bindings usage
CMakeLists.txt Adds packaging configuration and version information

@GordonSmith GordonSmith force-pushed the WIT-CODEGEN branch 2 times, most recently from ed9695f to 186b100 Compare October 11, 2025 11:16
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
@codecov
Copy link

codecov bot commented Oct 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.11%. Comparing base (72f9cda) to head (3cf7915).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #15      +/-   ##
==========================================
+ Coverage   84.08%   84.11%   +0.03%     
==========================================
  Files          19       19              
  Lines        1445     1448       +3     
  Branches      129      129              
==========================================
+ Hits         1215     1218       +3     
  Misses        140      140              
  Partials       90       90              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@GordonSmith GordonSmith merged commit df3606c into main Oct 11, 2025
4 of 5 checks passed
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