Skip to content

binaryen.js seems to not longer be maintained #7526

Description

@GulgDev

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?

Activity

  1. GulgDev commented on Apr 20, 2025

    @GulgDev
    ContributorAuthor

    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:

    declare const __BinaryenExpressionRef: unique symbol;
    export type BinaryenExpressionRef = number & { [__BinaryenExpressionRef]: void };

    as opposed to number aliases:

    export type BinaryenExpressionRef = number;

    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?

  2. kripken commented on Apr 21, 2025

    @kripken
    Member

    cc @dcodeIO for the AssemblyScript repo

  3. dcodeIO commented on Apr 21, 2025

    @dcodeIO
    Contributor

    PRs welcome, of course, though seems that ship has sailed.

  4. tlively commented on Apr 21, 2025

    @tlively
    Member

    @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.

  5. CountBleck commented on Apr 21, 2025

    @CountBleck
    Contributor

    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.

  6. dcodeIO commented on Apr 22, 2025

    @dcodeIO
    Contributor

    @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.

  7. hcschuetz commented on Jun 21, 2025

    @hcschuetz

    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.

    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

    type ExpressionRef = number;
    

    with

    const enum ExpressionRef {}
    

    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.ts file

  8. chharvey commented on Nov 24, 2025

    @chharvey
    Contributor

    @GulgDev I agree with @hcschuetz : Nominal is better. See AssemblyScript/binaryen.js#100 (comment) for a simple example

  9. chharvey commented on Apr 29, 2026

    @chharvey
    Contributor

    I have some bandwidth to start a restructure of this and migrate to TS. Anyone interested is welcome to join my discussion at #8656.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions