Two bugs in recent versions

30 views
Skip to first unread message

Daniel Schroeder

unread,
Feb 22, 2025, 4:02:49 AMFeb 22
to Glowscript Users
A student of mine has an older computer that can't seem to run Web VPython 3.2, so he uses 3.1 instead. No problem, I thought, until he discovered two bugs:

1.  The expression "-1**2" generates an error in versions 3.0 and 3.1.  The expression "-(1)**2", with parentheses around the 1, does not generate an error, but incorrectly evaluates to +1 in versions 2.9, 3.0, and 3.1. See example program here: https://glowscript.org/#/user/dschroeder/folder/Public/program/mathIssue/edit

2.  When you set the data attribute of a gcurve to a list with more than about 100 ordered pairs, some of the list elements can get dropped. This issue seems to occur in versions 2.7 through 3.1, but not in 2.6 or 3.2.  Exactly when elements get dropped seems to depend on the data. See example program here: https://glowscript.org/#/user/dschroeder/folder/Public/program/gcurveDataIssue/edit

Any insight into what's going on here?

Relatedly, is there an easy way to see what has changed with each new version of Web VPython?

Dan

Steve Spicklemire

unread,
Feb 22, 2025, 4:57:56 AMFeb 22
to glowscri...@googlegroups.com, Steve Spicklemire
Hi Daniel,

> On Feb 22, 2025, at 4:02 AM, 'Daniel Schroeder' via Glowscript Users <glowscri...@googlegroups.com> wrote:
>
> Any insight into what's going on here?

I believe the -1**2 is something Bruce fixed in 3.2, here:

https://github.com/vpython/glowscript/commit/fc4ab038528661e31eb338ccfc22152ea4c549f5#diff-c5e06395fc07406665368f378fd4aa946cee660714d79d39d85586c67e59a27fR366

I have no idea how difficult it might be to address the same issue in earlier versions of glowscript, but I can look into it.

I have no idea about the gcurve issue either! But I can look into that as well.

>
> Relatedly, is there an easy way to see what has changed with each new version of Web VPython?
>

Every change in glowscript since Dec 2014 is available in the commit history on GitHub here:

https://github.com/vpython/glowscript

3.1 -> 3.2 appears to have happened around Oct 2021, so it’s been a while!


Daniel Schroeder

unread,
Feb 22, 2025, 5:35:07 AMFeb 22
to glowscri...@googlegroups.com
Hi Steve,

Thanks very much for the quick reply.

Sadly I'm not smart enough to get anything out of what I'm seeing at either of those GitHub links.

Besides the hardware incompatibility that this particular student encountered, my students and I sometimes use older versions because they give better performance.

Dan


> On Feb 22, 2025, at 2:57 AM, Steve Spicklemire <stevespi...@gmail.com> wrote:
>
> Hi Daniel,
>
>> On Feb 22, 2025, at 4:02 AM, 'Daniel Schroeder' via Glowscript Users <glowscri...@googlegroups.com> wrote:
>>
>> Any insight into what's going on here?
>
> I believe the -1**2 is something Bruce fixed in 3.2, here:
>
> https://www.google.com/url?q=https://github.com/vpython/glowscript/commit/fc4ab038528661e31eb338ccfc22152ea4c549f5%23diff-c5e06395fc07406665368f378fd4aa946cee660714d79d39d85586c67e59a27fR366&source=gmail-imap&ust=1740823079000000&usg=AOvVaw1AQ1EhmN0dMpHUF9Nq_1iY
>
> I have no idea how difficult it might be to address the same issue in earlier versions of glowscript, but I can look into it.
>
> I have no idea about the gcurve issue either! But I can look into that as well.
>
>>
>> Relatedly, is there an easy way to see what has changed with each new version of Web VPython?
>>
>
> Every change in glowscript since Dec 2014 is available in the commit history on GitHub here:
>
> https://www.google.com/url?q=https://github.com/vpython/glowscript&source=gmail-imap&ust=1740823079000000&usg=AOvVaw2MYbJy_KD077DFWtBRC_9J
>
> 3.1 -> 3.2 appears to have happened around Oct 2021, so it’s been a while!
>
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "Glowscript Users" group.
> To unsubscribe from this topic, visit https://www.google.com/url?q=https://groups.google.com/d/topic/glowscript-users/F0ribBwAjG8/unsubscribe&source=gmail-imap&ust=1740823079000000&usg=AOvVaw0UA1WsUSLFIgr-75O4ucn7.
> To unsubscribe from this group and all its topics, send an email to glowscript-use...@googlegroups.com.
> To view this discussion visit https://www.google.com/url?q=https://groups.google.com/d/msgid/glowscript-users/6FAFEB8B-D8BD-473F-99BC-3D5DED12ACFD%2540gmail.com&source=gmail-imap&ust=1740823079000000&usg=AOvVaw0ZiD2SXBjENV-FwlGtYjAf.

Bruce Sherwood

unread,
Feb 22, 2025, 8:51:19 PMFeb 22
to Glowscript Users
See http://localhost:8080/docs/VPythonDocs/rate.html#animation-speed:

Animation Speed

Web VPython is intrinsically faster than Python, because it is transpiled to JavaScript, and JavaScript loops are significantly faster than Python loops. However, the addition of Python dictionaries to Web VPython in version 3.2 has led to a slowdown of some Web VPython loops. In most situations this will not be noticeable. However, if your code is loop intensive (for example, if you are animating a large number of particles at once), you may wish to disable dictionaries by changing the first line of your program to:

Web VPython 3.2 nodictionary

Reply all
Reply to author
Forward
0 new messages