Hacker News new | past | comments | ask | show | jobs | submit login

perl works fine, and you aren't going to unexpected trigger an infinite loop due to some bug in the language definition.

What you can't do is tell how to parse a piece of perl without running the program.

http://www.perlmonks.org/?node_id=663393

These are an expounding upon this link. In most languages, you can at least tell what things are. This is a function. That's a variable. In perl, there are constructs whose parsing depend on what a given bit of code was defined as previously, and that definition can be predicated on code execution. This leaves you in a situation where you cannot tell if something is a division and comment or a regex without knowing whether a function takes arguments. ( see link )




If you can't in general parse a piece of perl without "running the program" as you yourself mentioned then I'm pretty sure that parsing it can definitely trigger infinite loops as perl language is definitely turing complete during run time. So your statement is a contradiction.


The comment said you won't cause an infinite loop during parsing due to a bug in the language definition, not that you can't do so at all. Perl lets you run arbitrary code during parsing, so of course it's possible to run an infinite loop while parsing. But you can only do that by actually writing an infinite loop in your code, not by writing something that confuses the parser into looping forever.




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

Search: