Skip to content

Commit

Permalink
justfile command and generate extensions jsons
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Sep 4, 2024
1 parent 101ef05 commit 3251a2e
Show file tree
Hide file tree
Showing 5 changed files with 1,846 additions and 0 deletions.
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ coverage language="[rust|python]": (_run_lang language \
recompile-eccs:
scripts/compile-test-eccs.sh

# Generate serialized declarations for the tket2 extensions
gen-extensions:
cargo run -p tket2-hseries gen-extensions -o tket2-py/tket2/extensions/_json_defs

# Runs a rust and a python command, depending on the `language` variable.
#
Expand Down
172 changes: 172 additions & 0 deletions tket2-py/tket2/extensions/_json_defs/tket2/futures.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
{
"version": "0.1.0",
"name": "tket2.futures",
"extension_reqs": [],
"types": {
"Future": {
"extension": "tket2.futures",
"name": "Future",
"params": [
{
"tp": "Type",
"b": "A"
}
],
"description": "A value that is computed asynchronously",
"bound": {
"b": "Explicit",
"bound": "A"
}
}
},
"values": {},
"operations": {
"Dup": {
"extension": "tket2.futures",
"name": "Dup",
"description": "Duplicate a Future. The original Future is consumed and two Futures are returned",
"signature": {
"params": [
{
"tp": "Type",
"b": "A"
}
],
"body": {
"input": [
{
"t": "Opaque",
"extension": "tket2.futures",
"id": "Future",
"args": [
{
"tya": "Type",
"ty": {
"t": "V",
"i": 0,
"b": "A"
}
}
],
"bound": "A"
}
],
"output": [
{
"t": "Opaque",
"extension": "tket2.futures",
"id": "Future",
"args": [
{
"tya": "Type",
"ty": {
"t": "V",
"i": 0,
"b": "A"
}
}
],
"bound": "A"
},
{
"t": "Opaque",
"extension": "tket2.futures",
"id": "Future",
"args": [
{
"tya": "Type",
"ty": {
"t": "V",
"i": 0,
"b": "A"
}
}
],
"bound": "A"
}
],
"extension_reqs": []
}
},
"binary": false
},
"Free": {
"extension": "tket2.futures",
"name": "Free",
"description": "Consume a future without reading it.",
"signature": {
"params": [
{
"tp": "Type",
"b": "A"
}
],
"body": {
"input": [
{
"t": "Opaque",
"extension": "tket2.futures",
"id": "Future",
"args": [
{
"tya": "Type",
"ty": {
"t": "V",
"i": 0,
"b": "A"
}
}
],
"bound": "A"
}
],
"output": [],
"extension_reqs": []
}
},
"binary": false
},
"Read": {
"extension": "tket2.futures",
"name": "Read",
"description": "Read a value from a Future, consuming it",
"signature": {
"params": [
{
"tp": "Type",
"b": "A"
}
],
"body": {
"input": [
{
"t": "Opaque",
"extension": "tket2.futures",
"id": "Future",
"args": [
{
"tya": "Type",
"ty": {
"t": "V",
"i": 0,
"b": "A"
}
}
],
"bound": "A"
}
],
"output": [
{
"t": "V",
"i": 0,
"b": "A"
}
],
"extension_reqs": []
}
},
"binary": false
}
}
}
Loading

0 comments on commit 3251a2e

Please sign in to comment.