Live data from Hacker News

Making a Python interpreter in 1024 bytes

austinhenley.com

1–10 of 120 posts

Re: Making a Python interpreter in 1024 bytes

#2
A lot of criticism of python often mentions the whitespace as lexical scope tokens, and that criticism is usually posited by users of the language.

As implementer of an interpreter, did you feel that whitespace for lexical scoping made the job of writing the lexer significantly more complex?

Re: Making a Python interpreter in 1024 bytes

#3
post #2

A lot of criticism of python often mentions the whitespace as lexical scope tokens, and that criticism is usually posited by users of the language. As implementer of an interpreter, did you feel that whitespace for lexical scoping made the job of writing the lexer significantly more complex?

And, there are multiple white space symbols!

is different than

So you also have to track the actual sequence of counts of white space used for each level, rather than just a simple count.

Re: Making a Python interpreter in 1024 bytes

#6
post #3
post #2

A lot of criticism of python often mentions the whitespace as lexical scope tokens, and that criticism is usually posited by users of the language. As implementer of an interpreter, did you feel that whitespace for lexical scoping made the job of writing the lexer significantly more complex?

And, there are multiple white space symbols! is different than So you also have to track the actual sequence of counts of white space used for each level, rather than just a simple count.

Or you just forbid mixing spaces and tabs in the same indentation sequence, the way most whitespace-sensitive languages seem to end up doing. Or you make a slightly more reasonable rule: spaces may follow tabs, but no tabs may follow a space. That's at least unambiguous.

Re: Making a Python interpreter in 1024 bytes

#9
post #3
post #2

A lot of criticism of python often mentions the whitespace as lexical scope tokens, and that criticism is usually posited by users of the language. As implementer of an interpreter, did you feel that whitespace for lexical scoping made the job of writing the lexer significantly more complex?

And, there are multiple white space symbols! is different than So you also have to track the actual sequence of counts of white space used for each level, rather than just a simple count.

> is different than

in my view, both are the same, both `is` (or ===) an IndentationError raise

Post reply on HN