logoalt Hacker News

oguz-ismailyesterday at 10:41 AM1 replyview on HN

Cool project. Unlike tcc and cproc though kefir doesn't seem very good at handling big arrays. This

    $ kefir -c - <<x
    int a[] = {
    $(seq 10000000 | tr '\n' ,)
    };
    x
allocates gigabytes of memory and eventually crashes WSL on my machine.

Replies

jprotopopovyesterday at 5:31 PM

I have addressed compiler inefficiency in the sibling comment. This is indeed a problem. Empty arrays of such size should be compile-able (there is sparse representation for arrays). However, I would say that this use case is not particularly practical, at least in none of the projects from my test suite this has been an issue.

show 1 reply