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
{{ message }}
Repository navigation
binaryen.js seems to not longer be maintained #7526
The Binaryen.js repo seems to not be active for at least a year. PRs are not reviewed, issues are not answered, no recent commits, only automatic ones. Are there any up-to-date ports?
I started to create my own TypeScript wrapper for Binaryen, and I have some questions. Should reference types be nominal or should they be just aliases to numbers? Nominal types are defined like this:
Also, TypeScript allows to make typings more strict for some aspects of Binaryen. For example, it is possible to check expression types at compile time.
Should the typings be kept simple (like in the C API), or is it OK to use advanced features of TS compiler?
@dcodeIO, to clarify, you do still consider the AssemblyScript/binaryen.js repo to be maintained and you do still accept PRs for it? I'm not sure whether you meant the "ship has sailed" on people sending PRs or on the repo being maintained.
The actual JS bindings are part of this repo, WebAssembly/binaryen. AssemblyScript/binaryen.js only contains TypeScript type definitions and the CI job that builds/bundles Binaryen and publishes to npm.
@tlively We are, of course, accepting PRs. I also went ahead and addressed some of the typing changes that had accumulated since the last time I checked - modulo the more recent PRs OP seems to be working on.
More broadly, it's probably true that things haven't been as smooth as they were back when I was quietly holding a bunch of this together. That's the nature of invisible work: you only notice it when it stops. Here, AssemblyScript/binaryen.js is just the last link in the chain - where issues tend to surface, but rarely originate.
In any case, you know how to reach me if a helping hand on the Binaryen end of things would be useful and worth supporting.
Should reference types be nominal or should they be just aliases to numbers?
Nominal. For these reasons:
Even though the references are technically numbers, you probably don't want to do any calculations with them on the TypeScript side. You only pass the references back into binaryen.
You don't want to mix up the different kinds of references. For example, you don't want to pass an ExpressionRef where a FunctionRef is expected.
Activity
GulgDev commentedon Apr 20, 2025
I started to create my own TypeScript wrapper for Binaryen, and I have some questions. Should reference types be nominal or should they be just aliases to numbers? Nominal types are defined like this:
as opposed to number aliases:
Also, TypeScript allows to make typings more strict for some aspects of Binaryen. For example, it is possible to check expression types at compile time.
Should the typings be kept simple (like in the C API), or is it OK to use advanced features of TS compiler?
kripken commentedon Apr 21, 2025
cc @dcodeIO for the AssemblyScript repo
dcodeIO commentedon Apr 21, 2025
PRs welcome, of course, though seems that ship has sailed.
tlively commentedon Apr 21, 2025
@dcodeIO, to clarify, you do still consider the AssemblyScript/binaryen.js repo to be maintained and you do still accept PRs for it? I'm not sure whether you meant the "ship has sailed" on people sending PRs or on the repo being maintained.
CountBleck commentedon Apr 21, 2025
The actual JS bindings are part of this repo, WebAssembly/binaryen. AssemblyScript/binaryen.js only contains TypeScript type definitions and the CI job that builds/bundles Binaryen and publishes to npm.
dcodeIO commentedon Apr 22, 2025
@tlively We are, of course, accepting PRs. I also went ahead and addressed some of the typing changes that had accumulated since the last time I checked - modulo the more recent PRs OP seems to be working on.
More broadly, it's probably true that things haven't been as smooth as they were back when I was quietly holding a bunch of this together. That's the nature of invisible work: you only notice it when it stops. Here, AssemblyScript/binaryen.js is just the last link in the chain - where issues tend to surface, but rarely originate.
In any case, you know how to reach me if a helping hand on the Binaryen end of things would be useful and worth supporting.
hcschuetz commentedon Jun 21, 2025
Nominal. For these reasons:
ExpressionRefwhere aFunctionRefis expected.I am using a copy of https://github.com/AssemblyScript/binaryen.js/blob/main/index.d.ts with modified reference types. For example, I replaced
with
This way my editor (or actually the TypeScript language server) understands far better what I can reasonably do with these values.
Find it at https://github.com/hcschuetz/fft/blob/main/fft-mylang/src/tweaked-binaryen.d.ts but notice that it is based on an older version of the original
.d.tsfilechharvey commentedon Nov 24, 2025
@GulgDev I agree with @hcschuetz : Nominal is better. See AssemblyScript/binaryen.js#100 (comment) for a simple example
chharvey commentedon Apr 29, 2026
I have some bandwidth to start a restructure of this and migrate to TS. Anyone interested is welcome to join my discussion at #8656.