openj / core

abandoned, please check out https://github.com/jsoftware/jsource
https://github.com/jsoftware/jsource
118 stars 26 forks source link

Can't compile J with tcc #36

Open clausecker opened 12 years ago

clausecker commented 12 years ago

I tried to compile J with the tiny C compiler (tcc). Compilation failed. Here is a detailed description of all errors:

http://www.mail-archive.com/tinycc-devel@nongnu.org/msg03685.html

clausecker commented 9 years ago

All of the errors have been fixed in tcc except for the syntax error in p.c. This error comes from tcc's insufficient parser and could be worked around by replacing the definition of cases with:

PT cases[] = {
 {EDGE,      VERB,      NOUN, ANY},       jtmonad,   jtvmonad, 1,2,1,
 {EDGE+AVN,  VERB,      VERB, NOUN},      jtmonad,   jtvmonad, 2,3,2,
 {EDGE+AVN,  NOUN,      VERB, NOUN},      jtdyad,    jtvdyad,  1,3,2,
 {EDGE+AVN,  VERB+NOUN, ADV,  ANY},       jtadv,     jtvadv,   1,2,1,
 {EDGE+AVN,  VERB+NOUN, CONJ, VERB+NOUN}, jtconj,    jtvconj,  1,3,1,
 {EDGE+AVN,  VERB+NOUN, VERB, VERB},      jttrident, jtvfolk,  1,3,1,
 {EDGE,      CAVN,      CAVN, ANY},       jtbident,  jtvhook,  1,2,1,
 {NAME+NOUN, ASGN,      CAVN, ANY},       jtis,      jtvis,    0,2,1,
 {LPAR,      CAVN,      RPAR, ANY},       jtpunc,    jtvpunc,  0,2,0,

};

I believe that doing this change is a bad thing. The source code of the project should not be amended to satisfy the demands of poorly written compilers.