106 questions
1
vote
1
answer
56
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 ...
1
vote
1
answer
68
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;
0
votes
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: "...
3
votes
0
answers
226
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 ...
1
vote
1
answer
41
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"...
1
vote
1
answer
51
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.
...
0
votes
1
answer
36
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:
...
0
votes
1
answer
110
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 ...
0
votes
1
answer
84
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(...
1
vote
1
answer
1k
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 ...
0
votes
1
answer
103
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
...
0
votes
1
answer
96
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
...
1
vote
0
answers
142
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;...
0
votes
0
answers
79
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 ...
2
votes
1
answer
709
views
AssemblyScript: Function working with i32, but not strings
I have an AssemblyScript function that returns any string it is given, as well as the corresponding code to import and run it in NodeJS:
AssemblyScript:
export function parse(x: string): string {
...
