Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The first example sounds like a bug that could sneak in anywhere, but the second one makes me question how they laid out the compiler architecture.

Did they write a special expression parser just for declarations? I mean, this shouldn't be possible if there was just one expression parser?



Probably more to do with compile time static expression evaluation (optimization) than parsing. Seems like it's not actually recursing down, just evaluating the root.


That could be, but my first thought was it's only compiling it to a single assembly instruction (which can only have two operands). Or it generates ADD instructions using a succession of registers or stack locations, but the initialization code blindly assumes the result is in the first register or stack location.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: