[Feature request] Modularize machine representation of types - idris-lang/Idris2 GitHub Wiki

Problem

Machine types are baked into the compiler and we provide no API to be able to chose what Int means or what other primitive types are available on the target platform.

This has the following two problems:

  • we can't replace the interpretation of machine types easily
  • The compiler is hardcoding a lot of the machine types, which makes working with them in the compiler tedious.

Solution and its goals

  1. Split up code generation into 2 phases:

    • computing machine representation of types
    • generating code using the chosen type representation
  2. Make the machine representation of types programmable depending on the compiler target