-
Notifications
You must be signed in to change notification settings - Fork 245
Initial development plan
This list is how I'm looking at our initial set of components, tasks, and questions. We can tackle the AST extraction and initial Corrode port in parallel.
- clang-based AST extraction
- rust-based C-AST to Rust translation
- Rust to Rust refactoring tool
-
Define the desired C AST and C-type representation on the Rust side
- Evaluate clang's ASCII dump output
- Identify missing information in AST dump
- Determine ideal C type representation on Rust side
- Determine C AST representation on Rust side
-
Evaluate CastXML for export as alternative to custom tool
-
Determine portable serialization format
- Evaluate protobuf and cbor (others?) for library support in C++ and Rust
-
Implement clang-based AST export tool
- AST serialization tool in terms of clang frontend.
- Use csmith to gain confidence in coverage of C syntax
-
Implement Rust-side deserialization
- Depends on AST and type representation decisions
-
Begin porting Corrode to Rust
- Depends on AST and type representation decisions
-
Build "symbol map" functionality
- Identify components that need external decisions made during export
- Determine file format for symbol map
-
Determine solution for null function pointers
-
Can we create a distinguished null function that we use instead of
NULL
? We'd need to handle zero-initializers and detect comparison toNULL
at function pointer types.void null_function(void) { abort(); } void(*null_function_ptr)(void) = &null_function;
-
Intelligently wrap some function pointers in
optional
-
Wrap all function pointers in
optional
-
-
Establish a solution for tracking macros and comments.
- Preserve macro information in clang.
- Preserve comments with source locations.