ChrisKnott / Algojammer

An experimental code editor for writing algorithms
Apache License 2.0
2.92k stars 107 forks source link

Sheets not refreshing #11

Open j3r3miah opened 5 years ago

j3r3miah commented 5 years ago

Your bubble sort demo works for me, but in my first several attempts to investigate some of my own code the variables didn't update in the Sheet as expected.

I have this code:

import random

S = [random.randint(0, 10) for _ in range(10)]

rv = [[]]
for o in S:
    addtl = []
    for r in rv:
        addtl.append(r + [o])
    rv.extend(addtl)

In which I'm trying to monitor addtl and rv in a Sheet; however, they never update past their initial values.

Here's a screenshare to demonstrate: https://www.youtube.com/watch?v=-4Tmee4Qqzk

bradrn commented 5 years ago

I've noticed this too; the issue seems to be that any class method doesn't work. Here's some that don't work, given a list X:

X.pop(0)
X.append([1,2,3])
m = X.max()

Whereas these do work:

X[0] = 0
X = X + [1,2,3]
m = X[0]

EDIT: No wonder X.max() didn't work - .max() isn't even valid! The correct syntax is max(X), which does indeed work. The other two class methods still don't work though.

ChrisKnott commented 5 years ago

@bradrn thanks for looking into this, I will try and fix it this weekend.

I am not particularly keen on bug fixes in this codebase because it's basically a prototype and fundamentally hacky, but I'm sure this used to work...

bradrn commented 5 years ago

[…] it's basically a prototype […]

I know I'm getting a bit off-topic here, but I'm just wondering: if this application is a prototype only, then what do you have planned for the finished application?

ChrisKnott commented 5 years ago

In implementation terms it will be a fork of CPython, with probably a Qt frontend. This will be more performant and more stable/robust.

Design wise, I am not 100% sure at the moment, people are suggesting several good ideas which I will try and include.

The main features that are missing at the moment are the ability to query things like the stack trace and memory usage. These need to be exposed to metacode to allow for the creation of useful visualisations.