Felix has been corresponding with me privately, providing suggestions for how to modify the code generated by genturfa'i to generate smaller or more efficient C code when compiled by Chicken.
I've modified genturfa'i to produce top-level definitions for all of the non-terminal rules in a grammar. This was suggested to my early on by Peter Bex on IRC, though to Felix's enduring credit he proved to me why with code examples. :-) After making this change, the jbogenturfahi egg compiles in roughly 12 minutes, down from 2.5 hours. The .c file generated is now around 25MB rather than 60MB. The .so file is 1.7MB, down from 9-10MB. That still seems large to me, but gcc doesn't complain! I also used this opportunity to do a fair bit of optimization to genturfa'i as I tried various approaches. While it didn't affect this particular issue, I did manage to substantially reduce the runtime memory size of the parser generators produced by genturfa'i, which may well avoid other problems for me in the future. This is a good enough result for me to continue developing these eggs rather than focusing on this problem. I will likely create a separate .so file for the grammar itself so that I only run this 12 minute compile when I modify the PEG grammar or the genturfa'i egg, which will happen much less frequently than other code changes I'll be making to jbogenturfa'i as I develop it. I will be more than happy to thoroughly test any changes mode to Chicken's compiler that attempt to optimize large letrec forms with mutually recursive definitions, should any work be done in that area. Thank you everyone! I was afraid this problem would not have a satisfying resolution. I'm really glad to be working with this community! -Alan -- .i ko djuno fi le do sevzi _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users