Questions tagged [assemblyscript]

AssemblyScript compiles a strict variant of TypeScript (basically JavaScript with types) to WebAssembly.

101 questions
1
vote
2 answers

Export class from files other than index.ts

I made a file called assembly/Vec3.ts with this content: /** * @constructor * @name pc.Vec3 * @classdesc A 3-dimensional vector. * @description Creates a new Vec3 object. * @param {Number} [x] The x value. If x is an array of length 3, the…
kungfooman
  • 4,473
  • 1
  • 44
  • 33
0
votes
1 answer

npm run asbuild ERR

how to fix the bug of asbuild SyntaxError: missing ) after argument list at Loader.moduleStrategy (internal/modules/esm/translators.js:149:18) npm install --save-dev assemblyscript npx asinit . Y npm run asbuild here is the .log 0 info it…
0
votes
1 answer

Error using a RaspberryPi with PlatformIO and Wasm3

I get this Error, while trying to run C and wasm code (using wasm3) on an raspberrypi using platformio: I am using a RaspberryPi 3 Model B with Raspian I program in Visual Studio Code on the Raspberry I installed PlatformIO as Extension in VS…
0
votes
0 answers

Send/Return string from assemblyscript + wasmtime dotnet

I have the following assemblyscript function: export function echo(str: string) : string { return str; } and I have the following C# function (using wasmtime lib) to send and receive a string: public string Echo(string str) { …
bbqchickenrobot
  • 3,592
  • 3
  • 45
  • 67
0
votes
0 answers

Unable to access __collect() with minimal AssemblyScript runtime

In my AssemblyScript project, I have the following configuration: { "targets": { "debug": { "outFile": "build/debug.wasm", "textFile": "build/debug.wat", "sourceMap": true, "debug": true }, "release": { …
Don McCurdy
  • 10,975
  • 2
  • 37
  • 75
0
votes
0 answers

Unable to load external npm d3 package in assemblyscript TS6054: File '~lib/d3-scale.ts' not found

I am trying to use assemblyscript for charting visualization. I am unable to import d3.js modules in my library. I am getting compilation error. package.json "name": "ts-demo-5", "version": "1.0.0", "description": "", "main": "index.js", …
rty
  • 147
  • 9
0
votes
0 answers

Does returning values from an event handler makes the Subgraph to crash?

I tried returning the entity objects from the event handlers on the AssemblyScript Subgraph code to simplify unit testing. For example, this works fine: // Original code export function handleEventCreation( event: EventCreation ): void…
gagiuntoli
  • 475
  • 5
  • 13
0
votes
0 answers

assemblyscript - how to get keys/values of public variables

I have the following: class Here { public id: string = "here" public dao: string = "good" good(): void { } } In the good function, I need to write a code that returns the keys and values of public variables of Here. Since this is…
Giorgi Lagidze
  • 773
  • 4
  • 24
0
votes
2 answers

SIMD in AssemblyScript

Hey I created a Box Blur algorithm in AssemblyScript. To make it more efficient, I would like to use SIMD Operations. For example I have which looks like this: for(let column: i16 = x + deviationBase + 1; column < x + width - deviationBase;…
0
votes
1 answer

AssemblyScript compilation error: TS2329: Index signature is missing in type

I'm trying to create a sort function in AssemblyScript but am receiving this error in the function. I'd like the sort function to be re-usable and take in two possible sort parameters. I'm passing in a class that has an index signature but getting…
BVBAccelerate
  • 172
  • 1
  • 5
  • 17
0
votes
1 answer

Server-side AssemblyScript: How to read a file?

I'd like to write some server-side AssemblyScript that uses the WASI interface to read a file and process the contents. I know that AssemblyScript and the ByteCode Alliance have recently had a falling out over the "openness" of the WASI standard,…
Chris W
  • 289
  • 1
  • 12
0
votes
1 answer

assigning a nullable type to a non nullable variable

I have the following statement: const to: Address = event.transaction.to; the constant to must not be nullable for the rest of the logic but event.transaction.to is declared as Address | null and the compiler rightly complains that Address | null…
Micha Roon
  • 3,957
  • 2
  • 30
  • 48
0
votes
1 answer

Pong Game - The ball movement is not smooth when storing position with float

I am developing a pong-like game using Wasm4. I have important entities with different approaches for movement, one is the Player which is the paddle and the other is the Ball, the mainly difference between the two of them are that the Player moves…
0
votes
1 answer

How to iterate over dictionary in assemblyscript

let treasury: Record = {}; treasury.firstWallet = "0xEA91B5E687a490380C52d264D5d36558d79F4188".toLowerCase() for (let wallet in treasury) { ... With this code I am getting the below, with a little red arrow between 'wallet' and…
Steve
  • 4,457
  • 12
  • 48
  • 89
0
votes
0 answers

Value only being rendered once

I am making a simple To Do list app using NEAR. I am a beginner in React. I have developed majority of it. One issue I am facing is that, my Note component only renders when there are two notes in the UseState array. Here is how I am rendering.…
paddy
  • 123
  • 1
  • 2
  • 13