Groups | Search | Server Info | Login | Register


Groups > comp.compilers > #3654

Re: Paper: PR2: Peephole Raw Pointer Rewriting with LLMs for Translating C to Safer Rust

Path csiph.com!eternal-september.org!feeder3.eternal-september.org!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From cross@spitfire.i.gajendra.net
Newsgroups comp.compilers
Subject Re: Paper: PR2: Peephole Raw Pointer Rewriting with LLMs for Translating C to Safer Rust
Date Fri, 16 May 2025 15:42:33 -0000
Organization Compilers Central
Sender johnl%iecc.com
Approved comp.compilers@iecc.com
Message-ID <25-05-011@comp.compilers> (permalink)
References <25-05-004@comp.compilers> <25-05-005@comp.compilers> <25-05-006@comp.compilers>
MIME-Version 1.0
Content-Type text/plain; charset="UTF-8"
Injection-Info gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="92960"; mail-complaints-to="abuse@iecc.com"
Keywords Rust
Posted-Date 16 May 2025 13:48:02 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref csiph.com comp.compilers:3654

Show key headers only | View raw


In article <25-05-006@comp.compilers>,  <arnold@freefriends.org> wrote:
>In article <25-05-005@comp.compilers>,
>Derek  <derek-nospam@shape-of-code.com> wrote:
>>I suspect that the same is happening with Rust. If so, how does using
>>Rust make the code safer than using C without any checking switched
>>on?
>
>Rust catches many problems at compile time.  I am not at all a Rust
>expert, or even a novice, but I don't think Rust does runtime
>bounds checking, since it relies on compiler analysis instead.

Other way 'round, mostly.  Array bounds checking is performed at
runtime, but if the compiler can prove that the bounds check is
superfluous (trivial example: the index is the constant 0 for a
non-empty array) then it can elide the code that does the check.
Someone has put together a nice document demonstrating some of
the more useful techniques:

https://github.com/Shnatsel/bounds-check-cookbook/

	- Dan C.

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Paper: PR2: Peephole Raw Pointer Rewriting with LLMs for Translating C to Safer Rust John R Levine <johnl@taugh.com> - 2025-05-09 12:27 -0400
  Re: Paper: PR2: Peephole Raw Pointer Rewriting with LLMs for Translating C to Safer Rust Derek <derek-nospam@shape-of-code.com> - 2025-05-13 21:30 +0100
    Re: Paper: PR2: Peephole Raw Pointer Rewriting with LLMs for Translating C to Safer Rust arnold@freefriends.org - 2025-05-14 08:21 +0000
      Re: Paper: PR2: Peephole Raw Pointer Rewriting with LLMs for Translating C to Safer Rust Kaz Kylheku <643-408-1753@kylheku.com> - 2025-05-14 20:01 +0000
        Re: Paper: PR2: Peephole Raw Pointer Rewriting with LLMs for Translating C to Safer Rust anton@mips.complang.tuwien.ac.at - 2025-05-15 07:48 +0000
      Re: Paper: PR2: Peephole Raw Pointer Rewriting with LLMs for Translating C to Safer Rust George Neuner <gneuner2@comcast.net> - 2025-05-15 11:52 -0400
      Re: Paper: PR2: Peephole Raw Pointer Rewriting with LLMs for Translating C to Safer Rust cross@spitfire.i.gajendra.net - 2025-05-16 15:42 +0000
        Re: Paper: PR2: Peephole Raw Pointer Rewriting with LLMs for Translating C to Safer Rust Kaz Kylheku <643-408-1753@kylheku.com> - 2025-05-16 17:57 +0000

csiph-web