Skip to content

UW-HARVEST/c-rust-program-pairs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

109 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C-Rust Program Pairs

This repository contains a list of C-Rust program pairs. Each pair consists of a C program and a Rust program with similar functionality. The metadata/ directory lists the program pairs. Often the Rust program was translated from or inspired by the C program. Program pairs only include the source code without any dependencies, so they cannot be compiled.

Here is the directory structure for the downloaded cat program pair:

.
└── program_pairs/
    └── cat/
        ├── c-program/
        │   └── cat.c
        └── rust-program/
            └── cat.rs

Prerequisites

You need the SSL development library. On Ubuntu, run:

sudo apt-get install -y pkg-config libssl-dev

Usage

To download all available program pairs into the program_pairs/ directory:

cargo run

To download a small subset of available program pairs:

cargo run demo

To delete program_pairs/ and repository_clones/:

cargo run delete

Terminology

  • Program: Code that compiles to a single executable.
  • Pair: A pair of C and Rust programs with similar functionality.
  • Project: A repository with C or Rust code. A project contains one or more programs.
  • Metadata: Information about one or more pairs.

Resources

Possible TODOs

  • git pull repositories in the cache to update them.
  • Use date or git SHA so repositories downloaded are consistent from run to run.

About

C programs and their Rust translation

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages