-
Notifications
You must be signed in to change notification settings - Fork 273
RFC: Language mode for Rust #6219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If we are adding this then it would also be good to have these for Ada for the https://github.com/diffblue/gnat2goto/ front-end which is currently also using the |
The expected pattern for this (Rust or Ada) is to set up a separate executable, with specialised command-line options. The executable then registers the relevant languages using the Look at |
Both of them use the |
I guess more generally; for languages that are using the |
a. I'm with @martin-cs on this one: But back to points 1, 2, 3:
|
Taking into account the comments and discussion above, would a reasonable choice be as follows. To support the handling of rust in displays and mixed input (i.e. a goto binary comprising of a mixture of
Then for semantic differences between the languages and different language checks:
Comments/feedback very welcome! |
@TGWDB I agree with splitting this in two (getting the correct
As far as I can see there are two ways of resolving this and #6223 . Simple fix approach : inherit from More involved but fuller solution : split HTH |
I think I agree with most of the points raised by @peterschrammel @TGWDB and @martin-cs - in particular, I do quite like the idea of splitting |
@martin-cs I also like the idea of splitting into front-end and back-end parts. |
@TGWDB sorry to hassle but you are assigned as the owner for this. I need to #6223 resolved ASAP. #6233 will do it but I really don't want to merge it because it is a work-around. If you are going to resolve this in the next 24-48 hours then I won't merge #6233 . Also @chrisr-diffblue and @peterschrammel for general interest. |
@martin-cs I cannot promise resolution in 24-48 hours so I propose you go ahead with #6233. |
@TGWDB thanks for the fast response. |
RMC is a new Rust front-end for CBMC. Currently, it uses the
C
mode in the symbol-table. We propose adding aRust
mode to symbols. For now, this mode would have the same semantics asC
, but would allow us to distinguish rust code from C code. This is particularly important as Rust support linking C code using a FFI, which we need to support in RMC.Benefits
Design considerations
Rust is not the only language that would benefit from this. Any new language front-end will likely see the same issues we are, and could benefit from a principled mechanism to alleviate them.
Links and documentation
cbmc/src/util/symbol.h
Line 49 in 1ab5de1
Currently, CBMC appears to have the following langauges:
cbmc/src/cbmc/cbmc_languages.cpp
Lines 25 to 35 in 4889328
The text was updated successfully, but these errors were encountered: