Mercurial > repos > rhope
comparison nworker_c.rhope @ 136:fc3815b7462f
Javascript backend now produces working code for some simple examples, still more of the standard lib that needs to be ported.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 14 Nov 2010 23:07:55 -0500 |
parents | 18a4403fe576 |
children | a68e6828d896 |
comparison
equal
deleted
inserted
replaced
135:18a4403fe576 | 136:fc3815b7462f |
---|---|
1447 Blueprint NProgram | 1447 Blueprint NProgram |
1448 { | 1448 { |
1449 Blueprints | 1449 Blueprints |
1450 Workers | 1450 Workers |
1451 Worker Refs | 1451 Worker Refs |
1452 Numtypes | |
1452 } | 1453 } |
1453 | 1454 |
1454 NProgram[:out] | 1455 NProgram[:out] |
1455 { | 1456 { |
1456 out <- [[[Build[NProgram()]]Blueprints <<[Dictionary[]]]Workers <<[Dictionary[]]]Worker Refs <<[Dictionary[]] | 1457 out <- [[[[Build[NProgram()] |
1458 ]Blueprints <<[Dictionary[]] | |
1459 ]Workers <<[Dictionary[]] | |
1460 ]Worker Refs <<[Dictionary[]] | |
1461 ]Numtypes << [("Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64")] | |
1462 } | |
1463 | |
1464 Supported Number Types@NProgram[program:out] | |
1465 { | |
1466 out <- [program]Numtypes >> | |
1457 } | 1467 } |
1458 | 1468 |
1459 Bind Worker@NProgram[prog,name,worker:out] | 1469 Bind Worker@NProgram[prog,name,worker:out] |
1460 { | 1470 { |
1461 after bind <- [prog]Workers << [ [[prog]Workers >>]Set[name, [worker]Name <<[name]] ] | 1471 after bind <- [prog]Workers << [ [[prog]Workers >>]Set[name, [worker]Name <<[name]] ] |
1462 parts <- [name]Split["@"] | 1472 parts <- [name]Split["@"] |
1463 [parts]Index[1] | 1473 bpname <- [parts]Index[1] |
1464 { | 1474 { |
1465 orig bp <- [[after bind]Blueprints >>]Index[~] {} | 1475 If[[~]=[""]] |
1466 { orig bp <- NBlueprint[] } | 1476 { |
1467 out <- [after bind]Blueprints <<[ [[after bind]Blueprints >>]Set[~, [orig bp]Add Method[[parts]Index[0]] ] ] | 1477 out <- Val[after bind] |
1478 }{ | |
1479 orig bp <- [[after bind]Blueprints >>]Index[bpname] {} | |
1480 { orig bp <- NBlueprint[] } | |
1481 out <- [after bind]Blueprints <<[ [[after bind]Blueprints >>]Set[bpname, [orig bp]Add Method[[parts]Index[0]] ] ] | |
1482 } | |
1468 }{ | 1483 }{ |
1469 out <- Val[after bind] | 1484 out <- Val[after bind] |
1470 } | 1485 } |
1471 } | 1486 } |
1472 | 1487 |
1527 ] | 1542 ] |
1528 | 1543 |
1529 parts <- [name]Split["@"] | 1544 parts <- [name]Split["@"] |
1530 [parts]Index[1] | 1545 [parts]Index[1] |
1531 { | 1546 { |
1532 out <- [after reg]Register Method@NProgram[[parts]Index[0], convention, inputs, outputs] | 1547 If[[~]=[""]] |
1548 { | |
1549 out <- [after reg]Register Worker[[parts]Index[0], convention, inputs, outputs] | |
1550 }{ | |
1551 out <- [after reg]Register Method@NProgram[[parts]Index[0], convention, inputs, outputs] | |
1552 } | |
1533 }{ | 1553 }{ |
1534 out <- Val[after reg] | 1554 out <- Val[after reg] |
1535 } | 1555 } |
1536 } | 1556 } |
1537 | 1557 |