Knowledge

urbiscript

Source đź“ť

940:
Aiming at the development of portable robotic applications, urbiscript relies on specific syntactic constructs to specify reactive behaviors such as "go to the charging dock when the battery is low", "play a friendly sound when a known face is recognized", or "stop when an obstacle is detected".
513:
In urbiscript, some control-flow constructs come in several "flavors": two types of sequential composition, and two types of concurrent composition. Under the hood, concurrency is implemented using
302:
style interactive toplevel. However, contrary to others, there is no prompt for user input but answers from the system are prefixed by a timestamp (in milliseconds) between square brackets:
414:
Actually, contrary to most C-like languages and despite what the syntax suggests, statements "have a value", and therefore are expressions, provided they are embedded in braces:
1591: 1621: 1616: 1611: 1631: 1485: 1606: 1596: 231: 1586: 1410: 1601: 220:
is a programming language for robotics. It features syntactic support for concurrency and event-based programming. It is a
1533:
Baillie, Jean-Christophe; Demaille, Akim; Nottale, Matthieu; Hocquet, Quentin (2010). "Events! (Reactivity in urbiscript)".
1636: 350:, as in C which iterates over an iterable object, capturing each element to a local variable for use by the attached block. 27: 720:
Most looping constructs in urbiscript come in several "flavors", which are based on the four statement separators:
388:
clause is run if no exception was thrown. Clean-up code can be guaranteed to be run in every case when given in a
360:, which iterates over an iterable object, capturing each element to a local variable for use by the attached block. 545:. Another statement separator, pipe, denotes "tight sequential composition": no other task can be run between 243: 1626: 299: 284: 224: 221: 205: 102: 31: 1437:
Baillie, Jean-Christophe; Demaille, Akim; Nottale, Matthieu; Hocquet, Quentin; Tardieu, Samuel (2008).
288: 209: 1438: 277: 35: 1571: 396: 63: 1509: 51: 47: 43: 39: 402:, used during debugging to check for conditions that ought to apply. urbiscript also feature 22: 8: 380:, which allows exceptions thrown in its attached code block to be caught and handled by 1534: 613:
Scopes are boundaries for backgrounded jobs, as demonstrated in the following example:
578: 374: 294:
It is designed to program, but also interact with robots; as such, it is influenced by
253: 227: 168: 70: 1508:
Baillie, Jean-Christophe; Demaille, Akim; Nottale, Matthieu; Hocquet, Quentin (2010).
1464:"Urbi: a new parallel & event-driven script language for robotics, games and more" 249: 1028:
Events can have payloads, and event handlers enjoy pattern matching on the payload:
156: 144: 560:
Similarly urbiscript features two means to compose statements concurrently. With
239: 58: 149: 137: 1463: 1580: 1566: 354: 330: 235: 161: 295: 133: 128: 364: 514: 1557: 182: 344: 1539: 370:, which executes a block of code as long as its condition is true. 283:
Its prototype-based object-oriented design was influenced by the
1561: 838:
i.e., the loop bodies are not executed sequentially, while the
594:
are started together; in interactive sessions, this means that
949:
Event handling goes into three steps. First, define an event
715: 276:
From the syntactical point of view, urbiscript belongs to the
1532: 1507: 1436: 201: 1165:
The urbiscript language also allows to monitor expressions:
1390: 336:, which conditionally executes a block of code, along with 260: 525:
Like in C, the semicolon denotes sequential composition:
508: 320: 263:
it supports seamless integration of C++/Java components.
242:) can be added/removed at runtime, and even prototypes ( 1411:"Urbi, the open source operating system for robots" 602:is fully entered and properly followed by either a 1455: 1578: 1202:The following example demonstrates the feature: 1478: 576:is still running. This is very similar to the 582:operator in Unix shells. Alternatively, with 325:urbiscript statements include (among others): 406:blocks, which can be used to factor several 842:keyword runs the loop bodies concurrently: 716:Concurrent flavors of sequential constructs 234:is performed during the program execution ( 1439:"The Urbi Universal Platform for Robotics" 944: 935: 246:) of an object can be changed at runtime. 1538: 520: 1592:Dynamically typed programming languages 266: 1579: 1503: 1501: 1486:"urbiscript Language Reference Manual" 1432: 1430: 1428: 1426: 509:Concurrent statements and control flow 321:Sequential statements and control flow 1622:Prototype-based programming languages 1617:Programming languages created in 2003 1612:Object-oriented programming languages 1526: 744:// This is actually "for;". 108:2.7.4 / November 17, 2011 1632:Text-oriented programming languages 1498: 1461: 1423: 1087:"received event e(1, %s)" 298:and other languages that provide a 13: 1403: 1160: 537:. Other tasks may be run between 280:-family of programming languages. 14: 1648: 1551: 1607:High-level programming languages 1510:"Tag: Job Control in urbiscript" 1597:Free compilers and interpreters 977:Second, specify event handlers 271: 1: 1587:C programming language family 1396: 305:1 + 1; sleep(1s); 1 + 2 * 3; 1602:Cross-platform free software 1000:"received event e" 7: 1637:Robot programming languages 1384: 572:will be --- possibly while 85:; 21 years ago 10: 1653: 1462:Baillie, Jean-Christophe. 1155:*** received event e(1, 2) 568:is run, and at some point 529:stands for "run statement 1315:"%s + %s == %s" 1008:Third, "emit" this event 200: 195: 177: 167: 155: 143: 127: 123: 101: 97: 79: 69: 57: 21: 1355: 1332: 1282: 1256: 1230: 1204: 1167: 1125: 1030: 1010: 979: 951: 844: 741: 615: 416: 945:Explicit event handling 936:Event-based programming 291:programming languages. 64:Jean-Christophe Baillie 384:clauses. An optional 110:; 12 years ago 521:Statement composition 259:Tightly bound to the 1150:*** received event e 1121:*** received event e 1023:*** received event e 300:read-eval-print loop 267:Syntax and semantics 1627:Scripting languages 1572:urbiscript Tutorial 598:won't be run until 533:then run statement 169:Filename extensions 80:First appeared 18: 443:"closed" 254:reference counting 230:. It is dynamic: 228:scripting language 16: 1567:Docker repository 250:Memory management 215: 214: 129:Typing discipline 1644: 1545: 1544: 1542: 1530: 1524: 1523: 1521: 1519: 1514: 1505: 1496: 1495: 1493: 1492: 1482: 1476: 1475: 1473: 1471: 1459: 1453: 1452: 1450: 1448: 1443: 1434: 1421: 1420: 1418: 1417: 1407: 1380: 1375: 1368: 1365: 1362: 1359: 1352: 1345: 1342: 1339: 1336: 1329: 1322: 1319: 1316: 1313: 1310: 1307: 1304: 1301: 1298: 1295: 1292: 1289: 1286: 1279: 1272: 1269: 1266: 1263: 1260: 1253: 1246: 1243: 1240: 1237: 1234: 1227: 1220: 1217: 1214: 1211: 1208: 1198: 1195: 1194:goToChargingDock 1192: 1189: 1186: 1183: 1180: 1177: 1174: 1171: 1156: 1151: 1144: 1141: 1138: 1135: 1132: 1129: 1122: 1115: 1112: 1109: 1106: 1103: 1100: 1097: 1094: 1091: 1088: 1085: 1082: 1079: 1076: 1073: 1070: 1067: 1064: 1061: 1058: 1055: 1052: 1049: 1046: 1043: 1040: 1037: 1034: 1024: 1017: 1014: 1004: 1001: 998: 995: 992: 989: 986: 983: 973: 970: 967: 964: 961: 958: 955: 931: 926: 921: 916: 911: 906: 899: 896: 893: 890: 887: 884: 881: 878: 875: 872: 869: 866: 863: 860: 857: 854: 851: 848: 841: 834: 829: 824: 819: 814: 809: 799: 796: 793: 790: 787: 784: 781: 778: 775: 772: 769: 766: 763: 760: 757: 754: 751: 748: 745: 735: 731: 727: 723: 711: 706: 701: 694: 691: 688: 685: 682: 679: 676: 673: 670: 667: 664: 661: 658: 655: 652: 649: 646: 643: 640: 637: 634: 631: 628: 625: 622: 619: 609: 605: 601: 597: 593: 589: 585: 581: 575: 571: 567: 563: 556: 552: 548: 544: 540: 536: 532: 528: 504: 501: 498: 495: 492: 489: 486: 483: 480: 477: 474: 471: 468: 465: 462: 459: 456: 453: 450: 449:"open" 447: 444: 441: 438: 435: 432: 429: 426: 423: 420: 409: 405: 399: 391: 387: 383: 377: 367: 357: 347: 343:The traditional 339: 333: 316: 311: 252:is performed by 240:member variables 191: 188: 186: 184: 118: 116: 111: 93: 91: 86: 59:Designed by 19: 15: 1652: 1651: 1647: 1646: 1645: 1643: 1642: 1641: 1577: 1576: 1554: 1549: 1548: 1531: 1527: 1517: 1515: 1512: 1506: 1499: 1490: 1488: 1484: 1483: 1479: 1469: 1467: 1460: 1456: 1446: 1444: 1441: 1435: 1424: 1415: 1413: 1409: 1408: 1404: 1399: 1387: 1378: 1373: 1370: 1369: 1366: 1363: 1360: 1357: 1350: 1347: 1346: 1343: 1340: 1337: 1334: 1327: 1324: 1323: 1320: 1317: 1314: 1311: 1308: 1305: 1302: 1299: 1296: 1293: 1290: 1287: 1284: 1277: 1274: 1273: 1270: 1267: 1264: 1261: 1258: 1251: 1248: 1247: 1244: 1241: 1238: 1235: 1232: 1225: 1222: 1221: 1218: 1215: 1212: 1209: 1206: 1200: 1199: 1196: 1193: 1190: 1187: 1184: 1181: 1178: 1175: 1172: 1169: 1163: 1161:Implicit events 1154: 1149: 1146: 1145: 1142: 1139: 1136: 1133: 1130: 1127: 1120: 1117: 1116: 1113: 1110: 1107: 1104: 1101: 1098: 1095: 1092: 1089: 1086: 1083: 1080: 1077: 1074: 1071: 1068: 1065: 1062: 1059: 1056: 1053: 1050: 1047: 1044: 1041: 1038: 1035: 1032: 1022: 1019: 1018: 1015: 1012: 1006: 1005: 1002: 999: 996: 993: 990: 987: 984: 981: 975: 974: 971: 968: 965: 962: 959: 956: 953: 947: 938: 929: 924: 919: 914: 909: 904: 901: 900: 897: 894: 891: 888: 885: 882: 879: 876: 873: 870: 867: 864: 861: 858: 855: 852: 849: 846: 839: 832: 827: 822: 817: 812: 807: 801: 800: 797: 794: 791: 788: 785: 782: 779: 776: 773: 770: 767: 764: 761: 758: 755: 752: 749: 746: 743: 733: 729: 725: 721: 718: 709: 704: 699: 696: 695: 692: 689: 686: 683: 680: 677: 674: 671: 668: 665: 662: 659: 656: 653: 650: 647: 644: 641: 638: 635: 632: 629: 626: 623: 620: 617: 607: 603: 599: 595: 591: 587: 583: 577: 573: 569: 565: 561: 554: 550: 546: 542: 538: 534: 530: 526: 523: 511: 506: 505: 502: 499: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 457: 454: 451: 448: 445: 442: 439: 436: 433: 430: 427: 424: 421: 418: 407: 403: 397: 389: 385: 381: 375: 365: 355: 345: 337: 331: 323: 314: 309: 306: 274: 269: 232:name resolution 225:object-oriented 222:prototype-based 181: 119: 114: 112: 109: 89: 87: 84: 32:object-oriented 12: 11: 5: 1650: 1640: 1639: 1634: 1629: 1624: 1619: 1614: 1609: 1604: 1599: 1594: 1589: 1575: 1574: 1569: 1564: 1553: 1552:External links 1550: 1547: 1546: 1525: 1497: 1477: 1454: 1422: 1401: 1400: 1398: 1395: 1394: 1393: 1386: 1383: 1382: 1381: 1379:*** 1 + 0 == 1 1376: 1356: 1354: 1353: 1333: 1331: 1330: 1328:*** 0 + 0 == 0 1283: 1281: 1280: 1257: 1255: 1254: 1231: 1229: 1228: 1205: 1168: 1162: 1159: 1158: 1157: 1152: 1126: 1124: 1123: 1031: 1026: 1025: 1011: 980: 952: 946: 943: 937: 934: 933: 932: 927: 922: 917: 912: 907: 845: 836: 835: 830: 825: 820: 815: 810: 742: 717: 714: 713: 712: 707: 702: 616: 522: 519: 510: 507: 417: 412: 411: 393: 371: 361: 351: 341: 322: 319: 318: 317: 312: 304: 273: 270: 268: 265: 213: 212: 198: 197: 193: 192: 179: 175: 174: 171: 165: 164: 159: 153: 152: 150:Cross-platform 147: 141: 140: 131: 125: 124: 121: 120: 107: 105: 103:Stable release 99: 98: 95: 94: 81: 77: 76: 73: 67: 66: 61: 55: 54: 28:multi-paradigm 25: 9: 6: 4: 3: 2: 1649: 1638: 1635: 1633: 1630: 1628: 1625: 1623: 1620: 1618: 1615: 1613: 1610: 1608: 1605: 1603: 1600: 1598: 1595: 1593: 1590: 1588: 1585: 1584: 1582: 1573: 1570: 1568: 1565: 1563: 1559: 1556: 1555: 1541: 1536: 1529: 1511: 1504: 1502: 1487: 1481: 1465: 1458: 1440: 1433: 1431: 1429: 1427: 1412: 1406: 1402: 1392: 1389: 1388: 1377: 1372: 1371: 1349: 1348: 1326: 1325: 1276: 1275: 1250: 1249: 1224: 1223: 1203: 1166: 1153: 1148: 1147: 1119: 1118: 1029: 1021: 1020: 1009: 978: 950: 942: 928: 923: 918: 913: 908: 903: 902: 843: 831: 826: 821: 816: 811: 806: 805: 804: 740: 739:For instance 737: 708: 703: 698: 697: 614: 611: 580: 558: 518: 516: 415: 401: 394: 379: 372: 369: 362: 359: 352: 349: 342: 335: 328: 327: 326: 313: 308: 307: 303: 301: 297: 292: 290: 286: 281: 279: 264: 262: 261:Urbi platform 257: 255: 251: 247: 245: 241: 237: 233: 229: 226: 223: 219: 211: 207: 203: 199: 196:Influenced by 194: 190: 180: 176: 172: 170: 166: 163: 160: 158: 154: 151: 148: 146: 142: 139: 135: 132: 130: 126: 122: 106: 104: 100: 96: 82: 78: 75:Gostai et al. 74: 72: 68: 65: 62: 60: 56: 53: 49: 45: 41: 37: 33: 29: 26: 24: 20: 1528: 1516:. Retrieved 1489:. Retrieved 1480: 1468:. Retrieved 1457: 1445:. Retrieved 1414:. Retrieved 1405: 1201: 1176:batteryLevel 1164: 1027: 1007: 976: 948: 939: 837: 802: 738: 719: 612: 559: 524: 512: 413: 324: 293: 282: 275: 258: 248: 244:superclasses 236:late binding 217: 216: 162:BSD licenses 36:event-driven 410:statements. 296:Unix shells 272:Inspiration 1581:Categories 1491:2011-09-20 1416:2012-10-27 1397:References 515:coroutines 238:); slots ( 218:urbiscript 187:/urbiforge 115:2011-11-17 52:reflective 48:procedural 44:functional 40:imperative 17:urbiscript 1540:1010.5694 1518:6 October 1466:. YouTube 1447:6 October 803:displays 400:statement 378:statement 368:statement 358:statement 348:statement 334:statement 71:Developer 1385:See also 847:for& 840:for& 564:, first 392:-clause. 353:Another 287:and the 23:Paradigm 586:, both 584:a&b 390:finally 178:Website 157:License 138:dynamic 113: ( 88: ( 1562:GitHub 732:, and 437:closed 422:status 408:assert 404:assert 398:assert 183:github 1535:arXiv 1513:(PDF) 1470:6 Oct 1442:(PDF) 1188:robot 1179:<= 963:Event 930:*** 4 925:*** 1 920:*** 0 915:*** 2 910:*** 1 905:*** 0 833:*** 4 828:*** 2 823:*** 1 818:*** 1 813:*** 0 808:*** 0 734:& 710:*** 3 705:*** 2 700:*** 1 654:sleep 624:sleep 606:or a 579:& 485:false 479:catch 382:catch 366:while 189:/urbi 1558:urbi 1520:2011 1472:2011 1449:2011 1391:Urbi 1309:echo 1081:echo 994:echo 880:echo 868:echo 780:echo 768:echo 684:echo 666:echo 636:echo 590:and 549:and 541:and 497:true 491:else 458:pass 446:else 395:The 386:else 373:The 363:The 338:else 329:The 285:Self 206:Self 185:.com 134:duck 90:2003 83:2003 1560:on 1259:var 1233:var 1207:var 1182:0.2 1051:var 969:new 954:var 853:var 753:var 747:for 562:a,b 555:a|b 553:in 527:a;b 473:foo 467:try 455:var 419:var 376:try 356:for 346:for 202:C++ 1583:: 1500:^ 1425:^ 1321:); 1300:== 1285:at 1170:at 1143:); 1131:!( 1114:); 1102:!( 1096:); 1072:== 1060:if 1042:?( 1033:at 1016:!; 1003:); 991:?) 982:at 898:}; 895:); 889:** 877:); 798:}; 795:); 789:** 777:); 736:. 728:, 724:, 693:); 681:}; 678:}, 663:); 660:1s 648:}, 633:); 630:2s 610:. 557:. 517:. 503:}; 452:}; 431:if 332:if 289:Io 256:. 210:Io 208:, 204:, 173:.u 145:OS 136:, 50:, 46:, 42:, 38:, 34:, 30:: 1543:. 1537:: 1522:. 1494:. 1474:. 1451:. 1419:. 1374:1 1367:; 1364:1 1361:= 1358:z 1351:1 1344:; 1341:1 1338:= 1335:x 1318:% 1312:( 1306:) 1303:z 1297:y 1294:+ 1291:x 1288:( 1278:0 1271:; 1268:0 1265:= 1262:z 1252:0 1245:; 1242:0 1239:= 1236:y 1226:0 1219:; 1216:0 1213:= 1210:x 1197:; 1191:. 1185:) 1173:( 1140:2 1137:, 1134:1 1128:e 1111:1 1108:, 1105:1 1099:e 1093:x 1090:% 1084:( 1078:) 1075:0 1069:2 1066:% 1063:x 1057:) 1054:x 1048:, 1045:1 1039:e 1036:( 1013:e 997:( 988:e 985:( 972:; 966:. 960:= 957:e 892:2 886:i 883:( 874:i 871:( 865:{ 862:) 859:: 856:i 850:( 792:2 786:i 783:( 774:i 771:( 765:{ 762:) 759:: 756:i 750:( 730:, 726:| 722:; 690:3 687:( 675:) 672:1 669:( 657:( 651:{ 645:) 642:2 639:( 627:( 621:{ 618:{ 608:, 604:; 600:b 596:a 592:b 588:a 574:a 570:b 566:a 551:b 547:a 543:b 539:a 535:b 531:a 500:} 494:{ 488:} 482:{ 476:} 470:{ 464:{ 461:= 440:) 434:( 428:{ 425:= 340:. 315:7 310:2 278:C 117:) 92:)

Index

Paradigm
multi-paradigm
object-oriented
event-driven
imperative
functional
procedural
reflective
Designed by
Jean-Christophe Baillie
Developer
Stable release
Typing discipline
duck
dynamic
OS
Cross-platform
License
BSD licenses
Filename extensions
github.com/urbiforge/urbi
C++
Self
Io
prototype-based
object-oriented
scripting language
name resolution
late binding
member variables

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

↑