I am making a little thing to teach about character codes, mocking up with tributary
One experience I had using tributary. Writing the following code was pretty difficult:
while(bd.length < 8) {
bd = "0" + bd;
}
Of course, tributary is trying to re-run my code for new displays. But when I did not have the update step completed, the while loop is infinite and would lock up the browser. Turning off the auto-update helps; removing the function call before the function is ready to be run also works.
This made me realize tributary as an educational tool for classical programming logic is crippled by this halting problem:
while(true) {
//and then type }
and you're dead, maybe with an unsaved inlet :(
Two thoughts:
1. If used as a tool for beginners, what loop techniques should be taught in tributary instead (that would still relate to most programming languages e.g. avoiding .forEach())?
2. Solving this -- maybe an analysis step:
- Capture new code
- Parse the submitted code to detect while and for loops.
- Add in a cycle depth counter into every loop.
- Add in a kill loop function (return) at the end of the loop when depth==a lot of iterations.
- Send modified code to auto-updater
Geo