-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from sine-fdn/num-literal-type-inference
Implement limited type inference for numbers
- Loading branch information
Showing
18 changed files
with
840 additions
and
1,062 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,14 +33,14 @@ The circuits generated by Garble are meant to be executed using a cryptographica | |
To execute the Millionaire's problem example, first install the `garble` utility, checkout the repository to get the example programs, then run the function inside the repository directory: | ||
|
||
```sh | ||
$ cargo install garble_lang | ||
$ cargo install garble_lang --features="bin" | ||
$ git clone [email protected]:sine-fdn/garble-lang.git | ||
$ cd garble-lang | ||
$ garble run garble_examples/millionaires.garble.rs --function=main 10000000u64 10000u64 | ||
$ garble run garble_examples/millionaires.garble.rs --function=main 10000000 10000 | ||
Richest::IsA | ||
$ garble run garble_examples/millionaires.garble.rs --function=main 100u64 5000000u64 | ||
$ garble run garble_examples/millionaires.garble.rs --function=main 100 5000000 | ||
Richest::IsB | ||
$ garble run garble_examples/millionaires.garble.rs --function=main 1000u64 1000u64 | ||
$ garble run garble_examples/millionaires.garble.rs --function=main 1000 1000 | ||
Richest::Tie | ||
``` | ||
|
||
|
@@ -52,8 +52,8 @@ You might need to wrap input or metadata in single quotes if they contain whites | |
|
||
The Garble compiler is relatively straightforward and turns a program `&str` into a `circuit::Circuit` (or aborts with a scan/parse/type error). The different steps and their modules are as follows (with steps 1-4 happening during compile time, step 5 during run time): | ||
|
||
1. [`scan.rs`](src/scan.rs) splits a program `&str` into a `token::Token` sequence. | ||
2. [`parse.rs`](src/parse.rs) parses a `token::Token` sequence into an untyped `ast::Program`. | ||
3. [`check.rs`](src/check.rs) type-checks an untyped `ast::Program`, returning a typed `ast::Program`. | ||
4. [`compile.rs`](src/compile.rs) converts a well-typed `ast::Program` into a `circuit::Circuit`. | ||
5. [`eval.rs`](src/eval.rs) executes a `circuit::Circuit` with locally supplied inputs. | ||
1. [`scan.rs`](src/scan.rs) splits a program `&str` into a `token::Token` sequence. | ||
2. [`parse.rs`](src/parse.rs) parses a `token::Token` sequence into an untyped `ast::Program`. | ||
3. [`check.rs`](src/check.rs) type-checks an untyped `ast::Program`, returning a typed `ast::Program`. | ||
4. [`compile.rs`](src/compile.rs) converts a well-typed `ast::Program` into a `circuit::Circuit`. | ||
5. [`eval.rs`](src/eval.rs) executes a `circuit::Circuit` with locally supplied inputs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.