Skip to content

how are number types inferred #18

Description

@0xF48

typescript has no explicit number types and all numbers in js are f64...can the ts->c compiler infer usage of u32 if it can prove that function calls only from say typedarrays and add the proper types? or will it just convert typedarray access to f64?
maybe this needs some sort of subset of the typescript language where u can optionally pass in proper number types instead of "number" to force the compiler to increase strictness...but then it wouldnt be typescript lol idk...or just fork typescript.
cuz i think v8 can do this where if it sees that u are calling method on u32 typed array, it will compile down to u32 in the assembly.

Activity

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