I gave chatgpt some python code and it told me that the loop would never execute, determined what was wrong with it and suggested a change which it then said would never terminate unless a check was added.
Thanks! The code is executed by an "host" script with a system call, not sure if this breaks the __main__ function in python. We will look into that issue. :)
It's really neat, I like it! It would be nice to catch exceptions, they are currently blowing up, i.e.:
```
ncaught PythonError: Traceback (most recent call last):
File "/lib/python3.11/_pyodide/_base.py", line 460, in eval_code
.run(globals, locals)
^^^^^^^^^^^^^^^^^^^^
File "/lib/python3.11/_pyodide/_base.py", line 306, in run
coroutine = eval(self.code, globals, locals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<exec>", line 7, in <module>
File "<exec>", line 5, in feet_to_meters
ZeroDivisionError: division by zero
```
Really? That hasn't been my experience. Out of 20 python scripts, at least 50% have some error, some of which look right until you run them. A few involve hallucinations, like calling non-existent methods.
But that's why I say, there should be a pypy flag where you tell it to not double check at run time and that you've made sure your annotation is correct.
Now if it isn't correct, you'll probably get a segfault or some nasty error and it'll blow up.
Interesting. Are you sure it's the language and not the programming style? There doesn't seem to be a reason to prevent you from writing maintainable Python code.
reply