add some libs for experiments

This commit is contained in:
DieMyst 2019-03-13 18:00:00 +03:00
parent 22dd345d41
commit a0374469ce
3 changed files with 45 additions and 5 deletions

View File

@ -2,6 +2,14 @@ import "allocator/tlsf";
//import "allocator/buddy";
//import "allocator/arena";
import { u128 } from "../node_modules/bignum/assembly/integer/u128";
// this is causes OOM
import { AES } from "../node_modules/crypto-ts/src/algo/AES";
// this is too
// import { Queue } from "../node_modules/typescript-collections/src/lib/Queue";
export function allocate(size: i32) :i32 {
return memory.allocate(size);
}
@ -12,6 +20,8 @@ export function deallocate(ptr: i32, size: i32): void {
export function invoke(ptr: i32, size: i32): i32 {
let a = u128.One;
let inputStr: string = String.fromUTF8(ptr, size);
let str = "Hello, world! From user " + inputStr;

28
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "example",
"version": "1.0.0",
"name": "assemblyscript-helloworld",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -23,12 +23,20 @@
"source-map-support": "^0.5.10"
}
},
"assemblyscript-bson": {
"version": "github:nearprotocol/assemblyscript-bson#515a32cc87cfd67f636a2257143b54ba60315598",
"from": "github:nearprotocol/assemblyscript-bson"
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"bignum": {
"version": "github:MaxGraey/bignum.wasm#8e602206447a5c69db977c52040bb3462d3fcd88",
"from": "github:MaxGraey/bignum.wasm"
},
"binaryen": {
"version": "72.0.0-nightly.20190308",
"resolved": "https://registry.npmjs.org/binaryen/-/binaryen-72.0.0-nightly.20190308.tgz",
@ -57,6 +65,13 @@
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"crypto-ts": {
"version": "github:hmoog/crypto-ts#3a5ff1cc2c0f3922fe88062f8106f6562a662c24",
"from": "github:hmoog/crypto-ts",
"requires": {
"tslib": "^1.7.1"
}
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@ -145,6 +160,15 @@
"source-map": "^0.6.0"
}
},
"tslib": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ=="
},
"typescript-collections": {
"version": "github:fluencelabs/typescript-collections#7b75c597d5fc04735d98f847c79cf335b2c2b2fd",
"from": "github:fluencelabs/typescript-collections"
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",

View File

@ -5,12 +5,18 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"asbuild:optimized": "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat --sourceMap --validate --optimize --use abort=''",
"asbuild:optimized": "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat --use abort=''",
"asbuild": "npm run asbuild:optimized"
},
"author": "",
"license": "ISC",
"devDependencies": {
"assemblyscript": "github:AssemblyScript/assemblyscript"
},
"dependencies": {
"bignum": "github:MaxGraey/bignum.wasm",
"assemblyscript-bson": "github:nearprotocol/assemblyscript-bson",
"typescript-collections": "github:fluencelabs/typescript-collections",
"crypto-ts": "github:hmoog/crypto-ts"
}
}