Threads for kappa

  1. 6

    That’s not as exciting inside as the title makes it sound. Should be reproducible in any language that allows you to run code very early in compilation phase. You just inject a syntax error after checking for your triggering condition.

    C preprocessor is a good example that will allow you to replicate this easily.

    1. 12

      Yeah, although this one does use an interestingly “Perlish” way to break.

      In the Friday case where f is prototyped with (), you have f() / 1 followed by a comment.

      In the non-Friday case where f has no prototype, you have f( /1;#/ +, where /1;#/ is a regex literal, and then we’re trying to + something and… nope, EOF.

      So it’s dependent on / being both a binop when the parser is looking for an operator, and a quotelike when the parser is looking for a term, and also dependent on the fun ways that prototypes influence the parsing of function calls.

      1. 1

        So… anything with full macros, too, since macros are just compiler extensions.