Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This is Timeside, the language that puts time on your side.
- //everything requires a label. They don't need to be numbers, they can be anything.
- //timelines are threaded
- timeline U1 {
- 0-1: start; //can start or stop time. When time starts the program acts procedurally.
- 0-2: defn hello () {
- 0-3: print "world";
- }
- 0-4: stop; //stop time
- 0-5: print "hello ";
- 0-6: do(reorder(0-5 0-3)); //change control flow and "do" calls the labels
- }
- timeline U2 {
- 1-1: start;
- 1-2: forward(6); //waits six statements
- 1-3: call(U1); //ends up at label "0-6" due to waiting
- }
- bang(U2); //call the starting timeline
- //new program:
- timeline U1 {
- 1-1: stop; //time is automaticall stopped anyway, this is for readability.
- 1-2: y = add(temp(x) temp(x)); //"temp" is a disposable veriable similar to function arguments. The integer "y" is now "x + x".
- 1-3: maketemp(x 2); //makes both instances of "x" 2.
- 1-4: reorder(1-3 1-2);
- 1-5: start;
- 1-6: print y;
- } bang(U1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement