I've almost got XS working in all my test environments. The last issue it seems is the style of code generated for mc.xs.c. When compiling using clang, I get:
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:125:87: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0000 */ { NULL, {.ID = XS_NO_ID, .flag = XS_NO_FLAG, .kind = XS_REFERENCE_KIND}, { .reference = (txSlot*)&gxHeap[3352] } },
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:126:73: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0001 */ { NULL, {.ID = 0, .flag = 0xc0, .kind = XS_INSTANCE_KIND}, { .instance = { NULL, NULL } } },
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:127:73: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0002 */ { NULL, {.ID = 1, .flag = 0xc0, .kind = XS_INSTANCE_KIND}, { .instance = { NULL, NULL } } },
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:128:73: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0003 */ { NULL, {.ID = 2, .flag = 0xc0, .kind = XS_INSTANCE_KIND}, { .instance = { NULL, NULL } } },
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:129:73: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0004 */ { NULL, {.ID = 3, .flag = 0xc0, .kind = XS_INSTANCE_KIND}, { .instance = { NULL, NULL } } },
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:130:73: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0005 */ { NULL, {.ID = 4, .flag = 0xc0, .kind = XS_INSTANCE_KIND}, { .instance = { NULL, NULL } } },
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:131:73: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0006 */ { NULL, {.ID = 5, .flag = 0xc0, .kind = XS_INSTANCE_KIND}, { .instance = { NULL, NULL } } },
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:132:73: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0007 */ { NULL, {.ID = 6, .flag = 0xc0, .kind = XS_INSTANCE_KIND}, { .instance = { NULL, NULL } } },
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:133:73: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0008 */ { NULL, {.ID = 7, .flag = 0xc0, .kind = XS_INSTANCE_KIND}, { .instance = { NULL, NULL } } },
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:134:80: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0009 */ { NULL, {.ID = XS_NO_ID, .flag = 0x80, .kind = XS_STRING_X_KIND}, { .string = "@" } },
^~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:135:80: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0010 */ { NULL, {.ID = XS_NO_ID, .flag = 0x80, .kind = XS_STRING_X_KIND}, { .string = "Symbol.asyncIterator" } },
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:136:80: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0011 */ { NULL, {.ID = XS_NO_ID, .flag = 0x80, .kind = XS_STRING_X_KIND}, { .string = "Symbol.hasInstance" } },
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:137:80: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0012 */ { NULL, {.ID = XS_NO_ID, .flag = 0x80, .kind = XS_STRING_X_KIND}, { .string = "Symbol.isConcatSpreadable" } },
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:138:80: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0013 */ { NULL, {.ID = XS_NO_ID, .flag = 0x80, .kind = XS_STRING_X_KIND}, { .string = "Symbol.iterator" } },
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:139:80: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0014 */ { NULL, {.ID = XS_NO_ID, .flag = 0x80, .kind = XS_STRING_X_KIND}, { .string = "Symbol.match" } },
^~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:140:80: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0015 */ { NULL, {.ID = XS_NO_ID, .flag = 0x80, .kind = XS_STRING_X_KIND}, { .string = "Symbol.replace" } },
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:141:80: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0016 */ { NULL, {.ID = XS_NO_ID, .flag = 0x80, .kind = XS_STRING_X_KIND}, { .string = "Symbol.search" } },
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:142:80: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0017 */ { NULL, {.ID = XS_NO_ID, .flag = 0x80, .kind = XS_STRING_X_KIND}, { .string = "Symbol.species" } },
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tcaswell/Code/xs-shapes/out/mc.xs.c:143:80: error: designator in initializer for scalar type 'txInteger' (aka 'int')
/* 0018 */ { NULL, {.ID = XS_NO_ID, .flag = 0x80, .kind = XS_STRING_X_KIND}, { .string = "Symbol.split" } },
^~~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
...
I've almost got XS working in all my test environments. The last issue it seems is the style of code generated for
mc.xs.c. When compiling using clang, I get:I know I've seen this on newer clang versions (this particular dump is
Apple LLVM version 9.1.0 (clang-902.0.39.2)) .