cucapra / cucapra/protocols

Change concrete syntax to use Rust-style `impl` method blocks

Open
#84 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
15
Forks
0
Avg merge
6h 20m
Merged PRs (30d)
15

Description

Kevin suggested that maybe we change the concrete syntax of .prot files so that instead of:

```rust
// Struct definition, followed by multiple function definitions parameterized over DUTs implementing the struct
struct Adder {...}

fn add(in a: u32, in b: u32, out s: u32) { ... }

fn add_incorrect(in a: u32, in b: u32, out s: u32) { ... }
```

we instead have Rust-style "method" syntax:

```rust
struct Adder { ... }

// Define multiple functions associated with the struct type inside an `impl` block
impl Adder {
fn add(self, in a: u32, in b: u32, out s: u32) { ... }

fn add_incorrect(self, in a: u32, in b: u32, out s: u32) { ... }
}
```

(This would make it easier to implement the monitor/backwards interpreter.)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.