Faux concurrency

15 views
Skip to first unread message

Paul Prescod

unread,
Feb 22, 2018, 4:33:45 PM2/22/18
to Skulpt
Hello Skulptors!

I would like to make a children-focused game engine in Skulpt.

Analogous to scratch but using Python code.

One of the things about making it child (beginner) focused is that it should be possible to do two things “at once” without jumping through a lot of hoops.

For example, I would like to do something analogous to this:

def move_tina_turtle():
Tina.forward(90)
time.sleep(2)
Tina.right(90)
time.sleep(90)
Tina.forward(90)

def move_rita_turtle():
... similar code...

in_parallel(move_tina_turtle, move_rita_turtle)

The in_parallel function will be abstracted so don’t worry about the UI of that, but the challenge is how to implement it?

1. Can I implement in_parallel in JS? Using suspensions?

2. Can i implement it In Python? Using...what?

3. If not, can I expose suspensions to Python similar to Scheme’s call-cc and do everything in Python except the implementation of call-cc?

Does Skulpt have global variables and non-Reentrant code that would make this a huge project?

- Paul
Reply all
Reply to author
Forward
0 new messages