Introspection

Jai provides full access to type info (in a compiled language) available at compile time and run time.1

Requesting type info returns a pointer to an entry in the type table that is a TypeInfo struct. These structs can be printed directly for quick and cheap debugging.

for _type_table { // iteration in Jai includes access to two local variables: it, it_index
    // it       - iterator, the current TypeInfo struct
    // it_index - zero-based iteration index, an integer

    print(it);
    // or..
    print("%:\n", it_index);
    print("  name: %\n", it.name);
    print("  type: %\n", it.type);
}

Equivalent data structures are provided for the entire text of the program (at compile time only). 2


  1. introspection / reflection.
    “Reboot Develop 2017 - Jonathan Blow, Thekla Inc. / Making Game Programming Less Terrible.” YouTube, uploaded by Reboot Develop, May 22, 2017, https://youtu.be/De0Am_QcZiQ?t=1945 

  2. data structures for all the code in the program.
    “Reboot Develop 2017 - Jonathan Blow, Thekla Inc. / Making Game Programming Less Terrible.” YouTube, uploaded by Reboot Develop, May 22, 2017, https://youtu.be/De0Am_QcZiQ?t=2551 

jailang 2019 pixeldroid
https://github.com/pixeldroid/jailang
programming pages theme v0.5.21 (https://github.com/pixeldroid/programming-pages)