You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a guide or explanation for how classes written in as files are compiled by assemblyscript and usable from there ? Are constructors, static methods, ordinary methods ok and under which conditions ?
The as-bigint package and repo uses them, and apparently it compiles under their obsolete version of assemblyscript and not under current version – and I could not get an explanation for how that's possible.
The as-mpz seems to do the same, and while it uses a more recent version of assemblyscript to do so, the code (especially the built code) is very intricate to understand for a newcomer. In particular, it is very long within a single file and so what makes it work or doesn't work is not easy to understand.
Which is also the reason for guides and documentation to exist: because if retro-engineering is not an efficient way to learn a language.
@Gouvernathor are you attempting to expose (via export class ...) to the host?
Generally, classes behave the exact same way that they would in classic TypeScript. You can also export them and consume as an import (eg. export class Foo {} and import { Foo } from "./foo"), just can't export them from the entry file to be exposed to host
Which is also the reason for guides and documentation to exist: because if retro-engineering is not an efficient way to learn a language.
perhaps i'll go and write some tutorials some time
Activity
JairusSW commentedon Oct 21, 2026
@Gouvernathor are you attempting to expose (via
export class ...) to the host?Generally, classes behave the exact same way that they would in classic TypeScript. You can also export them and consume as an import (eg.
export class Foo {}andimport { Foo } from "./foo"), just can't export them from the entry file to be exposed to hostperhaps i'll go and write some tutorials some time