Skip to content

BigInt.toInt could be zero-cost #31

@illusionalsagacity

Description

@illusionalsagacity

Small thing, if wanting to some compile-time overhead. It also is a good deal faster for me at runtime

Number constructor and bitwise coersion 36.94% slower than BigInt.asIntN(32)

https://github.com/rescript-association/rescript-core/blob/main/src/Core__BigInt.res#L16

@scope("BigInt")
external toInt: (@as(32) _, bigint) => int = "asIntN"

Sure would be nice if we could bind a rescript external function to a js expression for the **:

external exp: (t, t) => t = %rawExpression("%{1} ** %{2}")

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