I was very disappointed that this is “interpreting” some tiny made up language. This is not Python, or even within three orders of magnitude of Python.
Making a Python interpreter in 1024 bytes
11–20 of 120 posts
Re: Making a Python interpreter in 1024 bytes
#12Earlier quoted context omitted.
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
#13A 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
#14A 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?
Uhhh, no. Sure, it's posited by people who feel they are are forced to use it, but it's basically unlearning other syntax.
Here's a study about people with no experience. They do better with python:
https://www.researchgate.net/publication/262256894_An_Empiri...
When the scala language made whitespace optional, it was very divisive, but now it's extremely well accepted.
Re: Making a Python interpreter in 1024 bytes
#15A 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
#16Re: Making a Python interpreter in 1024 bytes
#17Re: Making a Python interpreter in 1024 bytes
#18A 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?
> that criticism is usually posited by users of the language. Uhhh, no. Sure, it's posited by people who feel they are are forced to use it, but it's basically unlearning other syntax. Here's a study about people with no experience. They do better with python: https://www.researchgate.net/publication/262256894_An_Empiri... When the scala language made whitespace optional, it was very divisive, but now it's extremely…
Re: Making a Python interpreter in 1024 bytes
#19Earlier quoted context omitted.
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.
It's just a stack containing strings at the end of the day. Really not a big deal.
Doesn't affect function call stacks though.
Re: Making a Python interpreter in 1024 bytes
#20For those who actually need something like this in production, there is Snek: https://sneklang.org/ > “ Snek is a tiny embeddable language targeting processors with only a few kB of flash and ram. ”