You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove old implementation of the source code processing, use CxxT IR instead
Tree-sitter based implementation
Figure out how to use boost wave in general, make a POC implementation for preprocessor wrapper
Wrap boost wave in a shared library that provides a simple C callback-based API, in order to be able to use it from nim on all backends. Boost wave is heavily templated, so it would be very inconvenient to interface with it anyway (from nim). Partially done, see src/boost_wave
Implement tree-sitter based C/C++ converter that uses selectively preprocessed C code from previous step. Partially done, see src/hc_tsreader
C and C++ code translation. Partially done, right now mostly works with plain C code. See src/hc_tsconvert
General
Finalize implementation of the source-agnostic (from tree-sitter or libclang) intermediate representation, base all further transformations on it. Partially done, see src/hc_save
Reimplement type graph construction and convenience override generation using CxxT IR
Convert ‘out’ arguments for C functions to nim tuple[] returns :: Need to know which parameters are in, which are out. Sometimes this is mentioned in documentation, but in general this is a "dark knowledge", not formally noted down anywhere.
Wrap ‘raw’ C procedures that return exit codes to raising ones :: Specify list of allowed values, and relations between regular int return and some enum definition.
Convert ‘macro enum groups’ into full nim enums (#define PAPI_OK 0, #define PAPI_EINVAL -1) :: It is possible to infer macro enum boundaries to some degree (if they follow certain naming pattern), but grouping based on "enum begin" and "enum end" seems less error-prone.
CLI tool for generating wrappers
Helper macros :: Sometimes it is easier to write a small file with couple classes/procs rather than installing and running external wrapper generator. This is also needed for interfacing with C++ classes - I need to generate a C++ class and then .importcpp. it back. Not reusing main codegen implementation would be a waste.
The text was updated successfully, but these errors were encountered:
CxxT
IR insteadFinalize implementation of the source-agnostic (from tree-sitter or libclang) intermediate representation, base all further transformations on it. Partially done, see src/hc_save
Reimplement type graph construction and convenience override generation using
CxxT
IRAutomatically generate boilerplate code that makes wrappers easier to use #10
tuple[]
returns :: Need to know which parameters arein
, which areout
. Sometimes this is mentioned in documentation, but in general this is a "dark knowledge", not formally noted down anywhere.int
return and someenum
definition.#define PAPI_OK 0
,#define PAPI_EINVAL -1
) :: It is possible to infer macro enum boundaries to some degree (if they follow certain naming pattern), but grouping based on "enum begin" and "enum end" seems less error-prone.CLI tool for generating wrappers
.importcpp.
it back. Not reusing main codegen implementation would be a waste.The text was updated successfully, but these errors were encountered: