[Info-vax] NSA on programming languages
Dan Cross
cross at spitfire.i.gajendra.net
Wed Dec 14 09:51:27 EST 2022
In article <tkuadv$1rahv$1 at dont-email.me>,
Stephen Hoffman <seaohveh at hoffmanlabs.invalid> wrote:
>[snip]
>As for other languages for that list, Google have added Carbon
><https://github.com/carbon-language/carbon-lang>, so we'll see how that
>works out.
Carbon is not particulary safe; they decided to take the
approach of "putting in safety after the fact", which seems like
a goal that will be difficult to realize.
>This C-to-Rust transpiler looks like fun, not that I'd be in a rush to
>push the resulting (unsafe) Rust code into production:
><https://github.com/immunant/c2rust>
I think the idea here is that you get it building with the Rust
compiler, avoiding the FFI barrier, and then you can start
wrapping it in a safe interface and then slowly rewrite it in
safe Rust.
>As for transpiling or rewriting more generally, few places will go to
>the effort of replacing the existing C or C++ codeâor the existing
>BLISS or Macro32 code, for that matterâto anything else. Not past
>incremental work and updates, or replacement when substantial updates
>are needed, or other issues arise. Issues such as when one vendor was
>replacing their existing Ada code due to (a lack of) compiler support
>on the target platform.
The whole idea of Carbon is to give you transpiling from
idiomatic C++ to idiomatic Carbon; you get improved syntax and
so forth, and they can address a subset of C++ bugs that way.
Whether anyone other than Google adopts it remains to be seen
(disclaimer: I saw early versions of the spec when I was at
Google. It was hard then to imagine how Carbon would compete
against mature Rust and Swift ecosystems, and even harder now.
Their main selling point seems to be good compatibility with
large, existing C++ code bases, which Google certainly has).
- Dan C.
More information about the Info-vax
mailing list