Is there a Python language converter in Whitespace?

I have problems finding it, because Space is a common word, but I'm curious if this can be done. Thanks.

+4
source share
2 answers

There isn’t such a thing - it will require that the entire Python language work in Whitespace, so that your Python program uses functions, lists, and other built-in modules, not to mention the standard library.

This can be achieved through Pypy - you could write a Whitespace backend - An effort that I doubt could find funding or support.

However, a “one person hack” to get there can change Python bytecode operations to use only space characters. It would not be “space-compatible”, but in the end you would have the same effect: compiled Python files — the ones we know as “pyc” can only be compiled from Whitespace for code. (but not for marking up data and metadata) by hacking a couple of files in the Python source tree.

Changing the operation codes themselves is easy - they are in the Lib / opcode.py file in the Python source tree, but you will have to change the interpreter to work with multibyte operation codes (since currently all operation codes are one byte + parameters).

0
source

There is no such program, as far as I know, but there are tools for Whitespace written in Python:

+1
source

All Articles