Skip to content

Commit 788ff7e

Browse files
committed
Add Azle implementation of collections
1 parent 08b9574 commit 788ff7e

File tree

12 files changed

+1275
-2
lines changed

12 files changed

+1275
-2
lines changed

collections/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include ../*.mk
22

3-
.PHONY: all motoko rust build perf
3+
.PHONY: all motoko rust azle build perf
44
all: build perf
55

66
motoko:
@@ -9,7 +9,10 @@ motoko:
99
rust:
1010
$(call build,rust)
1111

12-
build: motoko rust
12+
azle:
13+
$(call build,azle)
14+
15+
build: motoko rust azle
1316

1417
perf:
1518
$(call perf,collections,perf.sh)

collections/azle/collection.did

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
service: () -> {
2+
batch_get: (nat32) -> ();
3+
batch_put: (nat32) -> ();
4+
batch_remove: (nat32) -> ();
5+
generate: (nat32) -> ();
6+
get_mem: () -> (record {nat; nat; nat}) query;
7+
}

collections/azle/dfx.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"canisters": {
3+
"hashmap": {
4+
"type": "custom",
5+
"main": "src/hashmap.ts",
6+
"candid": "collection.did",
7+
"build": "npx azle hashmap",
8+
"wasm": ".azle/hashmap/hashmap.wasm",
9+
"gzip": false
10+
},
11+
"btreemap": {
12+
"type": "custom",
13+
"main": "src/btreemap.ts",
14+
"candid": "collection.did",
15+
"build": "npx azle btreemap",
16+
"wasm": ".azle/btreemap/btreemap.wasm",
17+
"gzip": false
18+
},
19+
"heap": {
20+
"type": "custom",
21+
"main": "src/heap.ts",
22+
"candid": "collection.did",
23+
"build": "npx azle heap",
24+
"wasm": ".azle/heap/heap.wasm",
25+
"gzip": false
26+
},
27+
"vector": {
28+
"type": "custom",
29+
"main": "src/vector.ts",
30+
"candid": "collection.did",
31+
"build": "npx azle vector",
32+
"wasm": ".azle/vector/vector.wasm",
33+
"gzip": false
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)