dwayne / whitespace-python

A Whitespace interpreter written in Python.
https://web.archive.org/web/20150717190859/http://compsoc.dur.ac.uk:80/whitespace/
MIT License
10 stars 0 forks source link

Source code character limit? #8

Open eli-kaituri-minco opened 3 weeks ago

eli-kaituri-minco commented 3 weeks ago

I wrote a transpiler so I could reasonably code golf in whitespace, so my source code is of decent length. Going over ~2440 characters in the source code file seems to trigger a recursion error due to max depth reached. Is this an inherent limitation due to the implementation of the parser as a recursive function in Python? Or is this a fixable issue within the interpreter code itself?

rzuckerm commented 1 week ago

@eli-kaituri-minco I suspect this code may be to blame:

There's really no reason to do these recursively. However, I don't think this project is maintained anymore. It hasn't been updated since 2018.

Do you have a stack trace that you can share, as well as the code that is causing this? If I can figure out what's going wrong, I may do a fork and fix it.

rzuckerm commented 4 days ago

@eli-kaituri-minco This should be fixed in my fork of this repo called whitespace2. The above functions have been modified to use iteration instead of recursion. I'm not sure if this was the actual issue. If this is still an issue, please log an issue here.