This looks neat.
I'm glad you noted upfront in the documentation about things it can't
handle automatically (e.g., allocations/lifetimes that need special
management).
In your discussion relating this to other work/approaches, you might
want to contrast with SWIG (e.g., you work from the original headers,
when SWIG not available). And, as a practical measure, maybe consider
using some of the information from SWIG when available.
If you or someone later someone wants to do work with C code in
pure-Racket (without the Clang dependency), I recall some earlier work
on C parsing, and you might find some packages for that (also check
PLaneT), maybe including by Dave Herman. A C parser is a lot harder
than one might initially think (it's not just the fairly straightforward
standard grammar with type-based ambiguities, but also getting all the
preprocessing correct while (for some tools needs) retaining
pre-preprocessing information, such as the names of macro uses and fine
source position information), but you can do neat things once you build
it. One of my past employers used such a fancy C parser for "reverse
engineering" C code into a full CASE system (which included other neat
toys, like a high-level structured systems analysis&design,
network-based in-circuit emulator, embedded system code instrumentation
for path coverage, static complexity analysis, test case generation).
BTW, that's a clever use of `at-exp` for embedded C code in your
example. For cases in which that doesn't work as cleanly, people can
also use Racket `#<<`...`#>>` "here strings" (or you can make a simple
special embedded reader, which could also be a cue to an editor/IDE to
treat as C code).
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/ab1f4127-7a49-a59d-10ce-4d2f0202a91a%40neilvandyke.org.
For more options, visit https://groups.google.com/d/optout.