I am having trouble finding one because “Whitespace” is a common word, but I’m curious if this can be done. Thanks.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no such thing — it would require the whole Python language to be running in Whitespace – so that your Python program culd use functions, lists, and other built-ins, not to mention the standard library.
Such a thing could be achievable via Pypy – you could write a Whitespace backend — An effort I doubt could find funding or support.
However, a “one man hack” to get there might be changing the Python byte-code ops to use only whitespace charaters. It would not be “whitespace compatible” – but you would have the same effect in the end: compiled Python files – those we know as “pyc”s could be composed of Whitespace only for the code. (but not for the data and meta-data markup), hacking a couple of files in the Python source tree.
Changing the opcodes themselves is easy – they are in the Lib/opcode.py file in a Python Source tree – but you would have to change the interpreter to work with multi-byte opcodes (as currently all opcodes are one byte+ parameters).