107 questions
Score of 2
1 answer
122 views
What is wrong with this assembly script (wasm) sync barrier using atomics (threads proposal)?
I've implemented a sync barrier (note that I also modeled it in a brute force parallel simulator and it finds no invalid state for 3 threads) in assembly script. Here is the barriere code :
@external(&...
Score of 1
1 answer
57 views
How to re-export classes as part of a namespace in AssemblyScript?
I currently have this code, which works:
export type {
Action as EntityAction,
Asset as EntityAsset,
Batch as EntityBatch,
Batcher as EntityBatcher,
Stream as EntityStream,
Watcher as ...
Score of 1
1 answer
72 views
Are namespaces supported by AssemblyScript?
Something like this:
export namespace Foo {
export const MY_CONSTANT: u32 = 1;
}
And then using it like this:
const value = Foo.MY_CONSTANT;
Score of 0
1 answer
59 views
Is the spread operator (...) available in AssemblyScript?
I couldn't find any information about this in the AssemblyScript docs.
Is the spread operator available in AssemblyScript? I would like to define an object like so:
{ ...params, category: "...
Score of 3
0 answers
229 views
AssemblyScript and JavaScript share memory
When calling a wasm function, I want to avoid frequent copying of function parameters and return values, so I want to use shared memory, but the running results are different from what I expected. How ...
Score of 1
1 answer
42 views
AssemblyScript compiler mentions option noUnsafe. But unsafe does not work, gives compiler error. How to use unsafe to disable runtime bound check?
I am writing a module where I want to maximize performance, so I would like to use the unsafe keyword to disable all run time bound checks.
It also looks like this is supported, because "asc"...
Score of 1
1 answer
52 views
Can I return `this` from a base class instance method in AssemblyScript?
In AssemblyScript, I'm trying to define an instance method in a base class that will return the instance it's called on. I can do this, but the return type does not seem to be resolved correctly.
...
Score of 0
1 answer
38 views
Modus AssemblyScript SDK Installation issue
I'm currently facing an issue installing the Modus AssemblyScript SDK, and I could use some assistance. I have a stable internet connection, but when I attempt to install the SDK with the command:
...
Score of 0
1 answer
112 views
AssemblyScript library files in tsconfig.json
Using AssemblyScript to compile and run untrusted code server-side, I've added some additional library extending the standard library provided by AssemblyScript. These host function bindings are ...
Score of 0
1 answer
88 views
Correct usage of "this" in assemblyscript
I'm working on an AssemblyScript application. The way the code is structured requires passing an instance of a class in the constructor of another class. For example:
class Something {
constructor(...
Score of 1
1 answer
1088 views
Can I protect my source code if I use webassembly?
I am thinking of how I can protect my browser game from bots. As if I wrote it in JavaScript/TypeScript, everything would be so visible on the surface to a bot creator via dev console, that it's ...
Score of 0
1 answer
104 views
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
...
Score of 0
1 answer
98 views
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
...
Score of 1
0 answers
144 views
Allocation too large< ~lib/rt/itcms.ts<$Index out of range,~lib/rt.ts when execute AssemblyScript code
I'm stuck on this when learing web assembly.
basically I have this index.ts file written in assembly script
// The entry file of your WebAssembly module.
class Animal {
constructor() {}
name: i32;...
Score of 0
0 answers
83 views
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 ...